Skip to content
Vulnerability Intelligence

CVE-2012-1823

CriticalExploitedPublic exploit

php: command line arguments injection when run in CGI mode (VU#520827)

Published May 3, 2012 · Updated Mar 9, 2026

Key Facts

Patch immediately
  • CVE-2012-1823 is a critical-severity vulnerability (CVSS 9.8 v3.1) affecting PHP, Application Stack (Redhat), Gluster Storage Server For On-Premise (Redhat) and 22 more products.
  • It is exploited in the wild, listed in CISA KEV, Industry KEV feed, CIRCL KEV, ENISA EUVD since Jun 19, 2012. Public exploit code is available.
  • EPSS estimates a 100% probability of exploitation in the next 30 days.
  • Fixed versions are available, including apache2-mod_php5 5.6.28-1.1, apache2-mod_php7 7.0.14-1.4, Mac OS X 10.7.5.
  • Brandefense priority: patch immediately, because it is listed as exploited in the wild.

CVSS v3.1

9.8

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

EPSS (30-day exploit likelihood)

100%

Higher than 99.9% of all scored CVEs

Exploited in the wild

Yes

4 catalog listings

Public exploit code

Available

Proof-of-concept or weaponized module

Get the full CVE-2012-1823 brief as a PDF

Every affected product and fixed release, exploitation status and a first 24 hours response checklist, emailed within minutes.

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.

Known-Exploited Catalog Listings

CatalogAddedRemediation dueRansomware use
CISA KEVMar 25, 2022Apr 15, 2022Not reported
Industry KEV feedJun 19, 2012Apr 15, 2022Not reported
CIRCL KEVMar 25, 2022Apr 15, 2022Not reported
ENISA EUVDMar 25, 2022n/aNot reported

Required action: Apply updates per vendor instructions.

Affected Products

297 affected entries in total
ProductAffected versionsFixed in
PHPPHPSee advisory5.3.12
Application StackRedhat2.0n/a
Gluster Storage Server For On-PremiseRedhat2.0n/a
StorageRedhat2.0n/a
Storage For Public CloudRedhat2.0n/a
20 more affected products in the full CVE brief

Patched Releases

apache2-mod_php5

5.6.28-1.1

apache2-mod_php7

7.0.14-1.4

Mac OS X

10.7.5

PHP

0:5.1.6-34.el5_8, 0:5.3.3-3.el6_1.4, 5.1.6-34.el5_8, 5.3.13-1.20.amzn1, 5.3.3-3.el6_2.8, 5.3.12

php-bcmath

5.1.6-34.el5_8, 5.3.13-1.20.amzn1, 5.3.3-3.el6_2.8

php-cli

5.1.6-34.el5_8, 5.3.13-1.20.amzn1, 5.3.3-3.el6_2.8

php-common

5.1.6-34.el5_8, 5.3.13-1.20.amzn1, 5.3.3-3.el6_2.8

php-dba

5.1.6-34.el5_8, 5.3.13-1.20.amzn1, 5.3.3-3.el6_2.8

php-devel

5.1.6-34.el5_8, 5.3.13-1.20.amzn1, 5.3.3-3.el6_2.8

php-embedded

5.3.13-1.20.amzn1, 5.3.3-3.el6_2.8

php-enchant

5.3.3-3.el6_2.8

php-fpm

5.3.13-1.20.amzn1

php-gd

5.1.6-34.el5_8, 5.3.13-1.20.amzn1, 5.3.3-3.el6_2.8

php-imap

5.1.6-34.el5_8, 5.3.13-1.20.amzn1, 5.3.3-3.el6_2.8

php-intl

5.3.13-1.20.amzn1, 5.3.3-3.el6_2.8

php-ldap

5.1.6-34.el5_8, 5.3.13-1.20.amzn1, 5.3.3-3.el6_2.8

php-mbstring

5.1.6-34.el5_8, 5.3.13-1.20.amzn1, 5.3.3-3.el6_2.8

php-mcrypt

5.3.13-1.20.amzn1

php-mssql

5.3.13-1.20.amzn1

php-mysql

5.1.6-34.el5_8, 5.3.13-1.20.amzn1, 5.3.3-3.el6_2.8

php-mysqlnd

5.3.13-1.20.amzn1

php-ncurses

5.1.6-34.el5_8

php-odbc

5.1.6-34.el5_8, 5.3.13-1.20.amzn1, 5.3.3-3.el6_2.8

php-pdo

5.1.6-34.el5_8, 5.3.13-1.20.amzn1, 5.3.3-3.el6_2.8

php-pgsql

5.1.6-34.el5_8, 5.3.13-1.20.amzn1, 5.3.3-3.el6_2.8

Timeline

  1. Publicly disclosed

    May 3, 2012

  2. Added to Industry KEV feed

    Jun 19, 2012

  3. Added to CISA KEV

    Mar 25, 2022

  4. Added to CIRCL KEV

    Mar 25, 2022

  5. Added to ENISA EUVD

    Mar 25, 2022

  6. Last updated

    Mar 9, 2026

Weakness Type

  • CWE-77 Improper Neutralization of Special Elements used in a Command ('Command Injection')

References

15 more references in the full CVE brief

FAQ

Common Questions.

Is CVE-2012-1823 Running On Your Attack Surface?

Brandefense maps vulnerabilities like this one to your internet-facing assets and tells you exactly where to patch.

Request A Demo