SecurityContext

CVE-2024-4577: PHP CGI - Command Injection

  • Cve: CVE-2024-4577
  • Name: PHP CGI - Command Injection
  • 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.
  • Impact: Remote attackers can execute arbitrary commands on the server, leading to full system compromise.
  • Remediation: Update PHP CGI to version 8.2.20 or later.
  • Vulnerability type: command_injection
  • Vulnerability impact: remote_code_execution
  • Requirement type: none
  • Labels source: projectdiscovery
  • Severity: critical
  • Cvss score: 9.8
  • Cvss vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Epss score: 0.99987
  • Epss percentile: 0.99984
  • Assignee: [email protected]
  • Published at: 2024-06-09T20:15:09Z
  • Age in days: 898
  • Modified at: 2026-06-17T08:02:11Z
  • Patch available: yes
  • Public exploits total: 100
  • Public exploits capped: yes
  • References total: 34
  • Products total: 2
  • Oss: yes
  • Projects total: 2
  • Advisory url: https://nvd.nist.gov/vuln/detail/CVE-2024-4577
  • Nvd status: analyzed
  • Checked, none or zero: rejected by nvd
  • Not known: requirements

Cwe

IdName
CWE-78Improper Neutralization of Special Elements used in an OS Command

Known exploited entries

ListAdded dateDue dateRansomware use
cisa2024-06-122024-07-03yes
vulncheck2024-06-07—no

Nuclei templates

IdUrl
CVE-2024-4577https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2024/CVE-2024-4577.yaml

Hackerone

  • Reports: 9
  • Rank: 2221

Public exploits

Same in every row:

  • Source: nvd
  • Added date: 2024-06-09
Url
https://arstechnica.com/security/2024/06/php-vulnerability-allows-attackers-to-run-malicious-code-on-windows-servers/
https://devco.re/blog/2024/06/06/security-alert-cve-2024-4577-php-cgi-argument-injection-vulnerability-en/
https://github.com/11whoami99/CVE-2024-4577
https://github.com/php/php-src/security/advisories/GHSA-3qgc-jrrr-25jv
https://github.com/rapid7/metasploit-framework/pull/19247

References

Same in every row:

  • Source: nvd
UrlTags
https://github.com/rapid7/metasploit-framework/pull/19247Exploit, Issue Tracking, Patch
https://github.com/11whoami99/CVE-2024-4577Exploit
https://arstechnica.com/security/2024/06/php-vulnerability-allows-attackers-to-run-malicious-code-on-windows-servers/Exploit, Press/Media Coverage, Third Party Advisory
https://devco.re/blog/2024/06/06/security-alert-cve-2024-4577-php-cgi-argument-injection-vulnerability-en/Exploit, Third Party Advisory
https://github.com/php/php-src/security/advisories/GHSA-3qgc-jrrr-25jvExploit, Third Party Advisory
https://github.com/watchtowrlabs/CVE-2024-4577Exploit, Third Party Advisory
https://github.com/xcanwin/CVE-2024-4577-PHP-RCEExploit, Third Party Advisory
https://isc.sans.edu/diary/30994Exploit, Third Party Advisory
https://labs.watchtowr.com/no-way-php-strikes-again-cve-2024-4577/Exploit, Third Party Advisory
https://blog.talosintelligence.com/new-persistent-attacks-japan/Exploit, Third Party Advisory

Products

ProductAffectedPlatform boundSourcesUrl
php:php>= 8.3.0, < 8.3.8; >= 8.2.0, < 8.2.20; >= 8.1.0, < 8.1.29yesnvd/v1/products/php/php
fedoraproject:fedora= 40, = 39nonvd/v1/products/fedoraproject/fedora

Projects

RepositoryLink kindsIndexedUrl
php/php-srcfix, security_advisoryyes/v1/repositories/php/php-src
rapid7/metasploit-frameworkfix, pullyes/v1/repositories/rapid7/metasploit-framework

Index

  • Checked, none or zero: repositories, repositories high signal, packages

Exploitation

  • Known exploited: yes
  • Known exploited since: 2024-06-12
  • Known exploited by: cisa, vulncheck
  • Vulncheck known exploited since: 2024-06-07
  • Public exploit: yes
  • Public exploit count: 100
  • Public exploit first date: 2024-06-09
  • Remote: yes
  • Hackerone reports: 9
  • Exposed hosts: 6200906
  • Checked, none or zero: exploitation seen, initial access, authentication required
  • Not known: initial access since

Nuclei template