---
title: "CWE-501: Trust Boundary Violation"
url: https://radicalnotion.ai/cwe/cwe-501
type: cwe
description: "The product mixes trusted and untrusted data in the same data structure or structured message."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-501: Trust Boundary Violation

- **Abstraction:** Class
- **Structure:** Simple
- **Status:** Draft
- **CVEs with this as primary weakness:** 30
- **Of those, in CISA KEV:** 0
- **New in 2026:** 12
- **CWE catalog version:** 4.21

## Description

The product mixes trusted and untrusted data in the same data structure or structured message.

A trust boundary can be thought of as line drawn through a program. On one side of the line, data is untrusted. On the other side of the line, data is assumed to be trustworthy. The purpose of validation logic is to allow data to safely cross the trust boundary - to move from untrusted to trusted. A trust boundary violation occurs when a program blurs the line between what is trusted and what is untrusted. By combining trusted and untrusted data in the same data structure, it becomes easier for programmers to mistakenly trust unvalidated data.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Architecture and Design | - |

## Applicable platforms

**Languages:** Python (Undetermined)

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Access Control | Bypass Protection Mechanism | - |

## 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 accepts an HTTP request and stores the username parameter in the HTTP session object before checking to ensure that the user has been authenticated.

Bad code:

```java
usrname = request.getParameter("usrname");
if (session.getAttribute(ATTR_USR) == null) {
    session.setAttribute(ATTR_USR, usrname);
}
```

Bad code:

```c#
usrname = request.Item("usrname");
if (session.Item(ATTR_USR) == null) {
    session.Add(ATTR_USR, usrname);
}
```

Without well-established and maintained trust boundaries, programmers will inevitably lose track of which pieces of data have been validated and which have not. This confusion will eventually allow some data to be used without first being validated.

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

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2020-4077 | Context isolation bypass via contextBridge in Electron | critical | 9.9 | - | No | 2020-07-07 |
| CVE-2026-27140 | Code execution vulnerability in SWIG code generation in cmd/go | critical | 9.8 | - | No | 2026-04-08 |
| CVE-2022-1799 | Incorrect signature verification on Google play-services-basement in Google Play SDK | critical | 9.8 | - | No | 2022-07-29 |
| CVE-2020-4076 | Context isolation bypass via leaked cross-context objects in Electron | critical | 9.0 | - | No | 2020-07-07 |
| CVE-2026-121665 | Visual Studio Code Security Feature Bypass Vulnerability | high | 8.8 | - | No | 2026-11-10 |
| CVE-2026-44091 | Creation of a new configuration by posting a malicious ID to MQTT | high | 8.8 | - | No | 2026-07-30 |
| CVE-2024-49050 | Visual Studio Code Python Extension Remote Code Execution Vulnerability | high | 8.8 | - | No | 2024-11-12 |
| CVE-2026-72183 | landlock: Fix LANDLOCK\_SCOPE\_SIGNAL bypass on the SIGIO path | high | 8.4 | - | No | 2026-08-15 |
| CVE-2023-28597 | Improper trust boundary implementation for SMB in Zoom Clients | high | 8.3 | - | No | 2023-03-27 |
| CVE-2024-23682 | Artemis Java Test Sandbox Class Loading Escape | high | 8.2 | - | No | 2024-01-19 |
| CVE-2026-23402 | KVM: x86/mmu: Only WARN in direct MMUs when overwriting shadow-present SPTE | high | 8.1 | - | No | 2026-04-01 |
| CVE-2024-1725 | Kubevirt-csi: persistentvolume allows access to hcp's root node | high | 8.1 | - | No | 2024-03-07 |

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-664](https://radicalnotion.ai/cwe/cwe-664) | Improper Control of a Resource Through its Lifetime |
| Peer | [CWE-349](https://radicalnotion.ai/cwe/cwe-349) | Acceptance of Extraneous Untrusted Data With Trusted Data |

## Taxonomy mappings

| Taxonomy | Entry | Id | Fit |
| --- | --- | --- | --- |
| 7 Pernicious Kingdoms | Trust Boundary Violation | - | - |
| Software Fault Patterns | Exposed Data | SFP23 | - |
| OpenSSF Secure Coding Guide for Python | Use Process Isolation for Trust Zones | pyscg-0040 | - |

## Frequently asked questions

### What is CWE-501?

The product mixes trusted and untrusted data in the same data structure or structured message.

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

30 recorded CVEs are attributed to CWE-501, including CVE-2020-4077, CVE-2026-27140 and CVE-2022-1799.

### How is CWE-501 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-501?

Exploiting CWE-501 can lead to: Bypass Protection Mechanism.

### Is CWE-501 actively exploited?

30 recorded CVEs are caused by CWE-501; none are currently in CISA's KEV catalog of actively exploited flaws.

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

---

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