字号·· | 护眼
漏洞档案 · 严重

PHP PHP-CGI 参数注入(CVE-2024-4577)

CVE-2024-4577 别名:GHSA-VXPP-6299-MXW3
CVSS 9.8 / 3.1 EPSS 100.0% CISA KEV 在野利用 勒索软件利用 公开 PoC · 73 Nuclei 模板
综合风险100/ 100
CVSS9.8严重
EPSS100.0%30 天利用概率
机构收录时间2024-06-07更新 2026-12-01

研判简报

概述

CVE-2024-4577 是 PHP-CGI 在 Windows 环境下的参数注入漏洞,可视为对 CVE-2012-1823 修复的绕过。当 Apache 与 PHP-CGI 组合运行在 Windows 上、且系统使用特定代码页时,Windows 的 "Best-Fit" 字符替换行为会把软连字符等字符映射为普通连字符,使 PHP CGI 模块将攻击者可控的字符误判为 PHP 命令行选项。攻击者可借此泄露脚本源码或在服务器上执行任意 PHP 代码。使用 Apache + PHP-CGI on Windows 的运维与安全团队应优先关注。

严重性

CVSS 3.1 评分 9.8(AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H),综合风险分 100.0/100;EPSS 30 天利用概率 100.0%(百分位 100.0%,日期 2026-11-24)。攻击面为面向公众的 Web 服务,利用无需认证与用户交互。

利用状态

截至核查日期 2026-11-24:CISA KEV 已收录(2024-06-12),已知存在勒索软件利用;CISA SSVC 判定 automatable=yes、exploitation=active、technical_impact=total。公开侧已有 Exploit-DB 条目(52047、52331)与 73 条公开 PoC,Nuclei 模板 http/cves/2024/CVE-2024-4577.yaml 可用(模板元数据 verified: true)。KEV 要求动作期限为 2024-07-03。

受影响产品

PHP Group / PHP:>=8.1.* <8.1.29、>=8.2.* <8.2.20、>=8.3.* <8.3.8(结构化记录另列 >=8.1.0 <8.1.29、>=8.2.0 <8.2.20、>=8.3.0 <8.3.8)。触发条件为 Apache + PHP-CGI 部署于 Windows,且系统设置为使用特定代码页;CWE-78,MITRE ATT&CK 映射 T1059、T1190。

修复版本

官方修复版本:PHP 8.1.29、PHP 8.2.20、PHP 8.3.8(结构化提取同时列出 php 8.1.29、php 8.2.20、php 8.3.8)。参考材料中的 Nuclei 模板仅建议应用厂商补丁或升级至非受影响版本,未给出额外版本号。

缓解措施

按 KEV 要求,应用厂商说明的缓解措施;若无可用的缓解措施,应停止使用该产品。材料未给出具体的临时缓解配置项。可参考厂商安全公告 GHSA-3qgc-jrrr-25jv 与 GHSA-VXPP-6299-MXW3 的指引(材料未展开其内容)。

响应步骤

  1. 盘点 Windows 上 Apache + PHP-CGI 的部署实例,核对 PHP 版本是否落在 8.1.* <8.1.29、8.2.* <8.2.20、8.3.* <8.3.8 区间。
  2. 升级至 PHP 8.1.29 / 8.2.20 / 8.3.8 或更高修复版本,并确认 CGI 配置随升级生效。
  3. 无法立即升级时,按厂商公告执行缓解或按 KEV 要求停用相关组件。
  4. 使用公开 Nuclei 模板对暴露面进行检测,关注模板中针对 php-cgi 路径与参数注入的请求特征。
  5. 排查 Web 访问日志中 QUERY_STRING 含软连字符(%AD)及 cgi.force_redirect、allow_url_include、auto_prepend_file 等参数的可疑请求。
  6. 结合 T1190/T1059 视角检查主机侧异常命令执行与脚本解释器调用痕迹,并按勒索软件利用情报提升监控等级。

参考来源

  1. https://www.exploit-db.com/exploits/52047exploit,exploitdb
  2. https://www.exploit-db.com/exploits/52331exploit,exploitdb
  3. https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2024/CVE-2024-4577.yamlexploit,nuclei
  4. https://github.com/php/php-src/security/advisories/GHSA-3qgc-jrrr-25jvx_transferred,advisory,euvd
  5. https://blog.orange.tw/2024/06/cve-2024-4577-yet-another-php-rce.htmlx_transferred,advisory,euvd
  6. https://devco.re/blog/2024/06/06/security-alert-cve-2024-4577-php-cgi-argument-injection-vulnerability-en/x_transferred,advisory,euvd
  7. https://arstechnica.com/security/2024/06/php-vulnerability-allows-attackers-to-run-malicious-code-on-windows-servers/x_transferred,advisory,euvd
  8. https://www.imperva.com/blog/imperva-protects-against-critical-php-vulnerability-cve-2024-4577/x_transferred,advisory,euvd,kev
  9. https://github.com/11whoami99/CVE-2024-4577x_transferred,advisory,euvd,poc,github,exploit,poc_github
  10. https://github.com/xcanwin/CVE-2024-4577-PHP-RCEx_transferred,advisory,euvd,exploit,poc_github
  11. https://github.com/rapid7/metasploit-framework/pull/19247x_transferred,advisory,euvd
  12. https://labs.watchtowr.com/no-way-php-strikes-again-cve-2024-4577/x_transferred,advisory,euvd
  13. https://github.com/watchtowrlabs/CVE-2024-4577x_transferred,advisory,euvd,poc,github,exploit,poc_github
  14. https://www.php.net/ChangeLog-8.php#8.1.29x_transferred,advisory,euvd
  15. https://www.php.net/ChangeLog-8.php#8.2.20x_transferred,advisory,euvd
  16. https://www.php.net/ChangeLog-8.php#8.3.8x_transferred,advisory,euvd