The PHP security team has published mitigation guidance for a newly disclosed, unauthenticated remote code execution (RCE) vulnerability that — critically — has no patch available. The flaw affects PHP deployments running in non-default configurations, which means the blast radius depends entirely on how your web stack was built. That's the uncomfortable part: many production environments, especially legacy Linux/Apache CGI deployments and Windows-based PHP-CGI setups, fall squarely into the affected category without their operators realizing it.
An unauthenticated RCE in the world's most widely deployed server-side language is about as bad as pre-patch scenarios get. PHP powers roughly three-quarters of websites whose server-side technology is known. When the vendor's answer is "we can't patch this yet, here's how to reconfigure," defenders are the patch. This post breaks down what's known, how to determine whether you're exposed, what the PHP team's mitigations actually do, and how to detect exploitation attempts while you wait for an official fix.
Technical Analysis
What's affected
Based on the PHP security team's disclosure, the vulnerability:
- Is exploitable without authentication — no credentials, no session, no user interaction required.
- Results in remote code execution in the context of the PHP/web server process.
- Only affects systems running non-default configurations — stock, out-of-the-box PHP installations in their standard SAPI mode are not the primary target surface.
- Has no vendor patch at time of disclosure. The PHP team has instead issued configuration-level mitigations.
Historically, PHP's most dangerous unauthenticated RCEs have shared a common architectural trait: they live in the PHP-CGI / CGI SAPI handling path rather than in PHP core itself. CGI-mode deployments — where the web server invokes php-cgi as a separate process and passes request parameters through the environment and command line — have repeatedly been the source of argument-injection and parameter-parsing flaws that let attackers smuggle PHP directives (such as allow_url_include, auto_prepend_file, or -d flags) through crafted request strings. The current disclosure fits that defensive profile: a configuration-dependent, unauthenticated code execution condition that the vendor addresses through hardening guidance rather than a code fix.
No CVE identifier has been publicly assigned in the source reporting at time of writing. Treat this as an actively developing disclosure — monitor the official PHP security page and the original BleepingComputer coverage for CVE assignment and CVSS scoring.
Why "non-default configuration" should not make you comfortable
Three reasons:
- CGI/FastCGI deployments are common in the wild, particularly on shared hosting, legacy LAMP stacks, embedded appliances, and Windows IIS environments where PHP-CGI is the standard integration method.
- "Non-default" often means "configured by a vendor or control panel years ago." cPanel/Plesk-era deployments, vendor-supplied virtual appliances, and container images built on older tutorials frequently run PHP in exactly the modes these flaws target.
- Attackers scan for configuration, not versions. Once exploitation details circulate, internet-wide scanning for the vulnerable request pattern begins within hours — as we saw with prior PHP-CGI argument injection flaws, which were weaponized by ransomware operators and cryptomining crews within days of disclosure.
Exploitation status
At disclosure, the PHP team released mitigation guidance proactively — the correct defensive posture is to assume details will become public and scanning will follow imminently, even if mass exploitation has not yet been confirmed. There is no confirmed CISA KEV entry tied to this specific flaw at time of writing, but given PHP's exploitation history, pre-positioning detections now is the right call. This is a "hunt before the headline" scenario.
The defensive view of the attack chain
From a defender's perspective, exploitation of this class of PHP flaw typically follows a recognizable pattern:
- Crafted HTTP request — the attacker sends a GET/POST request with a malicious query string or body designed to inject PHP directives or arguments into the interpreter invocation.
- Interpreter manipulation — injected directives (e.g., forcing
auto_prepend_fileto point at attacker-controlled input, or enabling remote includes) cause the PHP process to execute attacker-supplied code. - Code execution as the web server user — payload runs as
www-data,apache,nginx, orIIS AppPoolidentity. - Post-exploitation — web shell drop, reverse shell, or downloader execution, typically visible as the web server or PHP process spawning shell interpreters (
/bin/sh,cmd.exe,powershell.exe).
Steps 1 and 4 are your most reliable detection surfaces. Step 1 shows up in web access logs; step 4 shows up in endpoint process telemetry.
Detection & Response
SIGMA Rules
---
title: PHP-CGI Argument Injection Attempt in Web Request
tid: 8f2a1c94-6d3b-4e57-a921-5c7d8e9f0a1b
status: experimental
description: Detects HTTP requests containing PHP directive injection patterns consistent with PHP-CGI argument injection exploitation, such as -d flags, allow_url_include, or auto_prepend_file smuggled through query strings.
references:
- https://www.bleepingcomputer.com/news/security/php-shares-mitigation-for-new-and-unpatched-rce-vulnerability/
- https://attack.mitre.org/techniques/T1190/
author: Security Arsenal
date: 2026/01/15
tags:
- attack.initial_access
- attack.t1190
logsource:
category: webserver
detection:
selection_query_directives:
cs-uri-query|contains:
- '-d+'
- '-d%20'
- '%2dd%20'
- 'allow_url_include'
- 'auto_prepend_file'
- 'auto_append_file'
selection_query_encoding:
cs-uri-query|contains:
- '%ad'
- '%AD'
condition: 1 of selection_query_*
falsepositives:
- Rare; legitimate applications do not pass PHP CLI directives in query strings
level: high
---
title: Web Server or PHP Process Spawning Shell
tid: 3b7e9d52-1f48-4a6c-b835-9d2e4f7a0c6d
status: experimental
description: Detects web server or PHP interpreter processes spawning shell interpreters or command processors, a strong post-exploitation indicator for PHP RCE vulnerabilities including the unpatched PHP flaw.
references:
- https://www.bleepingcomputer.com/news/security/php-shares-mitigation-for-new-and-unpatched-rce-vulnerability/
- https://attack.mitre.org/techniques/T1059/
author: Security Arsenal
date: 2026/01/15
tags:
- attack.execution
- attack.t1059
logsource:
category: process_creation
product: linux
detection:
selection_parent:
ParentImage|endswith:
- '/php-cgi'
- '/php'
- '/php-fpm'
- '/apache2'
- '/httpd'
- '/nginx'
selection_child:
Image|endswith:
- '/sh'
- '/bash'
- '/dash'
- '/zsh'
- '/curl'
- '/wget'
- '/python'
- '/python3'
- '/perl'
- '/nc'
- '/ncat'
condition: all of selection_*
falsepositives:
- Some CMS plugins and backup tools invoke shell commands; baseline known-good parent/child pairs
level: high
---
title: PHP-CGI Spawning Command Processor on Windows
tid: 5d1c8a37-9b42-4e6f-a708-2c5f3d9e1b4a
status: experimental
description: Detects php-cgi.exe or IIS worker processes spawning cmd.exe, powershell.exe, or download utilities on Windows, consistent with post-exploitation of PHP-CGI argument injection flaws.
references:
- https://www.bleepingcomputer.com/news/security/php-shares-mitigation-for-new-and-unpatched-rce-vulnerability/
- https://attack.mitre.org/techniques/T1059.001/
author: Security Arsenal
date: 2026/01/15
tags:
- attack.execution
- attack.t1059.001
logsource:
category: process_creation
product: windows
detection:
selection_parent:
ParentImage|endswith:
- '\php-cgi.exe'
- '\php.exe'
- '\w3wp.exe'
selection_child:
Image|endswith:
- '\cmd.exe'
- '\powershell.exe'
- '\pwsh.exe'
- '\certutil.exe'
- '\bitsadmin.exe'
- '\curl.exe'
condition: all of selection_*
falsepositives:
- Rare on production web servers; investigate any hit
level: critical
A note on fidelity: the first rule targets web logs (IIS cs-uri-query, Apache/nginx access log ingestion) and will only be as good as your log pipeline — if your load balancer or WAF strips query strings before logging, deploy the endpoint rules as your primary coverage instead. The two process-creation rules are your highest-confidence catches. On a production web server, php-cgi.exe spawning powershell.exe is never routine.
KQL — Microsoft Sentinel / Defender
This query hunts both the delivery surface (suspicious query strings in ingested web logs via CommonSecurityLog/CEF or W3CIISLog) and the execution surface (Defender process telemetry):
// Hunt 1: PHP directive injection patterns in web request logs (CEF/Syslog/WAF ingestion)
let directives = dynamic(["-d+", "-d%20", "%2dd", "allow_url_include", "auto_prepend_file", "auto_append_file", "%ad"]);
CommonSecurityLog
| where TimeGenerated > ago(7d)
| where RequestURL has_any (directives) or RequestQuery has_any (directives)
| extend MatchedIndicator = iff(RequestURL has_any (directives), RequestURL, RequestQuery)
| summarize AttemptCount = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated)
by SourceIP, DestinationHostName, MatchedIndicator
| order by AttemptCount desc;
// Hunt 2: PHP/web server processes spawning shells or LOLBins (Defender endpoint telemetry)
let WebParents = dynamic(["php-cgi.exe", "php.exe", "w3wp.exe", "httpd.exe", "nginx.exe"]);
let SuspiciousChildren = dynamic(["cmd.exe", "powershell.exe", "pwsh.exe", "certutil.exe", "bitsadmin.exe", "curl.exe", "mshta.exe", "rundll32.exe"]);
DeviceProcessEvents
| where TimeGenerated > ago(7d)
| where InitiatingProcessFileName in~ (WebParents)
| where FileName in~ (SuspiciousChildren)
| project TimeGenerated, DeviceName, InitiatingProcessFileName, InitiatingProcessCommandLine,
FileName, ProcessCommandLine, AccountName, RemoteIP, InitiatingProcessRemoteIP
| order by TimeGenerated desc;
// Hunt 3: Linux syslog-ingested telemetry for php-fpm/apache spawning interpreters
Syslog
| where TimeGenerated > ago(7d)
| where SyslogMessage has_any ("php-cgi", "php-fpm") and SyslogMessage has_any ("/bin/sh", "/bin/bash", "wget", "curl")
| project TimeGenerated, Computer, ProcessName, SyslogMessage
| order by TimeGenerated desc;
Velociraptor VQL
Use this artifact as a fleet-wide hunt to identify PHP interpreter or web server processes with suspicious child processes or command lines indicative of injected directives:
-- Hunt for PHP/web server processes with injected directives or shell children
SELECT Pid, Ppid, Name, Exe, CommandLine, Username, CreateTime
FROM pslist()
WHERE CommandLine =~ '(?i)(allow_url_include|auto_prepend_file|auto_append_file|-d\s)'
OR (Name =~ '(?i)(php|httpd|apache|nginx|w3wp)'
AND CommandLine =~ '(?i)(cmd\.exe|powershell|/bin/(ba)?sh|curl|wget|nc\s)')
ORDER BY CreateTime DESC
Follow up any hit by collecting the process tree and, on web servers, correlating with access logs around CreateTime to identify the source IP and request that triggered execution.
Verification & Hardening Script
This Bash script audits a Linux host for high-risk PHP deployment characteristics and applies the configuration-level mitigations consistent with the PHP team's guidance — verify against your environment before enforcing:
#!/bin/bash
# PHP unpatched RCE - exposure audit and mitigation
# Run as root. Review output before applying changes.
echo "=== PHP SAPI / Deployment Mode Audit ==="
php -v 2>/dev/null | head -2
# Identify whether PHP-CGI binary is present and reachable
which php-cgi && echo "[!] php-cgi binary present - CGI mode exposure possible"
# Check Apache config for CGI-mode PHP handling
echo ""
echo "=== Apache PHP handler configuration ==="
grep -rEi "(Action|ScriptAlias|AddHandler).*php" /etc/apache2/ /etc/httpd/ 2>/dev/null
echo ""
echo "=== Risky PHP directives in active php.ini files ==="
for ini in $(php --ini 2>/dev/null | grep -i "loaded\|additional" | awk '{print $NF}') /etc/php/*/apache2/php.ini /etc/php/*/fpm/php.ini /etc/php.ini; do
[ -f "$ini" ] && grep -Ei "^(allow_url_include|allow_url_fopen|auto_prepend_file|auto_append_file|cgi.force_redirect)\s*=" "$ini" | sed "s|^|$ini: |"
done
echo ""
echo "=== Applying mitigations ==="
# Mitigation 1: Disable remote file inclusion (defense-in-depth against directive injection)
for ini in /etc/php/*/apache2/php.ini /etc/php/*/fpm/php.ini /etc/php.ini; do
if [ -f "$ini" ]; then
sed -i.bak 's/^\s*allow_url_include\s*=.*/allow_url_include = Off/' "$ini"
sed -i 's/^\s*allow_url_fopen\s*=.*/allow_url_fopen = Off/' "$ini"
echo "[+] Hardened $ini (backup: $ini.bak)"
fi
done
# Mitigation 2: Enforce cgi.force_redirect where CGI mode is in use
for ini in /etc/php/*/cgi/php.ini; do
if [ -f "$ini" ]; then
sed -i.bak 's/^;*\s*cgi.force_redirect\s*=.*/cgi.force_redirect = 1/' "$ini"
echo "[+] Enforced cgi.force_redirect in $ini"
fi
done
# Mitigation 3: Apache mod_rewrite rule to block directive-injection query strings
HTACCESS_RULES='# Block PHP-CGI argument injection attempts
RewriteEngine On
RewriteCond %{QUERY_STRING} ^(%2d|-)[^=]*$ [NC]
RewriteRule .* - [F,L]
RewriteCond %{QUERY_STRING} (allow_url_include|auto_prepend_file|auto_append_file) [NC]
RewriteRule .* - [F,L]'
echo "$HTACCESS_RULES"
echo ""
echo "[!] Add the above RewriteCond/RewriteRule block to your Apache vhost or .htaccess,"
echo " then restart: systemctl restart apache2 (or httpd / php-fpm as applicable)"
echo ""
echo "=== Post-change verification ==="
php -i 2>/dev/null | grep -Ei "allow_url_include|allow_url_fopen|cgi.force_redirect"
echo "Done. Restart web services and validate application functionality."
For Windows/IIS deployments, the equivalent posture check is: confirm PHP is registered via FastCGI (not plain CGI mapping), verify cgi.force_redirect=1 in php.ini, and add a URL Rewrite rule blocking query strings matching (?i)(%2d|allow_url_include|auto_prepend_file) with a 403 response.
Remediation
There is no patch. Your remediation plan is mitigation plus detection plus readiness:
- Determine your SAPI mode immediately. Run
php -vand check your web server handler configuration. If PHP runs via CGI (php-cgi) rather than mod_php, PHP-FPM, or FastCGI with request isolation, treat yourself as exposed until proven otherwise. - Apply the PHP security team's published mitigations verbatim. Pull the official guidance directly from the PHP project's security channels and the BleepingComputer coverage at https://www.bleepingcomputer.com/news/security/php-shares-mitigation-for-new-and-unpatched-rce-vulnerability/ — vendor mitigations for configuration-dependent flaws are precise, and paraphrasing them risks missing a required parameter.
- Migrate off CGI mode where feasible. Moving to PHP-FPM (Linux) or FastCGI (IIS) removes the interpreter-invocation attack surface that this class of vulnerability abuses. This is the most durable fix short of a patch.
- Deploy request filtering at the edge. WAF or reverse-proxy rules blocking PHP CLI-style flags and directive names (
-d,allow_url_include,auto_prepend_file, encoded variants like%2d,%ad) in query strings provide virtual patching while the vendor works on a code fix. - Harden
php.inias defense-in-depth. Setallow_url_include = Off, disableallow_url_fopenwhere application-compatible, enforcecgi.force_redirect = 1on CGI deployments, and usedisable_functionsto neuter common post-exploitation primitives (exec,shell_exec,system,passthru,proc_open,popen). - Drop Egress controls on web servers. Web server service accounts should not be able to initiate arbitrary outbound connections. Egress filtering breaks reverse shells and payload retrieval even if code execution succeeds.
- Deploy the detections above and hunt retroactively. Run the KQL and VQL hunts over at least the past 30 days. A flaw disclosed without a patch may have circulated privately before public disclosure.
- Track CVE assignment and patch release. Subscribe to PHP release announcements and monitor CISA KEV. When a patch lands, treat deployment as emergency change — unauthenticated RCEs in PHP have historically moved from disclosure to mass exploitation in under a week.
- Inventory third-party exposure. Appliances, CMS hosting panels, and vendor containers that embed PHP are frequently CGI-mode under the hood. Open vendor tickets now rather than discovering exposure during incident response.
Related Resources
Security Arsenal Penetration Testing Services AlertMonitor Platform Book a SOC Assessment vulnerability-management Intel Hub
Is your security operations ready?
Get a free SOC assessment or see how AlertMonitor cuts through alert noise with automated triage.