day3 Web Application Security Flashcards
(35 cards)
Security Considerations
- Web browser: Client-side security
- Web server: Hardening and configuration, Logging and monitoring
- Application server: Secure coding practices, Authentication and authorization
- Database: Access Control and Encryption, Monitoring and Auditing
…………… is a small piece of data that a server sends to a user’s web browser. The browser may store the cookie and send it back to the same server with later requests.
It remembers stateful information for the stateless HTTP protocol.
HTTP cookie
Cookies are mainly used for three purposes:
Session management: Logins, shopping carts, game scores, or anything else the server should remember
Personalization: User preferences, themes, and other settings
Tracking: Recording and analyzing user behavior
Security: HttpOnly, Secure, SameSite attributes help mitigate common security issues like
XSS, CSRF.
SET COOKIE
Set-Cookie: <cookie-name>=<cookie-value>
Attributes?</cookie-value></cookie-name>
- Domain
- Expires
- Max-Age
- Path
- Secure
- HttpOnly
- SameSite
T/F If the Domain attribute is specified, the cookie becomes available to the
specified domain and all its subdomains. This makes the cookie less restrictive
T
T/F The Path attribute in a cookie specifies the URL path that must be present in
the requested URL for the cookie to be sent to the server
T
T/F : A cookie with secure attribute is only sent to the server with an encrypted request over the HTTPS protocol.
T
T/F A cookie with HttpOnly attribute is inaccessible to the JavaScript (document.cookie API)
T
T/F The SameSite attribute is used to control when and how cookies are sent
with cross-site requests
T
T/F Sessions are typically represented as associative arrays of keys and values,
used to track web application data and objects.
A session ID is a long, randomly generated number or string – exchanged between the client and server during each transaction
T
…………….is the process of verifying the identity of a user, system, or entity attempting to access resources.
Authentication
Common Types OF Authentication
Knowledge based - Something you know
Possession based - Something you have
Inheritance based - Something you are
AUTHENTICATION TESTING
Map the entire authentication attack surface
Login interfaces, account recovery / password resets, registration, MFA processes, session management, third-party SSO integrations
-Create multiple accounts
-Check for lack of brute-force protection
-Is the application using a standard library/framework?
-Check for logic issues
-Inspect tokens
ACCESS CONTROL
What you’re allowed to do - also known as authorization
Principle of least privilege
Users and processes should have a minimum level of access
Access control types
Horizontal, Vertical, Context dependant
…………. is a type of access control vulnerability that occurs when an application exposes a reference to an
internal implementation object—like a file, database record, or user ID—
without properly validating whether the user is authorized to access it.
Insecure Direct Object Reference (IDOR)
………………. is a security vulnerability that occurs when an application fails to properly enforce access control at the level of specific functions or actions.
Broken Function Level Authorization (BFLA)
What’s the difference between IDOR and BFLA?
BFLA :User can access functions or actions they’re not allowed to (like admin features).
IDOR: User can access objects (like files, accounts, etc.) they shouldn’t by changing an ID.
WEAK OR MISSING ACCESS
CONTROLS
Sometimes applications use user input that we can control for access control, such as HTTP methods or headers.
Check to see if modifying the HTTP request will lead to unintended behaviour.
HTTP Method
Headers (e.g. Referrer, X-Origin-URL)
…………….. is a common attack vector that injects malicious code into a vulnerable web application.
Cross site scripting (XSS)
T/F XSS differs from other web attack vectors (e.g., SQL injections), in that it does not directly target the application itself. Instead, the users of the web application are the ones at risk.
T
……………– malicious script is stored on the web server, typically in a database, and is then executed by other users viewing the stored content – More dangerous than reflected.
Persistent / Stored XSS
……………malicious script is reflected off a web server in an immediate response
Reflected XSS