COMMON WEAKNESS ENUMERATIONIncomplete

CWE-914

Improper Control of Dynamically-Identified Variables

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

Abstraction

Base

Structure

Simple

Likelihood of Exploit

Medium

Understand the problem

What is the problem?

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

Extended description

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.

Root cause

How and when does the problem arise?

Lifecycle phase

Implementation

Risk

What does successful exploitation lead to?

Modify Application Data

Affected security scopes: Integrity

An attacker could modify sensitive data or program variables.
Execute Unauthorized Code or Commands

Affected security scopes: Integrity

Varies by ContextAlter Execution Logic

Affected security scopes: Other, Integrity

Defence

How is it prevented and fixed?

Implementation

Input Validation

Detail
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

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