Vulnerabilities

Vulnerability · CVE-2024-4577

PHP-CGI OS Command Injection Vulnerability

Published Jun 7, 2024 · catalog updated Jun 17, 2026 · PHP Group PHP

Patch now

CVE-2024-4577 is in the CISA known-exploited catalog, due Jul 3, 2024. Confirm PHP Group PHP against the vendor advisory and apply that fix. The CVSS score does not change the priority.

Gaps on this record

  • No version range is stored. A customer cannot check an installed version against this record.
Severity
Critical9.8
Known exploitation
CISA KEV and VulnCheck KEV
EPSS
99.99%
Remediation
Remediation guidance
Affected products
cpe fedoraproject/fedora · cpe php/php · vendor PHP Group PHP

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.

Are you affected?

Enter the version you run. The result uses only the ranges stored on this record.

The check returns affected, not affected, or incomplete. It does not guess a version that is missing from the record.

  • cpe fedoraproject/fedora39
  • cpe fedoraproject/fedora40
  • cpe php/phpversion unspecified
  • vendor PHP Group PHPversion unspecified

How to fix CVE-2024-4577

What to do

Three questions, each answered from this record only. Confirm the vendor advisory before you patch.

Should you patch?

CVE-2024-4577 is in the CISA known-exploited catalog, due Jul 3, 2024. Confirm PHP Group PHP against the vendor advisory and apply that fix. The CVSS score does not change the priority.

Which versions are affected?

Compare what you have installed with 39, 40. Apply mitigations per vendor instructions or discontinue use of the product if mitigations are unavailable.

What should an analyst verify?

CWE-78: OS Command Injection. EPSS 99.99%. The CISA KEV listing is the exploitation evidence. A public exploit reference is linked in Sources. That is not the same as confirmed exploitation. Use the source links for the original advisory.

Code

The project this record applies to. Exploit listings stay in References.

No public source repository is identified for this product.

Timeline

Detection, updates, and resolution for this record.

  1. Jun 9, 2024 · Catalog

    Detected

    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 bina

  2. Jun 12, 2024 · CISA KEV

    Known exploited

    Apply mitigations per vendor instructions or discontinue use of the product if mitigations are unavailable.

  3. Jul 3, 2024 · CISA KEV

    Remediation due

    Apply mitigations per vendor instructions or discontinue use of the product if mitigations are unavailable.

  4. Jun 17, 2026 · Catalog

    Updated

    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 bina

Sources

  • CISA KEVConfirmed exploitationCVE-2024-4577

    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.gov
  • CVE.orgVulnerability recordCVE-2024-4577

    Official CVE identifier

    cve.org
  • FIRST EPSSExploitation probabilityCVE-2024-4577

    30-day exploitation probability 100.0%

    first.org
  • Exploit DatabasePublic exploit reference52331

    Public archive entry. The exploit body is not stored here.

    exploit-db.com
  • Metasploit ModulesPublic exploit moduleexploit_windows/http/php_cgi_arg_injection_rce_cve_2024_4577

    Public module reference (excellent). Module source is not copied into this catalog.

    rapid7.com
  • NIST NVDVulnerability recordCVE-2024-4577

    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 C

    nvd.nist.gov
  • VulnCheck KEVConfirmed exploitationCVE-2024-4577

    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.

    vulncheck.com

References

Freshness

Last verified in this catalog Oct 17, 2026. Significant claims (KEV, EPSS, CVSS, affected ranges) come from the source rows above — open the original publisher for the authoritative advisory.