CWE-914: Improper Control of Dynamically-Identified Variables
Description
The product does not properly restrict reading from or writing to dynamically-identified variables.
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.
- Abstraction
- BaseA weakness specific enough to point to detection and prevention methods.
- Likelihood of exploit
- Not rated by MITRE
- Status
- Incomplete
Common consequences
- Integrity
Modify Application Data
An attacker could modify sensitive data or program variables.
- Integrity
Execute Unauthorized Code or Commands
- OtherIntegrity
Varies by Context; Alter Execution Logic
Potential mitigations
- ImplementationInput Validation
For any externally-influenced input, check the input against an allowlist of internal program variables that are allowed to be modified.
- ImplementationArchitecture and DesignRefactoring
Refactor the code so that internal program variables do not need to be dynamically identified.
Related weaknesses
CAPEC attack patterns that exploit it
CWE 4.20 links no CAPEC attack pattern to this weakness.