VariantIncomplete

CWE-627Dynamic Variable Evaluation

Category: other

Description

In a language where the user can influence the name of a variable at runtime, if the variable names are not controlled, an attacker can read or write to arbitrary variables, or access arbitrary functions. The resultant vulnerabilities depend on the behavior of the application, both at the crossover point and in any control/data flow that is reachable by the related variables or functions.

Common consequences· 1

  • Confidentiality / Integrity / Availability — Modify Application Data, Execute Unauthorized Code or Commands
    An attacker could gain unauthorized access to internal program variables and execute arbitrary code.

Potential mitigations· 3

  • [Implementation]Refactor the code to avoid dynamic variable evaluation whenever possible.
  • [Implementation]Use only allowlists of acceptable variable or function names.
  • [Implementation]For function names, ensure that you are only calling functions that accept the proper number of arguments, to avoid unexpected null arguments.

References

  1. https://cwe.mitre.org/data/definitions/627.html

Related by meaning· 6

Nearest entities by semantic similarity across the cs-graph corpus.

CWE
Improper Control of Dynamically-Identified Variables
CWE
Improper Control of Dynamically-Managed Code Resources
CWE
Use of Uninitialized Variable
CWE
PHP External Variable Modification
CWE
Process Control
CWE
External Initialization of Trusted Variables or Data Stores
Sourced from MITRE CWE 4.20. Curated for EU compliance use cases by Adam Lundqvist, Founder at SQUR.