Skip to content
OpenAdvisories

Weakness (CWE)

CWE-627: Dynamic Variable Evaluation

Variant Incomplete

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.

How to prevent it (3 mitigations)
  1. Implementation

    Refactor the code to avoid dynamic variable evaluation whenever possible.

  2. Implementation

    Use only allowlists of acceptable variable or function names.

  3. Implementation

    For function names, ensure that you are only calling functions that accept the proper number of arguments, to avoid unexpected null arguments.

Source: MITRE CWE-627

1 result · Clear filters · Feed

  • Critical 9.8
    CVE-2025-55346 EPSS 24%

    Unintended dynamic code execution leads to remote code execution by network attackers

    User-controlled input flows to an unsafe implementation of a dynamic Function constructor, allowing network attackers to run arbitrary unsandboxed JS code in the context of the host, by sending a simple POST request.