PHP Variable Interpolation Enables Code Execution and File Disclosure
Vulnerability Disclosure · 4 sources · Updated 3mo ago · First seen Sep 3, 2026

A PHP web-hacking challenge demonstrated how attacker-controlled input written into a generated PHP configuration file can become executable code. The application removed double quotes, single quotes, and semicolons from a data parameter, but then embedded the value in a double-quoted PHP string; PHP variable-interpolation syntax could still invoke attacker-controlled functions when the generated file was requested.
The technique enabled PHP code execution and inspection of runtime configuration. A broad disable_functions policy did not prevent disclosure of a protected key.php file because gzfile remained available, illustrating that partial PHP function blacklists and dynamically generated executable configuration files do not provide reliable isolation.

