CWEweakness
CWE-627 Dynamic Variable Evaluation
- Alternate terms
- Dynamic evaluation
- Abstraction
- Variant
- Structure
- Simple
- Status
- Incomplete
- Languages
- PHP, Perl
- CWE version
- 5.0
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.
Common consequences
• Confidentiality, Integrity, Availability: Modify Application Data, Execute Unauthorized Code or Commands, Varies by Context — An attacker could gain unauthorized read or write access to internal program variables and possibly execute arbitrary code. 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.
Potential mitigations
• [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.
Observed examples
• 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.
Related
Observed example · CVE (4)
- CVE-2009-0422 Dynamic variable evaluation vulnerability in lists/admin.php in phpList 2.10.8 and earlier, when register_globals is disabled, allows… vulnerability
- CVE-2007-2431 Dynamic variable evaluation vulnerability in shared/config/tce_config.php in TCExam 4.0.011 and earlier allows remote attackers to conduct… vulnerability
- CVE-2006-4904 Dynamic variable evaluation vulnerability in cmpi.php in Qualiteam X-Cart 4.1.3 and earlier allows remote attackers to overwrite arbitrary… vulnerability
- CVE-2006-4019 Dynamic variable evaluation vulnerability in compose.php in SquirrelMail 1.4.0 to 1.4.7 allows remote attackers to overwrite arbitrary… vulnerability
Child of · CWE (1)
- CWE-914 Improper Control of Dynamically-Identified Variables weakness
Peer of · CWE (1)
- CWE-183 Permissive List of Allowed Inputs weakness
Referenced by CVE · weakness (5)
- CVE-2026-2415 Emails sent by pretix can utilize placeholders that will be filled with customer data. vulnerability
- CVE-2026-2451 Emails sent by pretix can utilize placeholders that will be filled with customer data. vulnerability
- CVE-2026-2452 Emails sent by pretix can utilize placeholders that will be filled with customer data. vulnerability
- CVE-2024-8953 In composiohq/composio version 0.4.3, the mathematical_calculator endpoint uses the unsafe eval() function to perform mathematical… vulnerability
- CVE-2023-31032 NVIDIA DGX A100 SBIOS contains a vulnerability where a user may cause a dynamic variable evaluation by local access. vulnerability
Referenced by CWE · has member (1)
- CWE-884 CWE Cross-section view