Cookies have appropriate SameSite attribute
Why it matters
Without SameSite, browsers send cookies with every cross-origin request — including requests triggered by a third-party page that loads your API. This is the attack surface that CSRF exploits: an attacker's page silently fires a state-changing request (password change, fund transfer, account deletion) and the browser helpfully attaches the user's session cookie. SameSite=Lax blocks cookies on cross-origin subrequests while preserving top-level navigations; Strict blocks all cross-site cookie sending. OWASP A01 (Broken Access Control) and CWE-352 both identify missing SameSite as a direct enabler of CSRF attacks.
Severity rationale
Medium because SameSite is a defense-in-depth CSRF control — missing it exposes state-changing endpoints to cross-site request forgery on browsers without default Lax behavior.
Remediation
Set SameSite explicitly on every cookie your application writes. Relying on the browser's implicit default (Lax in modern browsers) is fragile — older browsers default to None, and future browser policy changes can silently alter behavior.
// Any cookie-setting location
{ sameSite: 'lax', secure: true, httpOnly: true }
Use Strict for session tokens on apps with no legitimate cross-site navigation need. Use None only when your auth flow requires it (e.g., third-party iframe embeds), and always pair with Secure — SameSite=None without Secure is rejected by modern browsers.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Security Headers & Basics Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- cwe · CWE-1275 — Sensitive Cookie with Improper SameSite Attribute
- cwe · CWE-352 — Cross-Site Request Forgery (CSRF)
- owasp:2021 · A01 — Broken Access Control
- soc2:2017 · CC6.7 — Restriction of information transmission, movement, and removal
Taxons
History
- 2026-04-17·v1.0.0·Initial import from security-headers·automated
- 2026-07-06·v1.0.1·Add SOC 2 TSC mapping (CC6.7) from the verified compliance crosswalk register (docs/compliance/).·by soc2-mapping-enrichment-ship-2