Overview
Cookies carry session tokens, auth data, and preferences. Missing or misconfigured flags expose them to theft, fixation, and cross-site attacks.Check Cookies
Browser DevTools
Application → Cookies → inspect flags per cookie.Cookie Flags
HttpOnly
Secure
SameSite
Domain
Risk: Broad domain scope → XSS on any subdomain can steal cookie.
Path
Risk:
Path is NOT a security boundary — JavaScript from other paths can read it via iframe tricks.
Expires / Max-Age
Vulnerability Matrix
Exploitation
Steal Cookie via XSS (No HttpOnly)
Sniff Cookie (No Secure Flag)
CSRF (SameSite=None)
Subdomain Cookie Theft (Broad Domain)
IfDomain=.target.com and XSS on blog.target.com:
Session Fixation
If application accepts session ID from URL or doesn’t regenerate after login:Prevention Check
- Login with session X
- After login, check if session ID changed
- If same → session fixation vulnerable
Cookie Prefixes
Modern browsers support special prefixes:__Host- prevents subdomain and path scoping attacks.