Back to Intelligence

CVE-2026-126714: phpAfterShell and PHP's November Critical RCE Flaws — Detection and Remediation Guide

SA
Security Arsenal Team
November 21, 2026
13 min read

If your organization runs PHP anywhere in its stack — and statistically, it does — the November 2026 PHP security release demands your immediate attention. Researchers at Wiz have disclosed a cluster of critical vulnerabilities in PHP, headlined by CVE-2026-126714, that can enable unauthenticated remote code execution on exposed servers. Worse, the disclosure coincides with observed activity from phpAfterShell, a webshell-style post-exploitation campaign that leverages exactly this class of flaw to establish durable footholds on compromised web infrastructure.

PHP still powers a substantial majority of the world's server-side web applications — WordPress, Drupal, Joomla, countless custom line-of-business applications, and internal tooling. An unauthenticated RCE in the interpreter or its core extensions is not a niche problem; it is a perimeter-collapse event for any organization with an internet-facing PHP application. In this post, we break down the vulnerability class, the phpAfterShell tradecraft we've seen in the wild, and the specific detection, hunting, and remediation steps your SOC and infrastructure teams should execute now.

What Happened

PHP's November 2026 security release addressed multiple critical-severity vulnerabilities, including CVE-2026-126714, which can be triggered remotely without authentication under commonly deployed configurations. Wiz's research team connected the patched flaws to active exploitation patterns they observed across cloud environments, which they have dubbed phpAfterShell — a reference to the predictable post-exploitation pattern: exploit the PHP flaw, drop a webshell, and operate through the web server's own process context.

The attack chain follows a familiar but devastatingly effective pattern:

  1. Initial access: The attacker sends crafted HTTP requests to an internet-facing PHP application, triggering the vulnerable code path in the PHP interpreter or a bundled extension. Because no authentication is required, any exposed endpoint backed by the vulnerable component is a candidate.
  2. Code execution in the web server context: Successful exploitation yields command execution as the PHP worker user — typically www-data, apache, or nginx on Linux, or the IIS AppPool identity on Windows.
  3. Webshell deployment: The attacker writes a PHP webshell (the "AfterShell") into the web root — commonly disguised with innocuous filenames like cache.php, wp-options.php, or style.php buried deep in upload or cache directories.
  4. Persistence and pivoting: From the webshell, operators enumerate the host, harvest credentials and configuration files (wp-config.php, .env, database connection strings), and attempt lateral movement or privilege escalation.

Technical Analysis

Affected Products and Versions

The vulnerabilities affect the PHP interpreter across its supported release branches. Per the November 2026 release, organizations running any PHP build prior to the November patch level on the 8.x branches should assume they are vulnerable. In practice, this means:

  • PHP 8.1, 8.2, 8.3, and 8.4 branches prior to the November 2026 security builds
  • Deployments running PHP-FPM, mod_php (Apache), and PHP-CGI are all potentially in scope depending on the specific code path; CGI-based deployments historically carry the highest exposure to unauthenticated argument-injection and request-smuggling style bugs
  • End-of-life branches (PHP 7.x and anything older) receive no fix and must be treated as permanently vulnerable

Platforms of concern include any internet-facing Linux web servers (Ubuntu, Debian, RHEL, Amazon Linux), containerized PHP workloads (official php:* images rebuilt before the patch date), managed WordPress hosting, and Windows/IIS deployments using PHP via FastCGI.

