---
title: "CWE-807: Reliance on Untrusted Inputs in a Security Decision"
url: https://radicalnotion.ai/cwe/cwe-807
type: cwe
description: "The product uses a protection mechanism that relies on the existence or values of an input, but the input can be modified by an untrusted actor in a way that bypasses the protection mechanism."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-807: Reliance on Untrusted Inputs in a Security Decision

- **Abstraction:** Base
- **Structure:** Simple
- **Status:** Incomplete
- **Likelihood of exploit:** High
- **CVEs with this as primary weakness:** 125
- **Of those, in CISA KEV:** 2
- **New in 2026:** 89
- **CWE catalog version:** 4.21

## Description

The product uses a protection mechanism that relies on the existence or values of an input, but the input can be modified by an untrusted actor in a way that bypasses the protection mechanism.

Without sufficient encryption, integrity checking, or other mechanism, any input that originates from an outsider cannot be trusted.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Architecture and Design | COMMISSION: This weakness refers to an incorrect design related to an architectural security tactic. |
| Implementation | Developers may assume that inputs such as cookies, environment variables, and hidden form fields cannot be modified. |

## Applicable platforms

**Technologies:** Web Based (Undetermined), Web Server (Undetermined)

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Confidentiality, Access Control, Availability | Bypass Protection Mechanism, Gain Privileges or Assume Identity, Varies by Context | When security decisions such as authentication and authorization are made based on the values of these inputs, attackers can bypass the security of the product to access whatever is being protected. An attacker could change these inputs using customized clients or other attacks. This change might not be detected. The consequences will depend on the associated functionality, but they can range from granting additional privileges to untrusted users to bypassing important security checks. Ultimately, this weakness may lead to exposure or modification of sensitive data, system crash, or execution of arbitrary code. |

## Potential mitigations

### Architecture and Design (Attack Surface Reduction)

Store state information and sensitive data on the server side only.

Ensure that the system definitively and unambiguously keeps track of its own state and user state and has rules defined for legitimate state transitions. Do not allow any application user to affect state directly in any way other than through legitimate actions leading to state transitions.

If information must be stored on the client, do not do so without encryption and integrity checking, or otherwise having a mechanism on the server side to catch tampering. Use a message authentication code (MAC) algorithm, such as Hash Message Authentication Code (HMAC) \[REF-529\]. Apply this against the state or sensitive data that has to be exposed, which can guarantee the integrity of the data - i.e., that the data has not been modified. Ensure that a strong hash function is used (CWE-328).

### Architecture and Design (Libraries or Frameworks)

Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid.

With a stateless protocol such as HTTP, use a framework that maintains the state for you.

Examples include ASP.NET View State \[REF-756\] and the OWASP ESAPI Session Management feature \[REF-45\].

Be careful of language features that provide state support, since these might be provided as a convenience to the programmer and may not be considering security.

### Architecture and Design

For any security checks that are performed on the client side, ensure that these checks are duplicated on the server side, in order to avoid CWE-602. Attackers can bypass the client-side checks by modifying values after the checks have been performed, or by changing the client to remove the client-side checks entirely. Then, these modified values would be submitted to the server.

### Operation, Implementation (Environment Hardening)

When using PHP, configure the application so that it does not use register\_globals. During implementation, develop the application so that it does not rely on this feature, but be wary of implementing a register\_globals emulation that is subject to weaknesses such as CWE-95, CWE-621, and similar issues.

### Architecture and Design, Implementation (Attack Surface Reduction)

Understand all the potential areas where untrusted inputs can enter your software: parameters or arguments, cookies, anything read from the network, environment variables, reverse DNS lookups, query results, request headers, URL components, e-mail, files, filenames, databases, and any external systems that provide data to the application. Remember that such inputs may be obtained indirectly through API calls.

Identify all inputs that are used for security decisions and determine if you can modify the design so that you do not have to rely on submitted inputs at all. For example, you may be able to keep critical information about the user's session on the server side instead of recording it within external data.

## Detection methods

### Manual Static Analysis

Since this weakness does not typically appear frequently within a single software package, manual white box techniques may be able to provide sufficient code coverage and reduction of false positives if all potentially-vulnerable operations can be assessed within limited time constraints.

Effectiveness: High. The effectiveness and speed of manual analysis will be reduced if the there is not a centralized security mechanism, and the security logic is widely distributed throughout the software.

### Automated Static Analysis - Binary or Bytecode

