---
title: "CWE-914: Improper Control of Dynamically-Identified Variables"
url: https://radicalnotion.ai/cwe/cwe-914
type: cwe
description: "The product does not properly restrict reading from or writing to dynamically-identified variables."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-914: Improper Control of Dynamically-Identified Variables

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

## Description

The product does not properly restrict reading from or writing to dynamically-identified variables.

## Background

Many languages offer powerful features that allow the programmer to access arbitrary variables that are specified by an input string. While these features can offer significant flexibility and reduce development time, they can be extremely dangerous if attackers can modify unintended variables that have security implications.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Implementation | The dynamic identification of variables can be a powerful, time-saving technique for developers. This practice can reduce maintenance costs because new code would not need to be written for each variable that is managed. |

## Applicable platforms

**Languages:** Interpreted (Undetermined)

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Integrity | Modify Application Data | An attacker could modify sensitive data or critical program variables. |
| Integrity | Execute Unauthorized Code or Commands | - |
| Other, Integrity | Varies by Context, Alter Execution Logic | - |

## Potential mitigations

### Implementation (Input Validation)

For any externally-influenced input, check the input against an allowlist of internal program variables that are allowed to be modified.

### Implementation, Architecture and Design (Refactoring)

Refactor the code so that internal program variables do not need to be dynamically identified.

## Demonstrative examples

### Example 1

This code uses the credentials sent in a POST request to login a user.

Bad code:

```php
//Log user in, and set $isAdmin to true if user is an administrator

function login($user,$pass){
    $query = buildQuery($user,$pass);
    mysql_query($query);
    if(getUserRole($user) == "Admin"){
        $isAdmin = true;
    }
}

$isAdmin = false;
extract($_POST);
login(mysql_real_escape_string($user),mysql_real_escape_string($pass));
```

The call to extract() will overwrite the existing values of any variables defined previously, in this case $isAdmin. An attacker can send a POST request with an unexpected third value "isAdmin" equal to "true", thus gaining Admin privileges.

## Observed examples

| CVE | Description |
| --- | --- |
| CVE-2006-7135 | extract issue enables file inclusion |
| CVE-2006-7079 | Chain: extract used for register\_globals compatibility layer, enables path traversal (CWE-22) |
| CVE-2007-0649 | extract() buried in include files makes post-disclosure analysis confusing; original report had seemed incorrect. |
| CVE-2006-6661 | extract() enables static code injection |
| CVE-2006-2828 | import\_request\_variables() buried in include files makes post-disclosure analysis confusing |
| CVE-2009-0422 | Chain: Dynamic variable evaluation allows resultant remote file inclusion and path traversal. |
| CVE-2007-2431 | Chain: dynamic variable evaluation in PHP program used to modify critical, unexpected $\_SERVER variable for resultant XSS. |
| CVE-2006-4904 | Chain: dynamic variable evaluation in PHP program used to conduct remote file inclusion. |
| CVE-2006-4019 | Dynamic variable evaluation in mail program allows reading and modifying attachments and preferences of other users. |

## Real CVEs with this weakness

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2023-33175 | ToUI allows user-specific variables to be shared between users | critical | 9.1 | - | No | 2023-05-30 |
| CVE-2024-54198 | Information Disclosure vulnerability through Remote Function Call (RFC) in SAP NetWeaver Application Server ABAP | high | 8.5 | - | No | 2024-12-10 |
| CVE-2024-24914 | - | high | 8.0 | - | No | 2024-11-07 |
| CVE-2019-25777 | YAML versions before 1.27\_001 for Perl allow a loaded perl/glob document to replace any package variable, which can lead to arbitrary code execution | high | 7.3 | - | No | 2026-10-05 |
| CVE-2025-14085 | youlaitech youlai-mall orders improper control of dynamically-identified variables | medium | 5.3 | - | No | 2025-12-05 |
| CVE-2025-14051 | youlaitech youlai-mall addresses deleteAddress improper control of dynamically-identified variables | medium | 5.3 | - | No | 2025-12-04 |

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-99](https://radicalnotion.ai/cwe/cwe-99) | Improper Control of Resource Identifiers |
| Parent | [CWE-913](https://radicalnotion.ai/cwe/cwe-913) | Improper Control of Dynamically-Managed Code Resources |
| Child | [CWE-621](https://radicalnotion.ai/cwe/cwe-621) | Variable Extraction Error |
| Child | [CWE-627](https://radicalnotion.ai/cwe/cwe-627) | Dynamic Variable Evaluation |

## Frequently asked questions

### What is CWE-914?

The product does not properly restrict reading from or writing to dynamically-identified variables.

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

6 recorded CVEs are attributed to CWE-914, including CVE-2023-33175, CVE-2024-54198 and CVE-2024-24914.

### How do you prevent CWE-914?

For any externally-influenced input, check the input against an allowlist of internal program variables that are allowed to be modified.

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

Exploiting CWE-914 can lead to: Modify Application Data, Execute Unauthorized Code or Commands, Varies by Context, Alter Execution Logic.

### Is CWE-914 actively exploited?

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

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

---

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