How the Exploitation Works (Defender's View)

From a blue team perspective, the critical detail is the exploitation primitive: unauthenticated request → code execution in the PHP worker process. This means your strongest telemetry sources are:

  • Web server and PHP-FPM logs — look for anomalous request patterns, abnormally long or encoded query strings, and requests to endpoints that don't normally receive traffic
  • Process lineage — the single highest-fidelity signal. A healthy PHP-FPM worker or Apache/IIS worker process almost never spawns sh, bash, curl, wget, python, or writes executable content to the web root. When it does, you have your answer
  • File system artifacts — new or modified .php files in web-accessible directories, especially in upload, cache, tmp, or image directories, with timestamps that don't correlate to a deployment

phpAfterShell Tradecraft

The phpAfterShell pattern, as documented by Wiz, emphasizes living off the web root: attackers write minimal PHP shells that accept commands via crafted POST parameters or cookies, often obfuscated with base64_decode, gzinflate, eval, or assert chains. Because these payloads execute inside the legitimate PHP process, they bypass most network-layer controls entirely — there is no suspicious binary, no new service, and often no new listening port. Your EDR will see nothing unless you are watching process lineage and file integrity.

Post-shell behavior we've consistently observed in IR engagements of this type includes:

  • Reading application configuration files to extract database credentials
  • Using the web shell to download second-stage tooling via curl/wget spawned from the web server process
  • Establishing reverse shells for interactive access
  • Enumerating cloud instance metadata endpoints (169.254.169.254) to harvest IAM credentials in cloud-hosted deployments

Exploitation Status

This is not theoretical. Wiz's disclosure ties the November PHP vulnerabilities to observed in-the-wild exploitation patterns via the phpAfterShell campaign. Treat internet-facing PHP deployments as actively targeted. Defenders should verify current CISA KEV status for CVE-2026-126714 and operate under the assumption that a working exploit path exists and is being operationalized.

Detection & Response

The detections below target the two most reliable observables in this attack class: (1) web server worker processes spawning shells or download tools, and (2) webshell file artifacts and their characteristic code patterns. Tune the path and process lists to your environment before deployment.

Sigma Rules

YAML
---
title: PHP Web Server Process Spawning Shell or Download Utility
id: 3f8a1c92-6b4d-4e7a-9c21-8d5e2f1a6b90
status: experimental
description: Detects PHP-FPM, Apache, Nginx, or PHP-CGI worker processes spawning shells, interpreters, or download utilities — a high-fidelity indicator of PHP RCE exploitation consistent with CVE-2026-126714 and phpAfterShell activity.
references:
  - https://www.wiz.io/blog/phpaftershell-critical-php-rce-vulnerabilities-cve-2026-126714
  - https://attack.mitre.org/techniques/T1190/
author: Security Arsenal
date: 2026/04/06
tags:
  - attack.initial_access
  - attack.t1190
  - attack.execution
logsource:
  category: process_creation
  product: linux
detection:
  selection_parent:
    ParentImage|endswith:
      - '/php-fpm'
      - '/php-fpm8.1'
      - '/php-fpm8.2'
      - '/php-fpm8.3'
      - '/php-fpm8.4'
      - '/php-cgi'
      - '/httpd'
      - '/apache2'
      - '/nginx'
  selection_child:
    Image|endswith:
      - '/sh'
      - '/bash'
      - '/dash'
      - '/zsh'
      - '/curl'
      - '/wget'
      - '/python'
      - '/python3'
      - '/perl'
      - '/nc'
      - '/ncat'
      - '/netcat'
  condition: selection_parent and selection_child
falsepositives:
  - Legitimate application functionality invoking system commands (e.g., image processing, backup scripts)
  - Health check or monitoring agents with atypical design
level: high
---
title: Webshell File Creation in Web-Accessible Directories
id: 9c2e4f71-1a83-4b6d-8e45-2c7d9a3f5b12
status: experimental
description: Detects creation of PHP files in upload, cache, tmp, or image directories commonly abused for webshell placement in phpAfterShell-style intrusions.
references:
  - https://www.wiz.io/blog/phpaftershell-critical-php-rce-vulnerabilities-cve-2026-126714
  - https://attack.mitre.org/techniques/T1505/003/
author: Security Arsenal
date: 2026/04/06
tags:
  - attack.persistence
  - attack.t1505.003
logsource:
  category: file_event
  product: linux
detection:
  selection_path:
    TargetFilename|contains:
      - '/uploads/'
      - '/upload/'
      - '/wp-content/uploads/'
      - '/cache/'
      - '/tmp/'
      - '/images/'
      - '/assets/'
      - '/files/'
  selection_ext:
    TargetFilename|endswith:
      - '.php'
      - '.phtml'
      - '.phar'
      - '.php5'
      - '.php7'
  condition: selection_path and selection_ext
falsepositives:
  - Legitimate CMS plugin or media upload workflows that generate PHP index files
  - Application build and deployment pipelines
level: medium
---
title: Windows Web Server Worker Spawning Command Shell
id: 5b1d8e63-7f29-4c4a-b3d8-6e1a9f2c4d07
status: experimental
description: Detects IIS worker processes or PHP CGI on Windows spawning cmd.exe, PowerShell, or certutil — consistent with post-exploitation following PHP RCE exploitation.
references:
  - https://www.wiz.io/blog/phpaftershell-critical-php-rce-vulnerabilities-cve-2026-126714
  - https://attack.mitre.org/techniques/T1059/
author: Security Arsenal
date: 2026/04/06
tags:
  - attack.execution
  - attack.t1059
  - attack.t1190
logsource:
  category: process_creation
  product: windows
detection:
  selection_parent:
    ParentImage|endswith:
      - '\w3wp.exe'
      - '\php-cgi.exe'
      - '\httpd.exe'
  selection_child:
    Image|endswith:
      - '\cmd.exe'
      - '\powershell.exe'
      - '\pwsh.exe'
      - '\certutil.exe'
      - '\bitsadmin.exe'
      - '\curl.exe'
  condition: selection_parent and selection_child
falsepositives:
  - Legitimate application plugins invoking system commands
  - Administrative maintenance on IIS-hosted PHP applications
level: high

KQL — Microsoft Sentinel / Defender

The first query hunts the process-lineage signal via Defender for Endpoint. The second hunts Syslog-ingested Linux telemetry for web server processes spawning suspicious children — critical for environments where PHP-FPM hosts forward logs to Sentinel rather than running MDE.

KQL — Microsoft Sentinel / Defender
// Hunt 1: Web server worker processes spawning shells or download tools (MDE)
let WebServerProcs = dynamic(["w3wp.exe", "php-cgi.exe", "httpd.exe", "httpd", "apache2", "nginx", "php-fpm", "php-fpm8.1", "php-fpm8.2", "php-fpm8.3", "php-fpm8.4", "php-cgi"]);
let SuspiciousChildren = dynamic(["cmd.exe", "powershell.exe", "pwsh.exe", "certutil.exe", "bitsadmin.exe", "curl.exe", "sh", "bash", "dash", "zsh", "curl", "wget", "python", "python3", "perl", "nc", "ncat", "netcat", "base64"]);
DeviceProcessEvents
| where TimeGenerated > ago(7d)
| where InitiatingProcessFileName has_any (WebServerProcs)
| where FileName has_any (SuspiciousChildren)
| project TimeGenerated, DeviceName, InitiatingProcessFileName, InitiatingProcessCommandLine, FileName, ProcessCommandLine, AccountName, InitiatingProcessRemoteIP
| order by TimeGenerated desc;
// Hunt 2: Syslog-ingested Linux hosts — PHP-FPM/Apache child process anomalies
Syslog
| where TimeGenerated > ago(7d)
| where ProcessName in~ ("php-fpm", "apache2", "httpd", "nginx")
    or SyslogMessage has_any ("php-fpm", "www-data")
| where SyslogMessage has_any ("/bin/sh", "/bin/bash", "curl ", "wget ", "python", "nc -", "base64 -d", "eval(")
| project TimeGenerated, Computer, ProcessName, SyslogMessage
| order by TimeGenerated desc;
// Hunt 3: Webshell artifact hunt — suspicious PHP file writes in web roots (MDE)
DeviceFileEvents
| where TimeGenerated > ago(7d)
| where FolderPath has_any ("\\uploads\\", "\\upload\\", "\\cache\\", "\\images\\", "\\inetpub\\wwwroot\\", "\\wp-content\\")
| where FileName endswith ".php" or FileName endswith ".phtml" or FileName endswith ".phar"
| where ActionType == "FileCreated" or ActionType == "FileModified"
| project TimeGenerated, DeviceName, FolderPath, FileName, InitiatingProcessFileName, InitiatingProcessCommandLine
| order by TimeGenerated desc

Velociraptor VQL

Use this artifact for live-response triage across your Linux web server fleet. It identifies suspicious child processes of web server workers and enumerates recently created PHP files in high-risk directories — the two artifacts that most reliably surface a phpAfterShell intrusion.

VQL — Velociraptor
-- phpAfterShell Triage: suspicious web-server child processes and webshell artifacts
-- Part 1: Process lineage check
SELECT Pid, Ppid, Name, Exe, CommandLine, Username, CreateTime
FROM pslist()
WHERE CommandLine =~ '(?i)(/bin/(ba)?sh|curl |wget |nc -|python|perl)'
  AND Username =~ '(?i)(www-data|apache|nginx|nobody)'

-- Part 2: Recently modified PHP files in web-accessible upload/cache paths
SELECT FullPath, Size, Mtime, Ctime, Mode
FROM glob(globs=[
  '/var/www/**/uploads/*.php',
  '/var/www/**/upload/*.php',
  '/var/www/**/cache/*.php',
  '/var/www/**/images/*.php',
  '/var/www/**/wp-content/uploads/*.php',
  '/srv/www/**/uploads/*.php',
  '/tmp/*.php',
  '/dev/shm/*.php'
])
WHERE Mtime > (now() - 604800)
ORDER BY Mtime DESC

-- Part 3: Established outbound connections from web server processes (reverse shell hunt)
SELECT Pid, Name, RemoteIP, RemotePort, Status
FROM netstat()
WHERE Name =~ '(?i)(php-fpm|apache2?|httpd|nginx|sh|bash)'
  AND Status =~ 'ESTABLISHED'
  AND NOT RemoteIP =~ '^(10\\.|192\\.168\\.|172\\.(1[6-9]|2[0-9]|3[01])\\.|127\\.)'

Remediation and Verification Script

Run the following on Linux PHP hosts to inventory your PHP version, identify exposure, and perform an initial compromise sweep. This does not replace patching — it verifies version posture and hunts for webshell artifacts while you stage updates.

Bash / Shell
#!/bin/bash
# phpAfterShell / CVE-2026-126714 exposure and triage script
# Run as root on each PHP host

echo "=== [1] PHP Version Inventory ==="
php -v 2>/dev/null | head -n 3
php-fpm -v 2>/dev/null | head -n 3 || php-fpm8.3 -v 2>/dev/null | head -n 3
dpkg -l 2>/dev/null | grep -E 'php[0-9.]*-(fpm|cgi|cli|common)' || rpm -qa 2>/dev/null | grep php

echo "=== [2] Active PHP-FPM / CGI services ==="
systemctl list-units --type=service --state=running | grep -iE 'php|apache|nginx|httpd'

echo "=== [3] Suspicious child processes of web server workers ==="
for pid in $(pgrep -f 'php-fpm|apache2|httpd|nginx'); do
  children=$(ps --ppid "$pid" -o pid,comm,args --no-headers 2>/dev/null | grep -E 'sh|bash|curl|wget|python|perl|nc ')
  [ -n "$children" ] && echo "[!] Parent PID $pid spawning: $children"
done

echo "=== [4] Webshell sweep: PHP files in high-risk dirs modified in last 14 days ==="
find /var/www /srv/www /home/*/public_html /tmp /dev/shm \
  -type f \( -name '*.php' -o -name '*.phtml' -o -name '*.phar' \) \
  -mtime -14 2>/dev/null | grep -iE 'upload|cache|images|tmp|shm|assets|files' | head -n 50

echo "=== [5] Known webshell code pattern grep ==="
grep -rEl --include='*.php' \
  'eval\s*\(\s*(base64_decode|gzinflate|str_rot13)|assert\s*\(\s*\$_(POST|GET|REQUEST|COOKIE)|shell_exec\s*\(\s*\$_' \
  /var/www /srv/www /home/*/public_html 2>/dev/null | head -n 50

echo "=== [6] Outbound connections from web server processes ==="
ss -tnp 2>/dev/null | grep -E 'php-fpm|apache|httpd|nginx' | grep -v '10\.|192\.168\.|172\.1[6-9]\.|172\.2[0-9]\.|172\.3[01]\.|127\.'

echo "=== [7] Recent PHP-FPM error/access log anomalies ==="
journalctl -u 'php*-fpm*' --since '7 days ago' 2>/dev/null | grep -iE 'error|warning|unable' | tail -n 30
echo "=== Triage complete. Review flagged items before remediation. ==="

Remediation

1. Patch immediately. Upgrade all PHP installations to the November 2026 security release for your branch (8.1/8.2/8.3/8.4 point releases published in the November 2026 security announcement). Pull updated packages from your distribution's official repositories or rebuild container images from the refreshed official php:* base images. Do not forget:

  • Container images built before the patch date remain vulnerable even if the host is patched — rebuild and redeploy all PHP containers
  • Third-party appliances and managed platforms that bundle PHP must be verified with the vendor
  • Any system running end-of-life PHP (7.x or older) cannot be patched and must be upgraded to a supported branch or isolated

2. Verify the patch landed. After upgrading, confirm the running interpreter version matches the patched build (php -v, php-fpm -v) and restart all PHP-FPM pools, Apache, and Nginx so no stale worker processes retain the vulnerable code in memory. A package upgrade without a service restart leaves you exposed.

3. Hunt before you patch — and after. If the host was internet-facing and unpatched during the disclosure window, assume attempted exploitation. Run the detection content above, review web server access logs for anomalous request volumes or encoded payloads against PHP endpoints, and check for webshell artifacts and unexpected outbound connections from web server users. Patching closes the door; it does not evict an attacker already inside.

4. Reduce the attack surface:

  • Disable dangerous PHP functions in php.ini where the application allows: disable_functions = exec,passthru,shell_exec,system,proc_open,popen,curl_exec,parse_ini_file,show_source
  • Set expose_php = Off and allow_url_include = Off
  • Enforce open_basedir restrictions per vhost to contain webshell traversal
  • Configure the web server to deny execution of PHP in upload, cache, and image directories — this single control neutralizes the majority of webshell placements
  • Run PHP-FPM pools under dedicated, least-privilege users with read-only web root mounts wherever feasible
  • Block outbound egress from web server subnets to the internet except to explicitly required destinations — this breaks reverse shells and second-stage downloads

5. Network-layer mitigations (interim). If patching must be staged, place a WAF in front of exposed PHP applications with virtual-patching rules targeting the request patterns documented in the Wiz research. Restrict administrative and CGI endpoints by source IP. Note that WAF rules are a compensating control, not a fix — CVE-2026-126714-class interpreter flaws frequently have request-shape variants that evade signature-based filtering.

6. Credential rotation. If triage reveals any evidence of compromise, treat all secrets reachable from the web tier as burned: database credentials in wp-config.php and .env files, API keys, and — in cloud environments — any IAM credentials retrievable from instance metadata. Rotate them as part of the IR, not after.

7. Track CISA KEV. Monitor the CISA Known Exploited Vulnerabilities catalog for CVE-2026-126714. KEV listing triggers binding remediation deadlines for federal civilian agencies and should be treated as a de facto SLA by private-sector vulnerability management programs.

Bottom Line

Unauthenticated RCE in PHP is a perimeter event, and the phpAfterShell campaign demonstrates that adversaries are converting these flaws into durable access faster than most patch cycles run. The defensive playbook is straightforward but unforgiving: patch every PHP build including containers, hunt for webshell artifacts and process-lineage anomalies on anything that was exposed during the window, and harden the interpreter so the next bug in this class lands on a smaller blast radius. If your team lacks the telemetry coverage to run the hunts above — particularly process lineage on Linux web servers — that visibility gap is itself a finding worth escalating.

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.