---
title: "CWE-565: Reliance on Cookies without Validation and Integrity Checking"
url: https://radicalnotion.ai/cwe/cwe-565
type: cwe
description: "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."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-565: Reliance on Cookies without Validation and Integrity Checking

- **Abstraction:** Base
- **Structure:** Simple
- **Status:** Incomplete
- **CVEs with this as primary weakness:** 65
- **Of those, in CISA KEV:** 1
- **New in 2026:** 17
- **CWE catalog version:** 4.21

## Description

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.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Architecture and Design | OMISSION: This weakness is caused by missing a security tactic during the architecture and design phase. |
| Implementation | - |

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Confidentiality, Integrity, Availability | Modify Application Data, Execute Unauthorized Code or Commands | Attackers 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. |
| Access Control | Gain Privileges or Assume Identity | 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. |

## Potential mitigations

### Architecture and Design

Avoid using cookie data for a security-related decision.

### Implementation

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.

### Architecture and Design

Add integrity checks to detect tampering.

### Architecture and Design

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.

## Detection methods

### Automated Static Analysis

Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

Effectiveness: High

## Demonstrative examples

### Example 1

The following code excerpt reads a value from a browser cookie to determine the role of the user.

Bad code:

```java
Cookie[] cookies = request.getCookies();
for (int i =0; i< cookies.length; i++) {
    Cookie c = cookies[i];
    if (c.getName().equals("role")) {
        userRole = c.getValue();
    }
}
```

It is easy for an attacker to modify the "role" value found in the locally stored cookie, allowing privilege escalation.

## Observed examples

| CVE | Description |
| --- | --- |
| CVE-2008-5784 | e-dating application allows admin privileges by setting the admin cookie to 1. |

## Real CVEs with this weakness (sample of 12 of 65)

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2026-0257 | PAN-OS: GlobalProtect Authentication Bypass Vulnerabilities | high | 7.8 | - | Yes | 2026-05-13 |
| CVE-2023-41084 | Socomec MOD3GP-SY-120K Reliance on Cookies without Validation and Integrity Checking | critical | 10.0 | - | No | 2023-09-18 |
| CVE-2014-125112 | Plack::Middleware::Session::Cookie versions through 0.21 for Perl allows remote code execution | critical | 9.8 | - | No | 2026-03-26 |
| CVE-2025-65212 | - | critical | 9.8 | - | No | 2026-01-06 |
| CVE-2025-14440 | JAY Login & Register \<= 2.4.01 - Authentication Bypass via Cookie | critical | 9.8 | - | No | 2025-12-13 |
| CVE-2025-2395 | e-Excellence U-Office Force - Improper Authentication | critical | 9.8 | - | No | 2025-03-17 |
| CVE-2024-0947 | Cookies Manipulation in Talya Informatics' Elektraweb | critical | 9.8 | - | No | 2024-06-27 |
| CVE-2024-28288 | - | critical | 9.8 | - | No | 2024-03-30 |
| CVE-2023-35885 | - | critical | 9.8 | - | No | 2023-06-20 |
| CVE-2022-38297 | - | critical | 9.8 | - | No | 2022-09-12 |
| CVE-2019-7266 | Improper Authentication in Nortek Linear eMerge 50P/5000P | critical | 9.8 | - | No | 2019-07-02 |
| CVE-2018-20512 | - | critical | 9.8 | - | No | 2019-01-03 |

## Related attack patterns (CAPEC)

- [CAPEC-226](https://radicalnotion.ai/capec/capec-226): Session Credential Falsification through Manipulation
- [CAPEC-31](https://radicalnotion.ai/capec/capec-31): Accessing/Intercepting/Modifying HTTP Cookies
- [CAPEC-39](https://radicalnotion.ai/capec/capec-39): Manipulating Opaque Client-based Data Tokens

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-602](https://radicalnotion.ai/cwe/cwe-602) | Client-Side Enforcement of Server-Side Security |
| Parent | [CWE-642](https://radicalnotion.ai/cwe/cwe-642) | External Control of Critical State Data |
| Parent | [CWE-669](https://radicalnotion.ai/cwe/cwe-669) | Incorrect Resource Transfer Between Spheres |
| Child | [CWE-784](https://radicalnotion.ai/cwe/cwe-784) | Reliance on Cookies without Validation and Integrity Checking in a Security Decision |

## Taxonomy mappings

| Taxonomy | Entry | Id | Fit |
| --- | --- | --- | --- |
| Software Fault Patterns | Faulty endpoint authentication | SFP29 | - |

## Frequently asked questions

### What is CWE-565?

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.

### What CVEs are caused by CWE-565?

65 recorded CVEs are attributed to CWE-565, including CVE-2026-0257, CVE-2023-41084 and CVE-2014-125112. 1 is listed in CISA's Known Exploited Vulnerabilities (KEV) catalog.

### How do you prevent CWE-565?

Avoid using cookie data for a security-related decision.

### How is CWE-565 detected?

Automated Static Analysis: Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

### What are the consequences of CWE-565?

Exploiting CWE-565 can lead to: Modify Application Data, Execute Unauthorized Code or Commands, Gain Privileges or Assume Identity.

### Is CWE-565 actively exploited?

Yes. 1 CWE-565 vulnerability is in CISA's KEV catalog of actively exploited flaws, out of 65 recorded CVEs.

Primary source: [MITRE CWE](https://cwe.mitre.org/data/definitions/565.html)

---

Source: [RadicalNotion.AI](https://radicalnotion.ai/cwe/cwe-565). Licensed CC BY-NC 4.0; attribute RadicalNotion.AI and link the source page when you reuse this data.
