The product relies on the existence or values of cookies when performing security-critical operations, but it does not properly ensure that the setting is valid for the associated user.
View on MITREAttackers can easily modify cookies, within the browser or by implementing the client-side code outside of the browser. Reliance on cookies without detailed validation and integrity checking can allow attackers to bypass authentication, conduct injection attacks such as SQL injection and cross-site scripting, or otherwise modify inputs in unexpected ways.
It is dangerous to use cookies to set a user's privileges. The cookie can be manipulated to escalate an attacker's privileges to an administrative level.
Avoid using cookie data for a security-related decision.
Perform thorough input validation (i.e.: server side validation) on the cookie data if you're going to use it for a security related decision.
Add integrity checks to detect tampering.
Protect critical cookies from replay attacks, since cross-site scripting or other attacks may allow attackers to steal a strongly-encrypted cookie that also passes integrity checks. This mitigation applies to cookies that should only be valid during a single transaction or session. By enforcing timeouts, you may limit the scope of an attack. As part of your integrity check, use an unpredictable, server-side value that is not exposed to the client.
No detection method information available for this CWE.
The following code excerpt reads a value from a browser cookie to determine the role of the user.
It is easy for an attacker to modify the "role" value found in the locally stored cookie, allowing privilege escalation.
e-dating application allows admin privileges by setting the admin cookie to 1.
View DetailsNo relationship information available for this CWE.
CWE-565: Reliance on Cookies without Validation and Integrity Checking is a Common Weakness Enumeration (CWE) entry maintained by MITRE. The product relies on the existence or values of cookies when performing security-critical operations, but it does not properly ensure that the setting is valid for the associated user.
If exploited, CWE-565 (Reliance on Cookies without Validation and Integrity Checking) it can compromise Confidentiality, Integrity, Availability and Access Control, leading to outcomes such as Modify Application Data, Execute Unauthorized Code or Commands and Gain Privileges or Assume Identity.
Recommended mitigations for CWE-565 include: Avoid using cookie data for a security-related decision. Perform thorough input validation (i.e.: server side validation) on the cookie data if you're going to use it for a security related decision. Add integrity checks to detect tampering.
MITRE documents real CVEs mapped to CWE-565, including CVE-2008-5784. You can look up the full details of each CVE, including CVSS scores and remediation guidance, on our CVE Lookup tool.
A CWE (Common Weakness Enumeration) like CWE-565 describes a category of software weakness — the underlying flaw type. A CVE (Common Vulnerabilities and Exposures) identifies a specific, real-world vulnerability in a particular product. In short, a CWE is the kind of mistake, and a CVE is an instance of that mistake being found in software.