Stackurity Start free trial

CVEs / CVE-2024-4577

CVE-2024-4577: PHP-CGI OS Command Injection Vulnerability

Are you affected? Check your servers with Stackurity: it lists the software on each server and the vulnerabilities to fix first.

Check your servers with Stackurity Already using Stackurity? Search for CVE-2024-4577

Summary

PHP, specifically Windows-based PHP used in CGI mode, contains an OS command injection vulnerability that allows for arbitrary code execution. This vulnerability is a patch bypass for CVE-2012-1823.

CISA, Known Exploited Vulnerabilities catalog

Description

In PHP versions 8.1.* before 8.1.29, 8.2.* before 8.2.20, 8.3.* before 8.3.8, when using Apache and PHP-CGI on Windows, if the system is set up to use certain code pages, Windows may use "Best-Fit" behavior to replace characters in command line given to Win32 API functions. PHP CGI module may misinterpret those characters as PHP options, which may allow a malicious user to pass options to PHP binary being run, and thus reveal the source code of scripts, run arbitrary PHP code on the server, etc.

The CVE record, via NVD · published 9 Jun 2024 · NVD status: Analyzed

Affected and fixed versions

As stated by the CVE record (from the CNA)
ProductAffectedFixed in
PHP Group PHPfrom 8.1.*, before 8.1.298.1.29
PHP Group PHPfrom 8.2.*, before 8.2.208.2.20
PHP Group PHPfrom 8.3.*, before 8.3.88.3.8
php_group phpfrom 8.1.0, before 8.1.298.1.29
php_group phpfrom 8.2.0, before 8.2.208.2.20
php_group phpfrom 8.3.0, before 8.3.88.3.8

Exploitation

In CISA KEV since12 Jun 2024
Due date for US federal agencies3 Jul 2024
Used in ransomware campaignsKnown
Required actionApply mitigations per vendor instructions or discontinue use of the product if mitigations are unavailable.

Severity

CVSS 3.19.8 critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Scored by NVD
WeaknessCWE-78

References

Sources

Exploitation status from the CISA Known Exploited Vulnerabilities catalog. EPSS scores from FIRST. Descriptions, severity and references from the National Vulnerability Database. Open-source package versions from OSV (CC-BY 4.0). Text is shown as each source states it; Stackurity does not edit it. Check the vendor's advisory before acting.

This product uses data from the NVD API but is not endorsed or certified by the NVD.