Skip to main content
Mallory
← Back to News
actively-exploited-vulnerabilityinternet-facing-service-vulnerabilityrapid-weaponizationinitial-access-method

PHP-CGI Query String Flaw Exploited to Expose Source Code and Install Backdoors

Active Exploitation · 2 sources · Updated 1mo ago · First seen May 7, 2012

PHP-CGI Query String Flaw Exploited to Expose Source Code and Install Backdoors

Attackers exploited a PHP-CGI query string vulnerability, tracked as VU#520827, to disclose PHP source code and execute attacker-controlled code on vulnerable websites. The PHP bug tracker recorded the issue on May 2, 2012, and Sucuri reported active exploitation on May 8. Malicious requests supplied PHP-CGI options through query strings, enabling source disclosure or configuration changes that allowed attacker-supplied input or an external shell to be included.

Sucuri’s honeypots recorded exploitation attempts from 16 IP addresses, and successful attacks resulted in backdoors being uploaded to compromised websites for further attacks against the servers. The report urged administrators to promptly update PHP, use temporary .htaccess request filtering, or move away from the vulnerable CGI configuration. Websites running PHP through CGI were the priority for exposure checks and remediation; compromised sites also required investigation for uploaded backdoors.

This is being exploited nowSee which actors are running it and whether you're in range.
Check your exposure
Event timeline

How this story unfolded

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

6 events · May 6, 2012 – May 7, 2012
  1. Reported May 8, 201215y ago

    Facebook places recruitment link at PHP-CGI probing URL

    An update reported that Facebook placed an engineering recruitment link at https://facebook.com/?-s for people probing the vulnerability.

    PHP-CGI Vulnerability Exploited in the Wild
  2. Reported May 8, 201215y ago

    PHP fix and temporary Apache mitigation become available

    The report stated that a PHP fix was already available and described a temporary .htaccess mitigation attributed to PHP maintainers. The mitigation blocked query strings containing a literal hyphen or %2d without an equals sign.

    PHP-CGI Vulnerability Exploited in the Wild
  3. Reported May 8, 201215y ago

    Sucuri reports website compromises and backdoor installation

    Sucuri reported that attackers were compromising websites through the PHP-CGI vulnerability and uploading backdoors to continue attacking the servers. Its honeypots recorded exploitation attempts from 16 IP addresses, with attack variants including request-supplied PHP content or an external shell.

    PHP-CGI Vulnerability Exploited in the Wild
  4. Reported May 8, 201215y ago

    PHP-CGI query-string vulnerability disclosed

    A PHP-CGI vulnerability was disclosed, followed shortly afterward by scanning against servers and honeypots. Attackers could use query-string options to expose PHP source code or alter PHP configuration.

    PHP-CGI Vulnerability Exploited in the Wild
  5. May 7, 201215y ago

    Attacker attempts PHP-CGI configuration injection

    A POST request from 84.247.61.27 used the -d option to set allow_url_include=1 and auto_prepend_file=php://input, attempting to include attacker-supplied request content. The recorded request received an HTTP 301 response.

    PHP-CGI Vulnerability Exploited in the Wild
  6. May 6, 201215y ago

    Honeypot records PHP source-code disclosure probe

    A request from 88.198.51.36 targeted /index.php?-s to test whether PHP source code could be exposed. The recorded request received an HTTP 301 response.

    PHP-CGI Vulnerability Exploited in the Wild
Linked entities

Related entities

Vulnerabilities, threat actors, malware, products, organizations, breaches, and observables Mallory has linked to this story. Indicator values are masked here and available in full in the app.

Open in app →

Observables

16 linked

Indicator values are masked on this page. View all 16 in Mallory Domains, IPs, hashes, and URLs are exportable to your SIEM.

Do you run this?Correlate live exploitation activity against the software you actually run, and see where you're exposed.
See Who's Exploiting This
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.