This vulnerability occurs when an application uses unvalidated external input to dynamically select which variables to populate with data. Without proper checks, this can allow an attacker to overwrite critical internal variables, leading to unexpected behavior or security breaches.
In languages like PHP, functions such as `extract()` or `import_request_variables()` can mimic the dangerous behavior of the deprecated `register_globals` feature if called incorrectly. An attacker can manipulate input to overwrite global variables, including superglobals like `$_SESSION` or `$_GET`, potentially bypassing security controls or altering application logic. This pattern is not exclusive to PHP. Many interpreted languages and custom frameworks offer similar dynamic variable assignment features. Developers must always validate or whitelist which variable names are allowed to be set externally, treating user input as data, not as code that defines the program's structure.
Impact: Modify Application Data
An attacker could modify sensitive data or program variables.
Strategy: Input Validation
//Log user in, and set $isAdmin to true if user is an administrator*
php