Cookie Without a SameSite Attribute
A sensitive cookie is set without a SameSite attribute, so whether browsers attach it to requests started by other sites depends on each browser's default.
| Severity | Informational |
| CVSS 3.1 | 0 CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:N Open in the calculator |
| CVSS 4.0 | 0 CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:N/SC:N/SI:N/SA:N Open in the calculator |
| CWE | CWE-1275: Sensitive Cookie with Improper SameSite Attribute |
| OWASP Top 10 | A01:2025 Broken Access Control |
| Category | Security Misconfiguration |
Description
The SameSite cookie attribute controls whether the browser sends a cookie with requests that another site causes. Strict withholds it from all of them; Lax sends it with them only when they are top-level navigations using a safe method such as GET; and None sends it with all of them and requires Secure. The application sets one or more sensitive cookies without the attribute, so each browser's default applies.
The defaults differ. Chromium-based browsers, such as Chrome and Edge, treat a cookie without the attribute as Lax, but still send it with cross-site top-level POST requests made within two minutes of the cookie being set. Firefox and Safari do not apply Lax by default: they restrict cookies in embedded third-party contexts, but send them with cross-site top-level navigations, including form submissions using POST. The protection users receive therefore depends on their browser.
The missing attribute has no direct impact, but it removes a layer of defence against cross-site request forgery, cross-site WebSocket hijacking and some cross-site information leaks. For users of browsers that do not default to Lax, a page on another site can make requests that carry the session cookie, so any state-changing function without its own anti-forgery protection can be triggered as the logged-in user. The attribute also treats every subdomain of the same registrable domain as the same site, so it offers no protection against requests from those, and where the application uses anti-forgery tokens throughout, its absence adds little.
The issue is identified by inspecting the Set-Cookie headers. A cookie explicitly set to SameSite=None without a need for cross-site use is a related, weaker configuration.
Remediation
Set an explicit SameSite value on every cookie:
- Use
SameSite=Laxfor session cookies in most applications. Users still arrive logged in when following links from other sites, while the cookie is withheld from cross-site POST requests and embedded requests. - Use
SameSite=Strictfor cookies that authorise sensitive actions where users never need to arrive from another site already logged in, or pair aStrictcookie for sensitive actions with aLaxcookie for general browsing. - Use
SameSite=None; Secureonly for cookies that must be sent in cross-site contexts, such as an application embedded in another site's frame or some single sign-on flows, and protect those requests in other ways. - Set the value through the framework where possible, for example
session.cookie_samesitein PHP,Cookie.SameSitein ASP.NET Core cookie options orcookie.sameSitein express-session.
Keep anti-forgery tokens on state-changing requests as well, since the attribute does not cover requests from other subdomains of the same site or browsers that ignore it. Confirm the fix by inspecting the Set-Cookie headers after login.
References
Add This Finding to Your Library
In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.
Free trialYour trial starts when your portal goes live, not when you sign up, so the time you spend setting up does not count. · No card required
Only need the reporting? Our reporting tool is free and open source, with the same library.