This vulnerability occurs when a PHP application fails to properly validate or sanitize variables that originate from outside the application, such as HTTP query strings, cookies, or POST data. Attackers can exploit this to inject unexpected values, altering the program's logic and security controls.
PHP's historical feature of automatically registering global variables from user input (like `$_GET`, `$_POST`) created a major security pitfall. Even with this feature deprecated, the core risk remains: if developers directly trust external data without validation, attackers can overwrite critical internal variables. This opens the door to authentication bypass, privilege escalation, or logic flaws that shouldn't exist in a properly isolated codebase. To prevent this, developers must adopt a clear separation between external input and internal application state. Always initialize variables explicitly, disable legacy features like `register_globals`, and treat all user-supplied data as untrusted. Implement strict validation and use allow-lists for expected values, ensuring external sources cannot arbitrarily modify the variables that control your application's behavior and security decisions.
Impact: Modify Application Data