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
- 1Set SameSite to exactly Strict, Lax, or None (case-insensitive) with no typos.
- 2If using None, always pair it with the Secure attribute.
- 3Add an automated test that parses Set-Cookie headers and validates attribute values.
Code examples
Correct SameSite value
Set-Cookie: session=abc123; Secure; HttpOnly; SameSite=StrictReferences
Detected automatically by VulnRadar. The check id is cookie-samesite-invalid-value, stable across every scan so you can filter or diff on it.
More cookies checks
- LowCookie Domain Attribute Is Too Broad
- LowCookie Missing Secure Attribute
- InfoThird-Party Cookie Missing Partitioned Attribute
- High__Host- Prefix Cookie Missing Secure Attribute
- High__Host- Prefix Cookie with Non-Root Path
- High__Secure- Prefix Cookie Missing Secure Attribute
- LowCookie Expires/Max-Age Exceeds 1 Year
- InfoCookie Name Leaks Framework or Language
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.