Skip to content
OpenAdvisories
Critical · 9.8 Known exploited Scanner template Public exploit CVE-2012-1823 EUVD-2012-1833GHSA-3p37-hv77-x3rp

sapi/cgi/cgi_main.c in PHP before 5.3.12 and 5.4.x before 5.4.2, when configured as a CGI script (aka php-cgi), does not properly handle qu…

Published May 11, 2012 · Updated Nov 4, 2025 · Assigned by certcc

Description

sapi/cgi/cgi_main.c in PHP before 5.3.12 and 5.4.x before 5.4.2, when configured as a CGI script (aka php-cgi), does not properly handle query strings that lack an = (equals sign) character, which allows remote attackers to execute arbitrary code by placing command-line options in the query string, related to lack of skipping a certain php_getopt for the 'd' case.

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 6.0 php5 5.3.3-7+squeeze9 DSA-2465-1
ReleasePackageFixed inAdvisory
RHEL 6 php +25 5.3.3-3.el6_2.8 RHSA-2012:0546
RHEL 5 php +18 5.1.6-34.el5_8 RHSA-2012:0546
RHEL 5 php53 +20 5.3.3-7.el5_8 RHSA-2012:0547
Show 5 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Red Hat Rhel Mission Critical 5 php +18 5.1.6-23.3.el5_3 RHSA-2012:0568
Red Hat Rhel Application Stack 2 php +18 5.2.10-2.el5s2 RHSA-2012:0570
RHEL 6.1 EUS php +25 5.3.3-3.el6_1.4 RHSA-2012:0568
RHEL 6.0 EUS php +25 5.3.2-6.el6_0.2 RHSA-2012:0568
RHEL 5.6 EUS php +18 5.1.6-27.el5_6.4 RHSA-2012:0568
RHEL 5.6 EUS php53 +20 5.3.3-1.el5_6.2 RHSA-2012:0569
ReleasePackageFixed inAdvisory
openSUSE Tumbleweed php5 5.6.28-1.1 openSUSE-SU-2024:10344-1
openSUSE Tumbleweed php7 7.0.14-1.4 openSUSE-SU-2024:10290-1
openSUSE Tumbleweed php8 8.0.11-1.1 openSUSE-SU-2024:11169-1

Public exploits

Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.

Third-party code, not reviewed by us. Public PoCs are sometimes fake or contain malware. Read the code first and run it only in an isolated lab, against systems you are authorised to test.

Metasploit 1 module

Exploit-DB 4

GitHub 16 repositories · most starred shown

Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.

Automated scanner template

A ready-made Nuclei template detects this vulnerability automatically. Vulnerabilities with public scanner templates are typically probed across the internet soon after the template appears — exposed systems should be patched first.

Source: projectdiscovery/nuclei-templates (MIT) — updated daily. Only links are listed.

Advisories 9

References