Skip to main content
Mallory
← Back to News
internet-facing-service-vulnerabilityinitial-access-methoddefense-evasion-method

PHP Variable Interpolation Enables Code Execution and File Disclosure

Vulnerability Disclosure · 4 sources · Updated 3mo ago · First seen Sep 3, 2026

PHP Variable Interpolation Enables Code Execution and File Disclosure

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.

Do you run this?See affected versions and whether adversaries are exploiting it.
Check your exposure
Event timeline

How this story unfolded

Events from the most recent confirmed update back to the earliest known activity.

2 events · Jul 2012
  1. Jul 2012

    Challenge exploit bypasses disabled functions to read protected key

    The demonstrated exploit used phpinfo() to inspect restrictions, then called gzfile—absent from the disable_functions list—to read ../key.php and obtain the protected challenge key.

    Hacks in Taiwan 2012 Web Hacking 1 出題詳解 | Orange Tsai
  2. Jul 2012

    Hacks in Taiwan challenge exposes PHP interpolation code execution

    A PHP web-hacking challenge accepted attacker-controlled GET parameters and wrote the data value into a generated PHP configuration file. Despite filtering quotes and semicolons, PHP double-quoted string interpolation allowed attackers to execute PHP code when the generated file was accessed.

    Hacks in Taiwan 2012 Web Hacking 1 出題詳解 | Orange Tsai
Do you run this?See whether adversaries are exploiting this yet, and where the affected versions run in your environment.
Check Your Exposure
Mallory platform

See the full picture, correlated to your attack surface.

This page covers what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which threat actors are using it right now, and what to deploy next.

Exposure mappingMap indicators from this story to your assets and identify affected systems in minutes.
Threat actor evidenceEvery observed campaign, victim, and pivot linked to actors named in this story.
Associated malwareMalware, exploits, and IOCs connected to the activity described here.
Detection signaturesYARA, Sigma, and Snort rules deployed to your SIEM as soon as they’re published.
Scheduled alertsGet matching new stories delivered to your team as they break, not the next morning.
AI threadsAsk questions about this story and take action on the answers.