---
title: "CWE-639: Authorization Bypass Through User-Controlled Key"
url: https://radicalnotion.ai/cwe/cwe-639
type: cwe
description: "The system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-639: Authorization Bypass Through User-Controlled Key

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

## Description

The system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data.

It is likely that an attacker would have to be an authenticated user in the system. However, the authorization process would not properly check the data access operation to ensure that the authenticated user performing the operation has sufficient entitlements to perform the requested data access, hence bypassing any other authorization checks present in the system.

For example, attackers can look at places where user specific data is retrieved (e.g. search screens) and determine whether the key for the item being looked up is controllable externally. The key may be a hidden field in the HTML form field, might be passed as a URL parameter or as an unencrypted cookie variable, then in each of these cases it will be possible to tamper with the key value.

## Alternate terms

- **Insecure Direct Object Reference / IDOR:** The "Insecure Direct Object Reference" term, as described in the OWASP Top Ten, is broader than this CWE because it also covers path traversal (CWE-22). Within the context of vulnerability theory, there is a similarity between the OWASP concept and CWE-706: Use of Incorrectly-Resolved Name or Reference.
- **Broken Object Level Authorization / BOLA:** BOLA is used in the 2019 OWASP API Security Top 10 and appears to have some overlap, but BOLA may be applicable to other weaknesses in addition to this one.
- **Horizontal Authorization:** "Horizontal Authorization" is used to describe situations in which two users have the same privilege level, but must be prevented from accessing each other's resources. This is fairly common when using key-based access to resources in a multi-user context.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Architecture and Design | REALIZATION: This weakness is caused during implementation of an architectural security tactic. |
| Architecture and Design | - |
| Implementation | - |

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Access Control | Bypass Protection Mechanism | Access control checks for specific user data or functionality can be bypassed. |
| Access Control | Gain Privileges or Assume Identity | Horizontal escalation of privilege is possible (one user can view/modify information of another user). |
| Access Control | Gain Privileges or Assume Identity | Vertical escalation of privilege is possible if the user-controlled key is actually a flag that indicates administrator status, allowing the attacker to gain administrative access. |

## Potential mitigations

### Architecture and Design

For each and every data access, ensure that the user has sufficient privilege to access the record that is being requested.

### Architecture and Design, Implementation

Make sure that the key that is used in the lookup of a specific user's record is not controllable externally by the user or that any tampering can be detected.

### Architecture and Design

Use encryption in order to make it more difficult to guess other legitimate values of the key or associate a digital signature with the key so that the server can verify that there has been no tampering.

## 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 uses a parameterized statement, which escapes metacharacters and prevents SQL injection vulnerabilities, to construct and execute a SQL query that searches for an invoice matching the specified identifier \[1\]. The identifier is selected from a list of all invoices associated with the current authenticated user.

Bad code:

```c#
...
conn = new SqlConnection(_ConnectionString);
conn.Open();
int16 id = System.Convert.ToInt16(invoiceID.Text);
SqlCommand query = new SqlCommand( "SELECT * FROM invoices WHERE id = @id", conn);
query.Parameters.AddWithValue("@id", id);
SqlDataReader objReader = objCommand.ExecuteReader();
...
```

The problem is that the developer has not considered all of the possible values of id. Although the interface generates a list of invoice identifiers that belong to the current user, an attacker can bypass this interface to request any desired invoice. Because the code in this example does not check to ensure that the user has permission to access the requested invoice, it will display any invoice, even if it does not belong to the current user.

## Observed examples

| CVE | Description |
| --- | --- |
| CVE-2021-36539 | An educational application does not appropriately restrict file IDs to a particular user. The attacker can brute-force guess IDs, indicating IDOR. |

## Real CVEs with this weakness (sample of 12 of 3,486)

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2026-55255 | Langflow: IDOR Vulnerability in \`/api/v1/responses\` Endpoint Allows Authenticated Attackers to Access Another User's Flow | high | 8.4 | - | Yes | 2026-06-23 |
| CVE-2026-109469 | Entra Device Registration Elevation of Privilege Vulnerability | critical | 10.0 | - | No | 2026-11-06 |
| CVE-2024-34323 | - | critical | 10.0 | - | No | 2026-10-13 |
| CVE-2026-69865 | Microsoft Container Registry Elevation of Privilege Vulnerability | critical | 10.0 | - | No | 2026-09-17 |
| CVE-2026-83711 | Microsoft Azure Active Directory B2C Elevation of Privilege Vulnerability | critical | 10.0 | - | No | 2026-09-03 |
| CVE-2026-77998 | Joomla Extension - miniorange.com - Unauthenticated Authentication Bypass via SAMLResponse Parameter in miniOrange SAML SSO \< 11.0.2, SAML SP Single Sign On – Login with ADFS \< 6.4, SAML SP Single Sign On – SAML SSO login with Google Apps \< 6.4 | critical | 10.0 | - | No | 2026-08-25 |
| CVE-2026-77995 | Joomla Extension - miniorange.com - Arbitrary account takeover in miniOrange OAuth Client \< 3.2.0, OAuth Single Sign-On – OIDC SSO \< 1.2.2, Login with Keycloak OAuth Single Sign-On (SSO) \< 1.2.2, Single Sign-On for Educational Institutes \< 1.2.2 | critical | 10.0 | - | No | 2026-08-24 |
| CVE-2025-40805 | Authorization Bypass Through User-Controlled Key in Siemens Industrial Edge Devices | critical | 10.0 | - | No | 2026-01-13 |
| CVE-2024-45032 | Affected components do not properly validate the device tokens. This could allow an unauthenticated remote attacker to impersonate other devices onboarded to the system. | critical | 10.0 | - | No | 2024-09-10 |
| CVE-2026-123800 | SuperTokens Core: App-scoped API key can overwrite the parent connection URI domain's credentials and take over sibling applications | critical | 9.9 | - | No | 2026-11-09 |
| CVE-2026-17049 | Multiple Vulnerabilities in IBM API Connect | critical | 9.9 | - | No | 2026-11-07 |
| CVE-2026-111490 | Insecure direct object reference (IDOR) vulnerability in the MatchPoint API | critical | 9.9 | - | No | 2026-11-05 |

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-284](https://radicalnotion.ai/cwe/cwe-284) | Improper Access Control |
| Parent | [CWE-863](https://radicalnotion.ai/cwe/cwe-863) | Incorrect Authorization |
| Child | [CWE-566](https://radicalnotion.ai/cwe/cwe-566) | Authorization Bypass Through User-Controlled SQL Primary Key |

## Frequently asked questions

### What is CWE-639?

The system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data.

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

3,486 recorded CVEs are attributed to CWE-639, including CVE-2026-55255, CVE-2026-109469 and CVE-2024-34323. 1 is listed in CISA's Known Exploited Vulnerabilities (KEV) catalog.

### How do you prevent CWE-639?

For each and every data access, ensure that the user has sufficient privilege to access the record that is being requested.

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

Exploiting CWE-639 can lead to: Bypass Protection Mechanism, Gain Privileges or Assume Identity.

### Is CWE-639 actively exploited?

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

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

---

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