Unauthenticated code execution via Best-Fit argument injection
Published Jun 9, 2024 · Updated Oct 21, 2025
Argument injection in PHP-CGI 8.1 before 8.1.29, 8.2 before 8.2.20, and 8.3 before 8.3.8 allows remote attackers to execute PHP code. In sapi/cgi/cgi_main.c, the query-string guard checks for an ASCII hyphen before Windows Best-Fit conversion maps a soft hyphen into that option prefix. An unauthenticated HTTP request reaches this path when Apache invokes PHP in CGI mode on Windows with an affected code page; injected options can disclose script source or run server-side code.
Summary
What happened
Argument injection in PHP-CGI 8.1 before 8.1.29, 8.2 before 8.2.20, and 8.3 before 8.3.8 allows remote attackers to execute PHP code. In sapi/cgi/cgi_main.c, the query-string guard checks for an ASCII hyphen before Windows Best-Fit conversion maps a soft hyphen into that option prefix. An unauthenticated HTTP request reaches this path when Apache invokes PHP in CGI mode on Windows with an affected code page; injected options can disclose script source or run server-side code.
The record
- CVE
- CVE-2024-4577
- Published
- Jun 9, 2024
- Updated
- Oct 21, 2025
- Vendor
- PHP Development Team
- Product
- PHP
- Classifications
- CWE-78, CWE-20, T1190
- Attack vector
- network
- Privileges
- unauthenticated
Timeline
How it unfolded
- Jun 9, 2024CVE publishedPublication date reported by the CVE source.
- Oct 21, 2025Record updatedLatest update available in the CVE record.
Exploitability
Present is not the same as exploitable
Compare your product and version with the public record. A matching version still requires validation against your environment.
Is a vulnerable build present?
Compare these published version ranges with your installed build and any vendor patches.
- Affected versionversion=8.1.0 <8.1.29
- Affected versionversion=8.1.* <8.1.29
- Affected versionversion=8.2.0 <8.2.20
- Affected versionversion=8.2.* <8.2.20
- Affected versionversion=8.3.0 <8.3.8
- Affected versionversion=8.3.* <8.3.8
What conditions does exploitation require?
What is affected?
Attacks
What attackers are doing with it
Daily unique IPs observed by Shadowserver honeypots for known exploited vulnerabilities (KEVs). Missing observations do not establish an absence of attacks.
Activity data is delayed. The latest report is Sep 28, 2026.
View daily counts
| Reporting day | Unique IPs |
|---|---|
| Sep 22, 2026 | 2 |
| Sep 23, 2026 | 3 |
| Sep 24, 2026 | 3 |
| Sep 25, 2026 | Unavailable |
| Sep 26, 2026 | 3 |
| Sep 27, 2026 | 1 |
| Sep 28, 2026 | Unavailable |
Weakness, pattern, technique
Public exploit references
- Rapid7 Metasploit PHP CGI Argument Injection modulefunctional · validated
- 11whoami99 CVE-2024-4577 proof of conceptproof of concept · demonstrated
Labels summarize the accepted research assessment. They do not indicate a test against your environment.
Reported exploitation
- CISA Known Exploited Vulnerabilities catalog listingknown exploited catalog
- CISA ransomware-campaign associationransomware
Technologies
Your stack
See the directory against your own environment.
Your stack
Check the software in your environment
Get started to see how Hinoki identifies affected software and validates exploitability in your environment.
Contact us