PHP Scripting Flaws Leave Huge Number of Web Sites Open to Attack

Update: The PHP Group released fixes PHP 5.4.3 and PHP 5.3.13 Tuesday evening, available for download here.

Attackers have begun exploiting two separate flaws in the PHP scripting language found in a large majority of Web sites.

The first vulnerability, which was privately disclosed to the PHP Group in January, could allow attackers to steal source code or insert malware. The exploit works by modifying how PHP setups parse query string parameters from PHP files in a Common Gateway Interface (CGI) configuration.

The hole makes it possible to interpret URL query strings that contain the "-" character as a command line switch. Hackers can use that flaw to access the source code or run a specially crafted remote code execution attack.

The attacks currently are active. Security firm Trustwave SpiderLabs reported yesterday seeing the PHP attack being exploited via its honeypot, which is set to monitor Web attacks.

According to the PHP Group, organizations can easily check to see if their Web site is vulnerable to attack.

"If you are using Apache mod_cgi to run PHP you may be vulnerable," wrote the PHP Group in a message on its Web site. "To see if you are, just add ?-s to the end of any of your URLs. If you see your source code, you are vulnerable. If your site renders normally, you are not."

While the vulnerability was privately disclosed to the PHP Group, the issue became public when the flaw was accidently leaked online.

"Making a bad week worse, we had a bug in our bug system that toggled the private flag of a bug report to public on a comment to the bug report causing this issue to go public before we had time to test solutions to the level we would like," said the PHP Group.

In response to the information leak, the PHP Group released PHP 5.3.12 and PHP 5.4.2 as emergency fixes. However, shortly after release, it was discovered that the updates could be easily bypassed. "The security emergency release to fix the PHP CGI RCE (that was tested for days...) does not fix anything at all," wrote Stefan Esser, creator of the Suhosin PHP security extension, in a Twitter message.

Still, the PHP Group advises that organizations apply the flawed updates and test their system to see if they are still vulnerable. If so, a workaround can be found here.

An additional PHP update is scheduled to be released sometime today.

"Another set of releases are planned for Tuesday, May, 8th," said the PHP Group. "These releases will fix the CGI flaw and another CGI-related issue in apache_request_header (5.4 only)."

About the Author

Chris Paoli is the site producer for and


  • Microsoft and SAP Enhance Partnership with Teams Integration

    Microsoft and SAP this week described continuing partnership efforts on Microsoft Azure, while also planning a Microsoft Teams integration with SAP's enterprise resource planning product and other solutions.

  • Blue Squares Graphic

    Microsoft Previews Azure IoT Edge for Linux on Windows

    Microsoft announced a preview of Azure IoT Edge for Linux on Windows, which lets organizations tap Linux virtual machine processes that also work with Windows- and Azure-based processes and services.

  • How To Automate Tasks in Azure SQL Database

    Knowing how to automate tasks in the cloud will make you a more productive DBA. Here are the key concepts to understand about cloud scripting and a rundown of the best tools for automating code in Azure.

  • Microsoft Open License To End Next Year for Government and Education Groups

    Microsoft's "Open License program" will end on Jan. 1, 2022, and not just for commercial customers, but also for government, education and nonprofit organizations.

comments powered by Disqus