Advisories · PHP & Laravel
CVE-2024-1874
Critical
CVSS 9.8
PHP-CGI argument injection on Windows
Disclosed 2024 · Last reviewed 2 Dec 2026
On Windows CGI, request data could be passed to the PHP binary as arguments. Linux PHP-FPM is a different setup. CVE-2024-4577 is the later bug in the same area.
What happened
The CGI SAPI did not fully separate query data from command-line arguments on Windows.
Affected and patched versions
- Affected
- PHP 8.1 before 8.1.28, 8.2 before 8.2.18, and 8.3 before 8.3.6 when PHP is exposed as CGI on Windows.
- Patched
- PHP 8.1.28, 8.2.18, 8.3.6, and later in those majors.
How to check your server
Check
php -v
How to fix and harden
- Confirm the Server API. This bug is Windows CGI, not a Linux php-fpm pool.
- Upgrade to 8.1.28, 8.2.18, 8.3.6, or any later release in that major.
- Prefer PHP-FPM or the official FastCGI setup.
Fix
php -v
Sources
Version ranges and fixes follow the vendor advisory. When a distribution backports a fix, trust its security tracker over the upstream version number. New advisories: RSS · JSON