{"id":"CVE-2024-4577","aliases":["CVE-2024-4577","BIT-LIBPHP-2024-4577","BIT-PHP-2024-4577","BIT-PHP-MIN-2024-4577","GHSA-3qgc-jrrr-25jv"],"related":[],"kind":"vulnerability","state":"published","title":"Argument Injection in PHP-CGI","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"es","text":"En las versiones de PHP 8.1.* anteriores a 8.1.29, 8.2.* anteriores a 8.2.20, 8.3.* anteriores a 8.3.8, cuando se usa Apache y PHP-CGI en Windows, si el sistema está configurado para usar ciertas páginas de códigos, Windows puede utilizar el comportamiento \"Mejor ajuste\" para reemplazar caracteres en la línea de comando proporcionada a las funciones de la API de Win32. El módulo PHP CGI puede malinterpretar esos caracteres como opciones de PHP, lo que puede permitir a un usuario malintencionado pasar opciones al binario PHP que se está ejecutando y, por lo tanto, revelar el código fuente de los scripts, ejecutar código PHP arbitrario en el servidor, etc.","source":"nvd"},{"lang":"en","text":"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.","source":"kev"}],"published":"2024-06-09T19:42:36.464Z","modified":"2026-09-08T08:48:18.219Z","severity":{"scorer":"php","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},"severities":[{"scorer":"php","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"Bitnami Vulnerability Database","scheme":"rating","rating":"CRITICAL"}],"cwes":["CWE-78"],"affected":[{"ranges":[{"type":"semver","introduced":"8.1.*","fixed":"8.1.29","status":"affected"},{"type":"semver","introduced":"8.2.*","fixed":"8.2.20","status":"affected"},{"type":"semver","introduced":"8.3.*","fixed":"8.3.8","status":"affected"}],"vendor":"PHP Group","product":"PHP","repo":"https://github.com/php/php-src","platforms":["Windows"],"source":"cvelist"},{"ranges":[{"type":"custom","introduced":"8.1.0","fixed":"8.1.29","status":"affected"}],"vendor":"php_group","product":"php","cpe":"cpe:2.3:a:php_group:php:8.1.0:*:*:*:*:*:*:*","source":"cvelist"},{"ranges":[{"type":"custom","introduced":"8.2.0","fixed":"8.2.20","status":"affected"}],"vendor":"php_group","product":"php","cpe":"cpe:2.3:a:php_group:php:8.2.0:*:*:*:*:*:*:*","source":"cvelist"},{"ranges":[{"type":"custom","introduced":"8.3.0","fixed":"8.3.8","status":"affected"}],"vendor":"php_group","product":"php","cpe":"cpe:2.3:a:php_group:php:8.3.0:*:*:*:*:*:*:*","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"8.1.0","fixed":"8.1.29"},{"status":"affected","introduced":"8.2.0","fixed":"8.2.20"},{"status":"affected","introduced":"8.3.0","fixed":"8.3.8"}],"vendor":"php","product":"php","cpe":"cpe:2.3:a:php:php:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"39"},{"status":"affected","version":"40"}],"vendor":"fedoraproject","product":"fedora","cpe":"cpe:2.3:o:fedoraproject:fedora:39:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"8.1.29"},{"type":"semver","introduced":"8.2.0","status":"affected","fixed":"8.2.20"},{"type":"semver","introduced":"8.3.0","status":"affected","fixed":"8.3.8"}],"ecosystem":"Bitnami","package":"libphp","purl":"pkg:bitnami/libphp","source":"bitnami"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"8.1.29"},{"type":"semver","introduced":"8.2.0","status":"affected","fixed":"8.2.20"},{"type":"semver","introduced":"8.3.0","status":"affected","fixed":"8.3.8"}],"ecosystem":"Bitnami","package":"php","purl":"pkg:bitnami/php","source":"bitnami"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"8.1.29"},{"type":"semver","introduced":"8.2.0","status":"affected","fixed":"8.2.20"},{"type":"semver","introduced":"8.3.0","status":"affected","fixed":"8.3.8"}],"ecosystem":"Bitnami","package":"php-min","purl":"pkg:bitnami/php-min","source":"bitnami"},{"ranges":[],"vendor":"PHP Group","product":"PHP","source":"kev"}],"references":[{"url":"https://github.com/php/php-src/security/advisories/GHSA-3qgc-jrrr-25jv","tags":["advisory","exploit","third-party-advisory","x-transferred"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://blog.orange.tw/2024/06/cve-2024-4577-yet-another-php-rce.html","tags":["advisory","third-party-advisory","x-transferred"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://devco.re/blog/2024/06/06/security-alert-cve-2024-4577-php-cgi-argument-injection-vulnerability-en/","tags":["advisory","exploit","third-party-advisory","x-transferred"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://arstechnica.com/security/2024/06/php-vulnerability-allows-attackers-to-run-malicious-code-on-windows-servers/","tags":["advisory","exploit","press/media-coverage","third-party-advisory","x-transferred"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://www.imperva.com/blog/imperva-protects-against-critical-php-vulnerability-cve-2024-4577/","tags":["advisory","third-party-advisory","x-transferred"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://github.com/11whoami99/CVE-2024-4577","tags":["evidence","exploit","x-transferred"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://github.com/xcanwin/CVE-2024-4577-PHP-RCE","tags":["advisory","exploit","third-party-advisory","x-transferred"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://github.com/rapid7/metasploit-framework/pull/19247","tags":["exploit","fix","issue-tracking","patch","x-transferred"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://labs.watchtowr.com/no-way-php-strikes-again-cve-2024-4577/","tags":["advisory","exploit","third-party-advisory","x-transferred"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://github.com/watchtowrlabs/CVE-2024-4577","tags":["advisory","exploit","third-party-advisory","x-transferred"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://www.php.net/ChangeLog-8.php#8.1.29","tags":["article","release-notes","x-transferred"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://www.php.net/ChangeLog-8.php#8.2.20","tags":["article","release-notes","x-transferred"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://www.php.net/ChangeLog-8.php#8.3.8","tags":["article","release-notes","x-transferred"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://cert.be/en/advisory/warning-php-remote-code-execution-patch-immediately","tags":["advisory","third-party-advisory","x-transferred"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://isc.sans.edu/diary/30994","tags":["advisory","exploit","third-party-advisory","x-transferred"],"sources":["cvelist","nvd","bitnami"]},{"url":"http://www.openwall.com/lists/oss-security/2024/06/07/1","tags":["advisory","mailing-list","third-party-advisory","x-transferred"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/PKGTQUOA2NTZ3RXN22CSAUJPIRUYRB4B/","tags":["discussion","mailing-list","x-transferred"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/W45DBOH56NQDRTOM2DN2LNA2FZIMC3PK/","tags":["discussion","mailing-list","x-transferred"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://security.netapp.com/advisory/ntap-20240621-0008/","tags":["advisory","third-party-advisory","x-transferred"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2024-4577","tags":["government-resource","us-government-resource","web"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://www.vicarius.io/vsociety/posts/php-cgi-os-command-injection-vulnerability-cve-2024-4577","tags":["advisory","exploit","third-party-advisory"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://www.vicarius.io/vsociety/posts/php-cgi-argument-injection-to-rce-cve-2024-4577","tags":["advisory","exploit","third-party-advisory"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://blog.talosintelligence.com/new-persistent-attacks-japan/","tags":["advisory","exploit","third-party-advisory"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-4577","tags":["kev","web"],"sources":["bitnami","kev"]},{"url":"https://www.php.net/ChangeLog-8.php#","tags":["kev"],"sources":["kev"]}],"credits":["Orange Tsai, DEVCORE Research Team"],"assigner":"php","kev":{"dateAdded":"2024-06-12","dueDate":"2024-07-03","name":"PHP-CGI OS Command Injection Vulnerability","requiredAction":"Apply mitigations per vendor instructions or discontinue use of the product if mitigations are unavailable.","ransomware":true,"notes":"This vulnerability affects a common open-source component, third-party library, or a protocol used by different products. Please check with specific vendors for information on patching status. For more information, please see:  https://www.php.net/ChangeLog-8.php#;   https://nvd.nist.gov/vuln/detail/CVE-2024-4577"},"ssvc":{"scorer":"CISA-ADP","exploitation":"active","automatable":"yes","technicalImpact":"total","date":"2024-06-15T03:55:28.430Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-4577","url":"https://www.cve.org/CVERecord?id=CVE-2024-4577","licence":"CVE Terms of Use","modified":"2025-10-21T23:05:16.089Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-4577","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-4577","licence":"Public domain","modified":"2026-06-17T08:02:11.493Z"},{"source":"bitnami","name":"Bitnami Vulnerability Database","id":"BIT-LIBPHP-2024-4577","url":"https://osv.dev/vulnerability/BIT-LIBPHP-2024-4577","licence":"Apache-2.0","modified":"2026-09-08T08:48:08.508Z"},{"source":"bitnami","name":"Bitnami Vulnerability Database","id":"BIT-PHP-2024-4577","url":"https://osv.dev/vulnerability/BIT-PHP-2024-4577","licence":"Apache-2.0","modified":"2026-09-08T08:48:18.219Z"},{"source":"bitnami","name":"Bitnami Vulnerability Database","id":"BIT-PHP-MIN-2024-4577","url":"https://osv.dev/vulnerability/BIT-PHP-MIN-2024-4577","licence":"Apache-2.0","modified":"2026-09-08T08:48:18.125Z"},{"source":"kev","name":"CISA KEV","id":"CVE-2024-4577","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog?search_api_fulltext=CVE-2024-4577","licence":"CC0-1.0","modified":"2024-06-12T00:00:00.000Z"}],"updatedAt":"2026-11-25T22:58:41.606Z","epss":{"score":0.99985,"percentile":0.99982,"date":"2026-12-01T12:00:22.000Z"}}