Skip to main content
LowCookiesOWASP A05:2021CWE-1275

How to fix: Cookie Has an Invalid SameSite Value

A cookie sets a SameSite attribute to a value other than Strict, Lax, or None.

Why it matters

Browsers reject or reinterpret unrecognized SameSite values (commonly falling back to Lax), so the CSRF protection the developer intended to configure may not actually be in effect.

SameSite only accepts three defined values: Strict, Lax, and None. A typo (e.g. 'Strong', 'Same-Site', an empty value) silently loses the intended protection instead of raising an error, because cookie attributes fail open by design.

How to fix it

  1. 1Set SameSite to exactly Strict, Lax, or None (case-insensitive) with no typos.
  2. 2If using None, always pair it with the Secure attribute.
  3. 3Add an automated test that parses Set-Cookie headers and validates attribute values.

Code examples

Correct SameSite value

text
Set-Cookie: session=abc123; Secure; HttpOnly; SameSite=Strict

References

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

See every cookies check

Questions

How severe is Cookie Has an Invalid SameSite Value?
VulnRadar rates this low 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-invalid-value, which stays the same between runs so you can filter, diff, or gate CI on it.
Which standards does Cookie Has an Invalid SameSite Value 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 has an invalid samesite value

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 Has an Invalid SameSite Value | VulnRadar