According to SOAR \[REF-1479\], the following detection techniques may be useful:

Cost effective for partial coverage:

- Bytecode Weakness Analysis - including disassembler + source code weakness analysis
- Binary Weakness Analysis - including disassembler + source code weakness analysis

Effectiveness: SOAR Partial

### Manual Static Analysis - Binary or Bytecode

According to SOAR \[REF-1479\], the following detection techniques may be useful:

Cost effective for partial coverage:

- Binary / Bytecode disassembler - then use manual analysis for vulnerabilities & anomalies

Effectiveness: SOAR Partial

### Dynamic Analysis with Automated Results Interpretation

According to SOAR \[REF-1479\], the following detection techniques may be useful:

Cost effective for partial coverage:

- Web Application Scanner
- Web Services Scanner
- Database Scanners

Effectiveness: SOAR Partial

### Dynamic Analysis with Manual Results Interpretation

According to SOAR \[REF-1479\], the following detection techniques may be useful:

Cost effective for partial coverage:

- Fuzz Tester
- Framework-based Fuzzer
- Monitored Virtual Environment - run potentially malicious code in sandbox / wrapper / virtual machine, see if it does anything suspicious

Effectiveness: SOAR Partial

### Manual Static Analysis - Source Code

According to SOAR \[REF-1479\], the following detection techniques may be useful:

Highly cost effective:

- Manual Source Code Review (not inspections)

Effectiveness: High

### Automated Static Analysis - Source Code

According to SOAR \[REF-1479\], the following detection techniques may be useful:

Cost effective for partial coverage:

- Source code Weakness Analyzer
- Context-configured Source Code Weakness Analyzer

Effectiveness: SOAR Partial

### Architecture or Design Review

According to SOAR \[REF-1479\], the following detection techniques may be useful:

Highly cost effective:

Cost effective for partial coverage:

- Inspection (IEEE 1028 standard) (can apply to requirements, design, source code, etc.)
- Formal Methods / Correct-By-Construction
- Attack Modeling

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();
    }
}
```

### Example 2

The following code could be for a medical records application. It performs authentication by checking if a cookie has been set.

Bad code:

```php
$auth = $_COOKIES['authenticated'];
if (! $auth) {
    if (AuthenticateUser($_POST['user'], $_POST['password']) == "success") {
        // save the cookie to send out in future responses
        setcookie("authenticated", "1", time()+60*60*2);
    }
    else {
        ShowLoginScreen();
        die("\n");
    }
}
DisplayMedicalHistory($_POST['patient_ID']);
```

### Example 3

In the following example, an authentication flag is read from a browser cookie, thus allowing for external control of user state data.

Bad code:

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

### Example 4

The following code samples use a DNS lookup in order to decide whether or not an inbound request is from a trusted host. If an attacker can poison the DNS cache, they can gain trusted status.

Bad code:

```c
struct hostent *hp;struct in_addr myaddr;
char* tHost = "trustme.example.com";
myaddr.s_addr=inet_addr(ip_addr_string);

