PHP CGI Argument Injection Remote Code Execution
Critical argument injection flaw in PHP CGI mode on Windows enabling unauthenticated remote code execution via best-fit character encoding bypass.
CVSS v3.1 Vector Breakdown
Comprehensive attack metric decomposition according to FIRST specification
TechOverwatch AI Security Sentinel Analysis
Model: Gemini 2.0 Flash Security Sentinel · Generated: 2026-10-28
Executive Defense Summary
A weaponized, zero-interaction remote code execution vulnerability impacting PHP servers running on Windows under CGI or FastCGI with default configurations. Actively exploited in the wild to deliver ransomware.
Technical Root Cause Architecture
When PHP runs under Apache on Windows with Japanese, Traditional Chinese, or Simplified Chinese locales, the Windows Best-Fit mapping converts soft hyphens (0xAD) and other Unicode codepoints into ASCII hyphens (0x2D). This circumvents the escape shell argument protections implemented in CVE-2012-1823, allowing arbitrary command line switches to be passed to php-cgi.exe.
Exploitation Scenario & Attack Chain
An adversary sends an HTTP POST request targeting `/test.php?%ADd+allow_url_include%3d1+%ADd+auto_prepend_file%3dphp://input` containing raw PHP code in the request body. The web server translates `%AD` to `-`, invoking PHP with arbitrary directive injection, executing the payload directly in the web server process context.
Enterprise Blast Radius & Lateral Risk
Immediate web shell deployment, LSASS memory dumping via process injection, AD domain enumeration, and secondary payload deployment including ransomware or cobalt strike beacons.
Remediation & Defense Playbook
Immediate actionable steps for DevOps, SecOps, and Security Architects
Detection Guidance & Threat Hunting
Inspect web server access logs for query parameters containing `%AD` or `\xad` followed by `allow_url_include` or `auto_prepend_file`. Monitor php-cgi.exe spawning cmd.exe, powershell.exe, or certutil.exe.
Sigma Detection Rule (SIEM Export)
title: PHP CGI Argument Injection CVE-2024-4577
status: critical
logsource:
category: webserver
detection:
selection:
cs-uri-query|contains:
- '%ad'
- '%AD'
cs-uri-query|contains|all:
- 'allow_url_include'
- 'auto_prepend_file'
condition: selectionAffected Software & CPE Matrix
Targeted versions, patched releases, and Common Platform Enumerations
| Vendor | Product | Affected Versions | Fixed In |
|---|---|---|---|
| PHP Group | PHP | PHP 8.3 < 8.3.8, 8.2 < 8.2.20, 8.1 < 8.1.29 (all branches on Windows) | PHP 8.3.8, 8.2.20, 8.1.29 |
| Apache Friends | XAMPP | All Windows XAMPP installations with default CGI configurations | Upgrade PHP binary to >= 8.2.20 or disable CGI handling |
Official Advisories & Authoritative Sources
AI Agent & Security Automation Hub
TechOverwatch provides native machine-readable endpoints for autonomous agents, Cursor, Claude, ChatGPT, and automated patch scanners.