Skip to main content
MediumCookiesOWASP A05:2021CWE-1275

How to fix: Cookie Missing SameSite Attribute

A cookie is set without the SameSite attribute. Without SameSite, the cookie is sent on all cross-site requests (or defaults to SameSite=Lax in modern browsers), potentially enabling CSRF attacks.

Why it matters

Without SameSite=Lax or Strict, cross-site POST requests (CSRF attacks) carry the session cookie. Older browsers that do not enforce a default SameSite will include the cookie in every cross-origin request.

SameSite controls whether a cookie is sent with cross-site requests. SameSite=Strict prevents the cookie from being sent on any cross-site request. SameSite=Lax (the browser default in Chrome) allows top-level navigation GET requests but blocks cross-site POST. Explicitly setting SameSite is more portable than relying on browser defaults.

How to fix it

  1. 1Add SameSite=Lax for most session cookies (allows OAuth redirects and link clicks to work).
  2. 2Add SameSite=Strict for admin or high-privilege cookies where cross-site navigation should not carry the session.
  3. 3Add SameSite=None; Secure only for cookies explicitly needed in third-party contexts.

Code examples

SameSite=Lax (recommended default)

HTTP
Set-Cookie: __Host-session=abc123; HttpOnly; Secure; SameSite=Lax; Path=/

SameSite=Strict (high-privilege)

HTTP
Set-Cookie: __Host-admin-token=xyz; HttpOnly; Secure; SameSite=Strict; Path=/admin

References

Detected automatically by VulnRadar. The check id is cookie-samesite-missing, stable across every scan so you can filter or diff on it.

See every cookies check

Questions

How severe is Cookie Missing SameSite Attribute?
VulnRadar rates this medium severity in the cookies category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
Does VulnRadar check for this automatically?
Yes. It runs as part of every scan under the check id cookie-samesite-missing, which stays the same between runs so you can filter, diff, or gate CI on it.
Which standards does Cookie Missing SameSite Attribute map to?
It maps to CWE-1275. In the OWASP Top 10 it falls under A05:2021.

Missing a check?

The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.

Propose a checkHow a check is built

Scan your own site for cookie missing samesite attribute

VulnRadar runs this check and hundreds more against a URL in seconds. No agent to install, just paste a URL.

Or scan this site as a demoRead the docs

How to fix: Cookie Missing SameSite Attribute | VulnRadar