hp = gethostbyaddr((char *) &myaddr, sizeof(struct in_addr), AF_INET);
if (hp && !strncmp(hp->h_name, tHost, sizeof(tHost))) {
    trusted = true;
} else {
    trusted = false;
}
```

Bad code:

```java
String ip = request.getRemoteAddr();
InetAddress addr = InetAddress.getByName(ip);
if (addr.getCanonicalHostName().endsWith("trustme.com")) {
    trusted = true;
}
```

Bad code:

```c#
IPAddress hostIPAddress = IPAddress.Parse(RemoteIpAddress);
IPHostEntry hostInfo = Dns.GetHostByAddress(hostIPAddress);
if (hostInfo.HostName.EndsWith("trustme.com")) {
    trusted = true;
}
```

IP addresses are more reliable than DNS names, but they can also be spoofed. Attackers can easily forge the source IP address of the packets they send, but response packets will return to the forged IP address. To see the response packets, the attacker has to sniff the traffic between the victim machine and the forged IP address. In order to accomplish the required sniffing, attackers typically attempt to locate themselves on the same subnet as the victim machine. Attackers may be able to circumvent this requirement by using source routing, but source routing is disabled across much of the Internet today. In summary, IP address verification can be a useful part of an authentication scheme, but it should not be the single factor required for authentication.

## Observed examples

| CVE | Description |
| --- | --- |
| CVE-2009-1549 | Attacker can bypass authentication by setting a cookie to a specific value. |
| CVE-2009-1619 | Attacker can bypass authentication and gain admin privileges by setting an "admin" cookie to 1. |
| CVE-2009-0864 | Content management system allows admin privileges by setting a "login" cookie to "OK." |
| CVE-2008-5784 | e-dating application allows admin privileges by setting the admin cookie to 1. |
| CVE-2008-6291 | Web-based email list manager allows attackers to gain admin privileges by setting a login cookie to "admin." |

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

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2026-21514 | Microsoft Word Security Feature Bypass Vulnerability | high | 8.4 | - | Yes | 2026-02-10 |
| CVE-2026-21509 | Microsoft Office Security Feature Bypass Vulnerability | high | 8.4 | - | Yes | 2026-01-26 |
| CVE-2026-6213 | Remote Spark SparkView RCE | critical | 10.0 | - | No | 2026-05-08 |
| CVE-2026-84474 | Automation-controller: automation-controller-container: automation-controller: view\_jobtemplate to execute privilege escalation via host\_config\_key exposure and x-forwarded-for spoofing of provisioning-callback host match | critical | 9.9 | - | No | 2026-09-23 |
| CVE-2025-12487 | oobabooga text-generation-webui trust\_remote\_code Reliance on Untrusted Inputs Remote Code Execution Vulnerability | critical | 9.8 | - | No | 2025-11-06 |
| CVE-2025-12488 | oobabooga text-generation-webui trust\_remote\_code Reliance on Untrusted Inputs Remote Code Execution Vulnerability | critical | 9.8 | - | No | 2025-11-06 |
| CVE-2019-10844 | Sony Neural Network Libraries reliance on untrusted inputs prior to v1.0.10 | critical | 9.8 | - | No | 2019-04-04 |
| CVE-2026-82533 | DeepSeek Harness \< 0.1.2-alpha.1 Authentication Bypass via Host Header Spoofing | critical | 9.4 | - | No | 2026-09-08 |
| CVE-2026-130070 | Ghost (muneeb141) Authentication Bypass via bypass\_otp in convert\_to\_real\_user | critical | 9.3 | - | No | 2026-11-16 |
| CVE-2026-90908 | Azul Payara JMX/RMI Remote Authentication Bypass Leading to Remote Code Execution via GenericAdminAuthenticator | critical | 9.3 | - | No | 2026-11-12 |
| CVE-2026-85602 | Grav Form Plugin before 9.1.20 reCAPTCHA v3 Authentication Bypass | critical | 9.3 | - | No | 2026-09-04 |
| CVE-2026-64827 | Telenia TVox 26.5.3 Authentication Bypass via set\_env.php | critical | 9.3 | - | No | 2026-08-03 |

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-693](https://radicalnotion.ai/cwe/cwe-693) | Protection Mechanism Failure |
| Child | [CWE-302](https://radicalnotion.ai/cwe/cwe-302) | Authentication Bypass by Assumed-Immutable Data |
| Child | [CWE-350](https://radicalnotion.ai/cwe/cwe-350) | Reliance on Reverse DNS Resolution for a Security-Critical Action |
| 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 |
| --- | --- | --- | --- |
| The CERT Oracle Secure Coding Standard for Java (2011) | Do not base security checks on untrusted sources | SEC09-J | - |

## Frequently asked questions

### What is CWE-807?

The product uses a protection mechanism that relies on the existence or values of an input, but the input can be modified by an untrusted actor in a way that bypasses the protection mechanism.

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

125 recorded CVEs are attributed to CWE-807, including CVE-2026-21514, CVE-2026-21509 and CVE-2026-6213. 2 are listed in CISA's Known Exploited Vulnerabilities (KEV) catalog.

### How do you prevent CWE-807?

Store state information and sensitive data on the server side only.

### How is CWE-807 detected?

Manual Static Analysis: Since this weakness does not typically appear frequently within a single software package, manual white box techniques may be able to provide sufficient code coverage and reduction of false positives if all potentially-vulnerable operations can be assessed within limited time constraints.

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

Exploiting CWE-807 can lead to: Bypass Protection Mechanism, Gain Privileges or Assume Identity, Varies by Context.

### Is CWE-807 actively exploited?

Yes. 2 CWE-807 vulnerabilities are in CISA's KEV catalog of actively exploited flaws, out of 125 recorded CVEs.

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

---

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