CWE-914 — Improper Control of Dynamically-Identified Variables
CWE-914: Improper Control of Dynamically-Identified Variables
MITRE CWE weakness
| Kind | Weakness |
| Abstraction | Base |
| Status | Incomplete |
| Likelihood of exploit | — |
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.
Common consequences
- Integrity: Modify Application Data
- Integrity: Execute Unauthorized Code or Commands
- Other, Integrity: Varies by Context, Alter Execution Logic
Mitigations
Implementation — For any externally-influenced input, check the input against an allowlist of internal program variables that are allowed to be modified.
Implementation — Refactor the code so that internal program variables do not need to be dynamically identified.
References
- CWE page: https://cwe.mitre.org/data/definitions/914.html
- CWE list: https://cwe.mitre.org/data/index.html