{"id":"CVE-2024-4577","kind":"vulnerability","aliases":["CVE-2024-4577"],"related":[],"title":"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…","description":"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.","summary":"PHP on Windows running in CGI mode mishandles command-line arguments, letting a remote request inject OS commands. An attacker gets arbitrary code execution on the web server with the privileges of the PHP process.","severity":"critical","cvss":9.8,"epss":null,"exploited":true,"exploited_at":"2024-06-12T00:00:00+00:00","products":[{"name":"PHP Group PHP","fixed":[],"affected":"","ecosystem":"vendor"},{"name":"php","fixed":["8.1.29"],"affected":">= 8.1.0, < 8.1.29","ecosystem":"vendor"},{"name":"php","fixed":["8.2.20"],"affected":">= 8.2.0, < 8.2.20","ecosystem":"vendor"},{"name":"php","fixed":["8.3.8"],"affected":">= 8.3.0, < 8.3.8","ecosystem":"vendor"},{"name":"fedoraproject fedora","fixed":[],"affected":"= 39","ecosystem":"vendor"},{"name":"fedoraproject fedora","fixed":[],"affected":"= 40","ecosystem":"vendor"}],"ecosystems":["vendor"],"tags":["exploited","php","php-cgi","poc-public","ransomware","runtime","self-hosted","windows"],"not_affected_if":["linux-only","no-cgi-mode","php-fpm-or-mod-php"],"how_to_check":"Check whether PHP runs as CGI on Windows: run php -v and look for the CGI binary (php-cgi.exe) serving requests in IIS or Apache configuration.","fix":"Upgrade PHP on Windows to a patched release from the PHP Group, or move off PHP-CGI to mod_php or PHP-FPM.\nDiscontinue use of the product if mitigations are unavailable, per CISA guidance.","status":"open","published_at":"2024-06-09T20:15:09+00:00","first_seen_at":"2026-10-23T19:11:51+00:00","triaged_at":"2026-10-23T20:58:43+00:00","updated_at":"2026-10-23T22:29:05+00:00","category":"runtime","confidence":0.8,"triage":{"at":"2026-10-23T20:58:43Z","model":"claude-haiku-5-5","output":{"fix":"Upgrade PHP on Windows to a patched release from the PHP Group, or move off PHP-CGI to mod_php or PHP-FPM.\nDiscontinue use of the product if mitigations are unavailable, per CISA guidance.","reach":"internet","impact":"high","summary":"PHP on Windows running in CGI mode mishandles command-line arguments, letting a remote request inject OS commands. An attacker gets arbitrary code execution on the web server with the privileges of the PHP process.","category":"runtime","who_cares":["php","windows","php-cgi","self-hosted"],"confidence":0.8,"needs_auth":"no","worst_case":"Remote attacker runs arbitrary commands on the Windows web server.","analyst_note":"Confirm exact affected and fixed PHP versions and mitigation steps from the PHP Group advisory and the CISA KEV entry (https://www.cisa.gov/known-exploited-vulnerabilities-catalog?search_api_fulltext=CVE-2024-4577).","how_to_check":"Check whether PHP runs as CGI on Windows: run php -v and look for the CGI binary (php-cgi.exe) serving requests in IIS or Apache configuration.\nUnknown whether a specific PHP version list applies beyond what the sources state.\nUnknown for other exact check commands.","needs_analyst":true,"not_affected_if":["linux-only","php-fpm-or-mod-php","no-cgi-mode"],"user_interaction":"no","needs_special_setup":"yes","severity_if_unknown":"critical"},"cost_usd":0.000561,"input_tokens":2894,"output_tokens":544,"severity_before":"unknown"},"analyst_status":null,"analyst_note":null,"search":"'-2024':21A,24A '-4577':22A,25A '8.1':4A,89C '8.1.29':6A,91C '8.2':7A,92C '8.2.20':9A,94C '8.3':10A,95C '8.3.8':12A,97C 'allow':148C 'apach':15A,100C 'api':134C 'arbitrari':72B,169C 'argument':61B 'attack':70B 'behavior':124C 'best':122C 'best-fit':121C 'binari':157C 'certain':115C 'cgi':19A,40B,55B,104C,137C 'charact':127C,142C 'code':73B,116C,165C,171C 'command':59B,68B,129C 'command-lin':58B 'cve':20A,23A 'etc':175C 'execut':74B 'exploit':36B 'fedora':33A,35A 'fedoraproject':32A,34A 'fit':123C 'function':135C 'get':71B 'given':131C 'group':27A 'host':48B 'inject':66B 'let':62B 'line':60B,130C 'malici':150C 'may':119C,139C,147C 'mishandl':57B 'misinterpret':140C 'mode':56B 'modul':138C 'option':145C,154C 'os':67B 'page':117C 'pass':153C 'php':2A,18A,26A,28A,29A,30A,31A,37B,39B,50B,84B,87C,103C,136C,144C,156C,170C 'php-cgi':17A,38B,102C 'poc':42B 'poc-publ':41B 'privileg':81B 'process':85B 'public':43B 'ransomwar':44B 'remot':64B 'replac':126C 'request':65B 'reveal':162C 'run':53B,159C,168C 'runtim':45B 'script':167C 'self':47B 'self-host':46B 'server':78B,174C 'set':111C 'sourc':164C 'system':109C 'thus':161C 'use':14A,99C,114C,120C 'user':151C 'version':3A,88C 'web':77B 'win32':133C 'window':49B,52B,106C,118C","nicknames":[],"mitigations":[],"who_affected":null,"tier":null,"verified":{},"analyst_revisit_at":null,"first_public_at":"2024-06-09T20:15:09+00:00","kev":{"dateAdded":"2024-06-12","dueDate":"2024-07-03","requiredAction":"Apply mitigations per vendor instructions or discontinue use of the product if mitigations are unavailable.","knownRansomwareCampaignUse":"Known"},"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","cvss_by":"security@php.net","poc_count":1,"sources":[{"source":"kev","external_id":"CVE-2024-4577","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog?search_api_fulltext=CVE-2024-4577","severity":null,"published_at":"2024-06-12T00:00:00+00:00","modified_at":null,"first_seen_at":"2026-10-23T19:11:51+00:00","fetched_at":"2026-10-25T11:39:15+00:00","note":null},{"source":"github-poc","external_id":"Ghost-Bx1/POC-CVE-2026-109618-CVE-2026-109619-CVE-2024-4577","url":"https://github.com/Ghost-Bx1/POC-CVE-2026-109618-CVE-2026-109619-CVE-2024-4577","severity":null,"published_at":"2026-10-23T15:14:01+00:00","modified_at":null,"first_seen_at":"2026-10-23T20:22:16+00:00","fetched_at":"2026-10-23T20:22:16+00:00","note":null},{"source":"nvd","external_id":"CVE-2024-4577","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-4577","severity":null,"published_at":"2024-06-09T20:15:09+00:00","modified_at":"2026-06-17T08:02:11+00:00","first_seen_at":"2026-10-23T22:29:05+00:00","fetched_at":"2026-10-23T22:29:05+00:00","note":null}],"documents":[{"id":679,"url":"https://github.com/Ghost-Bx1/POC-CVE-2026-109618-CVE-2026-109619-CVE-2024-4577","title":"Ghost-Bx1/POC-CVE-2026-109618-CVE-2026-109619-CVE-2024-4577","kind":"poc","source":"github","text":"\n\nstars 0","published_at":"2026-10-23T15:14:01+00:00","relation":"poc","confidence":null,"note":"0 stars"}],"notice":"Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai"}