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

Source: https://junglewise.ai/threats/cve-2024-4577-php-cgi-os-command-injection-vulnerability  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2024-06-12. Updated: 2026-05-09  
License: CC BY 4.0 with a link back

CVE-2024-4577 · Severity: critical · CVSS 9.8 · Exploited in the wild · Published 2024-06-12

PHP-CGI on Windows contains an OS command injection vulnerability due to 'Best-Fit' character replacement in certain code pages. This allows remote attackers to bypass previous protections (CVE-2012-1823) and execute arbitrary PHP code or disclose source code by passing malicious options to the PHP binary.

Technologies: [PHP Group PHP](https://junglewise.ai/threats/technologies/php). Vendors: [PHP Group](https://junglewise.ai/threats/vendors/php-group).

## Quick answers

**Is CVE-2024-4577 exploited in the wild?** Yes. CVE-2024-4577 is known to be exploited in the wild, first recorded on 12 June 2024. Treat it as urgent.

**How severe is CVE-2024-4577?** Critical severity, with a CVSS score of 9.8, published 12 June 2024.

**Which products and versions are affected?** PHP Group PHP 8.1.* before 8.1.29, 8.2.* before 8.2.20, 8.3.* before 8.3.8.

**Is there a fix for CVE-2024-4577?** No fixed version is recorded yet. Check the vendor's advisory in the references below. If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.

**How is CVE-2024-4577 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2024-4577?** Check whether you run PHP Group PHP. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Affected products

- PHP Group PHP 8.1.* before 8.1.29, 8.2.* before 8.2.20, 8.3.* before 8.3.8

## Timeline

- 2024-06-06: disclosed: Initial security alert by DEVCORE
- 2024-06-12: kev added: Added to CISA Known Exploited Vulnerabilities Catalog
- 2024-06-12: advisory: NVD publication date

## Related threats

- [PHP use-after-free in global state handling](https://junglewise.ai/threats/cve-2026-109619-php-has-various-global-state-that-temporarily-points-into)
- [PHP Memory Corruption Vulnerability](https://junglewise.ai/threats/cve-2026-109618-gcp-2026-070)
- [PHP Phar uncontrolled recursion in phar_get_link_source](https://junglewise.ai/threats/cve-2026-7260-php-phar-uncontrolled-recursion-in-phar-get-link-source)
- [PHP BCMath out-of-bounds write in bccomp](https://junglewise.ai/threats/cve-2026-17544-php-bcmath-out-of-bounds-write-in-bccomp)
- [PHP ext-pgsql SQL injection in pg_select and related functions](https://junglewise.ai/threats/cve-2026-17543-php-ext-pgsql-sql-injection-in-pg-select-and-related-functions)
