Argument Injection in PHP-CGI
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.
- Published
- Jun 9, 2024
- Updated
- Jun 17, 2026
- EPSS
- 100.0% · 100th percentile
- CWE
- CWE-78
Sign in to follow · You’ll be notified if a followed record enters KEV, gets an exploit or is updated.
Report tools
Action score
99
Now
Patch today or shut off access.
- CVSS
- 39 / 40 · 9.8 / 10
- CISA KEV
- 30 / 30 · Listed
- EPSS
- 30 / 30 · 100.0%
CISA SSVC decision
- Exploitation
- active
- Automatable
- yes
- Technical impact
- total
Vulnrichment: CISA's decision-tree inputs.
CNA vs NVD score
- NVD
- 9.8
- CNA · php
- 9.8
- agree
The score given by the assigning authority versus NVD’s independent score. A gap means the severity is contested.
Actively exploited in the wild
CISA added this to its Known Exploited Vulnerabilities catalog on Jun 12, 2024. That signals real attacks, not theory.
Remediation deadline for government agencies: Jul 3, 2024.
Known to be used in ransomware campaigns.
Affected systems
| Vendor | Product | CPE |
|---|---|---|
| php | php | cpe:2.3:a:php:php |
| microsoft | windows | cpe:2.3:o:microsoft:windows |
| fedoraproject | fedora | cpe:2.3:o:fedoraproject:fedora |
Using php? Add it to your stack and be the first to know about CVEs like this one. (PHP)
Affected versions
NVD version ranges (for catalog products). Add the product to your stack with a version and matching uses these.
- php php8.1.0 and later · before 8.1.29
- php php8.2.0 and later · before 8.2.20
- php php8.3.0 and later · before 8.3.8
Versions reported by the vendor
Affected version ranges reported by the assigning authority (php). Independent of NVD's CPE analysis and usually ahead of it.
PHP Group PHP
- 8.1.* and later · before 8.1.29affected · semver
- 8.2.* and later · before 8.2.20affected · semver
- 8.3.* and later · before 8.3.8affected · semver
Package-level exposure
OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.
| Ecosystem | Package | Affected range | Fix |
|---|---|---|---|
| openSUSE:Tumbleweed | php8 | before 8.3.12-1.1 | 8.3.12-1.1 |
Same product
php: all recordsOther highest-scoring records for the same primary product.
- CVE-2019-11043Underflow in PHP-FPM can lead to RCEKEV99Now
- CVE-2012-1823sapi/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 queKEV99Now
- CVE-2018-7584In PHP through 5.6.33, 7.0.x before 7.0.28, 7.1.x through 7.1.14, and 7.2.x through 7.2.2, there is a stack-based buffer under-read while pa65This week
- CVE-2018-19518University of Washington IMAP Toolkit 2007f on UNIX, as used in imap_open() in PHP and other products, launches an rsh command (by means of 59Plan
- CVE-2016-3078Multiple integer overflows in php_zip.c in the zip extension in PHP before 7.0.6 allow remote attackers to cause a denial of service (heap-b56Plan
- CVE-2015-6834Multiple use-after-free vulnerabilities in PHP before 5.4.45, 5.5.x before 5.5.29, and 5.6.x before 5.6.13 allow remote attackers to execute53Plan
Remediation
Which version to upgrade to
Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.
| Product / package | Fixed version | Source |
|---|---|---|
| PHP Group PHP | 8.1.29 | Vendor (CNA) |
| PHP Group PHP | 8.2.20 | Vendor (CNA) |
| PHP Group PHP | 8.3.8 | Vendor (CNA) |
| openSUSE:php8 | 8.3.12-1.1 · openSUSE:Tumbleweed | Package registry (OSV) |
Exploit status
Weaponized
A ready exploit tool or active in-the-wild use is known for this vulnerability. This should be your top priority.
Evidence
- Metasploit module ×1
- Exploit-DB entry ×1
- Nuclei detection template ×1
- Proof-of-concept repository on GitHub ×50
Noroxi does not host or link to exploit code. Metasploit module names and Nuclei template ids are shown (names, not code); Exploit-DB entries and PoC repositories are given as counts only.
| Source | Kind | Date |
|---|---|---|
| Exploit-DB entry | webapps | 2025-06-15 |
| Metasploit module | exploit/windows/http/php_cgi_arg_injection_rce_cve_2024_4577PHP CGI Argument Injection Remote Code Executionexploit | 2024-06-06 |
| Nuclei detection template | Nuclei template CVE-2024-4577 | — |
| Proof-of-concept repository on GitHub | stars:75 | 2024-06-07 |
| Proof-of-concept repository on GitHub | stars:0 | 2024-06-07 |
| Proof-of-concept repository on GitHub | stars:0 | 2024-06-07 |
| Proof-of-concept repository on GitHub | stars:43 | 2024-06-07 |
| Proof-of-concept repository on GitHub | stars:321 | 2024-06-07 |
| Proof-of-concept repository on GitHub | stars:21 | 2024-06-07 |
| Proof-of-concept repository on GitHub | stars:1 | 2024-06-07 |
| Proof-of-concept repository on GitHub | stars:1 | 2024-06-07 |
| Proof-of-concept repository on GitHub | stars:1 | 2024-06-07 |
Research context
For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.
Timeline
From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.
- Metasploit-4 d
- First PoC-3 d
- Published
- CISA KEV+2 d
- TodaySep 29, 2026+842 d
FIRST EPSS daily score; only changes of 0.01 or more are recorded (step chart).
Patch and commit links
Commit, PR and diff links among the references. A starting point for patch-diffing and variant hunting; fixes, not exploits.
No commit or PR link among the references.
Credits
All researchersFinders, reporters and analysts named in the CNA record. Click a name for that researcher’s other records.
Variant candidates
Same product, same weakness class, within 18 months. If the patch missed the root cause, the sibling bug is here.
- CVE-2024-55850 days apartCommand injection via array-ish $command parameter of proc_open() (bypass CVE-2024-1874 fix)44Plan
- CVE-2024-8926121 days apartPHP CGI Parameter Injection Vulnerability (CVE-2024-4577 bypass)36Monitor
Chain candidates
An authentication bypass and a privilege-requiring bug in the same product, published close together: combined they may become an unauthenticated path.
—
Bug bounty scope
No known public program.
Source: bounty-targets-data (public HackerOne, Bugcrowd, Intigriti, YesWeHack listings).
Technical details
Attack conditions
- Anyone who can reach it over the internet can trigger it.
- No account or password is required.
- No user action is required.
- No special conditions are required; it is repeatable.
If successful
- Confidentiality
- high · data can be read
- Integrity
- high · data or configuration can be modified
- Availability
- high · the service can be disrupted
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality impact
- High
- Integrity impact
- High
- Availability impact
- High
Weakness class (CWE)
CWE-78 · Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
nvd-primary
Root cause
User input is inserted as text into a shell command. The shell may interpret special characters in the input as part of the command.
The bug in code
The whole CWE-78 classA representative example of this vulnerability class. Not the vendor's source code; it shows the faulty pattern and its fix.
Vulnerable
const host = req.body.host;exec("ping -c 1 " + host, onResult);Fixed
const host = req.body.host;if (!/^[a-z0-9.-]{1,253}$/i.test(host)) return res.sendStatus(400);execFile("ping", ["-c", "1", host], onResult);Attack context
MITRE CAPEC attack patterns and ATT&CK techniques for this weakness class (CWE). A starting point for detection rules and threat hunting.
Attack patterns (CAPEC)
- Command Line Execution through SQL InjectionCAPEC-108likelihood: Low · Very High
- Command DelimitersCAPEC-15likelihood: High · High
- Exploiting Multiple Input Interpretation LayersCAPEC-43likelihood: Medium · High
- Argument InjectionCAPEC-6likelihood: High · High
- OS Command InjectionCAPEC-88likelihood: High · High
ATT&CK techniques
—
Noroxi analysis
No Noroxi analysis for this record yet
We don't hand-write analysis for all 385,000+ vulnerabilities; that wouldn't be honest. For notable, high-impact vulnerabilities our team writes the mechanism, detection and remediation steps.
We use this product, ask for helpChange log
- Fix✗ → ✓
For records you follow, these changes also arrive as notifications. →
References
- cert.be/en/advisory/warning-php-remote-code-execution-patch-immediately
- www.openwall.com/lists/oss-security/2024/06/07/1
- blog.orange.tw/2024/06/cve-2024-4577-yet-another-php-rce.html
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/PKGTQUOA2NTZ3RXN22CSAUJPIRUYRB4B/
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/W45DBOH56NQDRTOM2DN2LNA2FZIMC3PK/
- security.netapp.com/advisory/ntap-20240621-0008/
- www.imperva.com/blog/imperva-protects-against-critical-php-vulnerability-cve-2024-4577/
- www.php.net/ChangeLog-8.php#8.1.29
- www.php.net/ChangeLog-8.php#8.2.20
- www.php.net/ChangeLog-8.php#8.3.8
- www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2024-4577
Vendor advisories and official records. Exploit/PoC links are deliberately left out.