CWE-1275

Sensitive Cookie with Improper SameSite Attribute

Medium

Description

The SameSite attribute for sensitive cookies is not set, or an insecure value is used.

Potential Impact

How to Fix

Implementation

Set the SameSite attribute of a sensitive cookie to 'Lax' or 'Strict'. This instructs the browser to apply this cookie only to same-domain requests, which provides a good Defense in Depth against CSRF attacks. When the 'Lax' value is in use, cookies are also sent for top-level cross-domain navigation via HTTP GET, HEAD, OPTIONS, and TRACE methods, but not for other HTTP methods that are more like to cause side-effects of state mutation.

Detection Methods

Related Weaknesses

References

View on MITRE CWE Database →

Need Help Fixing This Vulnerability?

Our security experts can help you identify and remediate CWE-1275 vulnerabilities in your codebase.

Get Security Assessment