Skip to main content

CVE tracker

CVE-2012-1823

Command Injection in PHP

Severity: Critical CVSS 9.8. Status in our packages: Fixed.

About CVE-2012-1823

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.

Description quoted from the CVE record at cve.org.

Published2012-05-11
WeaknessCWE-77 Improper Neutralization of Special Elements used in a Command ('Command Injection')
CVSSCritical 9.8 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H (scored by CISA-ADP)

Status in GetPageSpeed packages

ProductStatusFixed inDetails
PHP 7.2 on Ubuntu 18.04Fixed7.2.34-66+gps1Everpatch PHP 7.2
PHP 7.3 on Debian 10Fixed7.3.33-35+gps1Everpatch PHP 7.3
PHP 7.4 on Debian 10Fixed1:7.4.33-31+gps1Everpatch PHP 7.4

Check a server for CVE-2012-1823

Everpatch PHP on Debian and Ubuntu: PHP 7.2 on Ubuntu 18.04 7.2.34-66+gps1, PHP 7.3 on Debian 10 7.3.33-35+gps1, PHP 7.4 on Debian 10 1:7.4.33-31+gps1 or later. The Debian changelog names every CVE a build fixes.

dpkg-query -W 'php*-common'
zgrep -F CVE-2012-1823 /usr/share/doc/php*-common/changelog.Debian.gz

After a PHP update, restart PHP-FPM (and Apache httpd if it runs mod_php): the old processes keep the vulnerable code until then.

Fixed in the same build

Scanner feeds (OVAL, CSAF, OpenVEX), fix-time targets and answers to common questions: the CVE tracker.