Runtime Incident Classification: Turning a Noisy Alert List Into a Triage Decision
Here is a scene every security team knows. A reverse shell opens a connection to...
Oct 22, 2026
On October 21, 2026, the PHP project shipped emergency releases for two critical memory-safety bugs in the PHP core itself: CVE-2026-109618 and CVE-2026-109619, collectively nicknamed PHP2Shell. Both are rated CVSS 9.2. Both are reachable before any application code runs, which means a “Hello World” PHP page is as exposed as a full WordPress install. And both were being probed in the wild before the fix was public.
We have been living with this one for a little over a day now, and we wanted to write down what we have seen across our customer base and what we think every security team running PHP should do this week. We will keep the exploit internals short, because the researchers who found the bugs have already written them up better than we could, and we will spend most of this post on the three questions we are actually being asked: am I exposed, how would I know if someone got in, and what do I do about it.
A note on what we saw first. ARMO’s runtime platform flagged the post-exploitation behavior of PHP2Shell before we had written a single rule with the CVE number in it. Our anomaly detection engine baselines what each workload does, and a PHP worker that suddenly starts a shell is not in anyone’s baseline. ART (ARMO Research team, our A-Team 🙂 ) have since added two direct detection rules, which we describe below, and we have observed exploitation attempts against several customers. Those customers have been notified.
- What it is. Two bugs in the PHP interpreter (php-src), not in a framework or plugin. A crafted multipart request drives PHP out of memory or into a fatal error during request start-up. On the OOM path, PHP aborts with partially initialized request memory still reachable (CVE-2026-109618). On the stale-state path, request-owned globals survive into the next request handled by the same worker process (CVE-2026-109619). Either way, the outcome is heap corruption inside a long-lived worker, which researchers have turned into memory disclosure and pre-auth remote code execution as the web user.
- Who is affected. Officially, every PHP release below 8.2.35, 8.3.36, 8.4.27 and 8.5.12. Researchers have traced the vulnerable code back to PHP 5.4. Apache with mod_php is the highest-risk deployment. FrankenPHP is likely exposed for the same reason. PHP-FPM is exposed in an application-dependent way.
- Exploitation status. Amazon’s honeypots logged the first attempt four days before disclosure. Cloudflare, watchTowr, Hadrian and ELLIO all reported attempts within hours of the advisory. ARMO has observed attempts against production workloads of several customers. Public proof-of-concept code is plentiful but mostly wrong; successful exploitation on x86-64 still requires a brute-force phase that is noisy and detectable.
- What to do. Patch to the fixed versions. Use your SBOM and vulnerability scanner to find every image that ships a vulnerable PHP, including the ones that do not say “php” in their name. Turn on runtime detection for the one behavior that every variant of this exploit shares: a PHP worker spawning a process it has no reason to spawn.
PHP runs each web request inside a long-lived worker process: an Apache prefork child with mod_php, a php-fpm pool child, or a FrankenPHP thread. The worker is supposed to reset all per-request state between requests. PHP2Shell is a pair of bugs in that reset. An attacker sends a multipart form upload shaped to exhaust memory at a precise moment during request parsing, typically by abusing PHP’s session upload progress feature, which runs during body parsing even if the application never starts a session. The worker bails out, leaves stale or freed memory behind, and the next request on that same worker consumes it. Wiz chained a memory-disclosure primitive (freed heap leaking out through the PHPSESSID cookie) with a use-after-free to get pre-auth code execution against stock wordpress:latest, drupal:latest and joomla:latest images. The code runs inside the worker, as the web user. There is no uploaded webshell and no suspicious command line on the PHP process itself. The first thing a defender can observe on the host is whatever the payload does next, and in practice that is execve(“/bin/sh”).
If you want the full mechanics, these are the sources we trust:
- The php-src advisories: GHSA-w8hw-w9fx-j79w (OOM corruption) and GHSA-6wmf-4rv5-p3rp (stale global state), plus the PHP security team’s oss-security post.
- Wiz’s technical write-up, PHP2Shell: Pre-auth RCE in PHP, which has the exploitation chain and the SAPI-by-SAPI analysis.
- Amazon Threat Intelligence on pre-disclosure exploitation seen in MadPot, including the source IPs they observed.
- Elastic Security Labs on detecting PHP2Shell post-exploitation.
- Abstract Security’s network and log signatures.
Two things worth knowing before you read them. First, the vendors do not agree on which primitive belongs to which CVE number, so do not build anything that depends on CVE attribution. Second, this is not the php-cgi argument-injection class of bug (CVE-2024-4577, CVE-2012-1823). Detection rules written for those will not fire here.
| Deployment | Exposure | Notes |
|---|---|---|
| Apache + mod_php (libphp*.so) | Highest | Shutdown runs even after start-up fails. Exploitation is entirely pre-application. |
| FrankenPHP | High | Same lifecycle shape as mod_php. |
| PHP-FPM behind nginx or Apache | Medium, application-dependent | The stale-state path has been validated on a normal dynamic FPM pool. Frontends that pass PHP_VALUE increase exposure. |
| LiteSpeed / lsphp (LSAPI) | Conditional | Depends on configuration. |
| PHP CLI, cron jobs, workers that do not serve HTTP | Not a network surface | Patch anyway; the binary is the same. |
| Any PHP 8.1 or older without a distro backport | Exposed | No upstream fix. Ubuntu, RHEL, Arch and AlmaLinux have shipped backports; check your vendor. |
Fixed versions: 8.2.35, 8.3.36, 8.4.27, 8.5.12.
There is no complete configuration-only mitigation. PHP’s own advisory says so. Disabling session.upload_progress, turning off fatal_error_backtraces on 8.5, and lowering post_max_size all reduce the attack surface and are worth doing while you patch. They do not close it.
This is where most of the real work is, and it is where we have seen teams underestimate the job.
The problem is not your PHP images. It is the images you did not know contained PHP. The php:8.3-apache image on your e-commerce frontend is easy. The monitoring dashboard a vendor shipped as a Docker image in 2023, the internal wiki, the legacy admin panel that runs on a debian:bullseye base with apt install php-fpm buried in a Dockerfile layer, the third-party Helm chart whose sidecar happens to be a PHP app: those are the ones that get exploited, because nobody is looking at them.
What a good answer looks like. You want a list of every running workload, in every cluster, that contains a PHP binary below the fixed versions, with the SAPI it uses (mod_php, FPM, FrankenPHP) and whether it is reachable from the internet. That is a software bill of materials question joined with a runtime question, and this is exactly why we keep telling people that SBOMs are not a compliance artifact.
In ARMO, this works as follows:
- SBOM every image in the cluster, not just the ones in the registry. Kubescape generates an SBOM for every image it sees running and keeps it current. The PHP package shows up whether it came from the official image, a distro package, or a COPY of a prebuilt binary.
- Match the SBOM against the CVE. CVE-2026-109618 and CVE-2026-109619 are matched against the PHP package version in every SBOM. Distro backports are handled by the distro security feeds, so a RHEL image with php-8.2.34-1.el9_7 that carries the fix is not flagged as vulnerable just because the upstream version string looks old.
- Filter by what matters. The vulnerability view lets you narrow the list to images where the vulnerable package is actually loaded in a running process (relevancy), and to workloads that are exposed to the internet through a Service, Ingress or Gateway. A vulnerable PHP in an internal batch job is a ticket. A vulnerable mod_php behind a public Ingress is an incident waiting to happen.
- Hand the list to the owners. Every finding is tied to a workload, a namespace and an image, so the remediation ticket goes to the team that owns the Dockerfile, not to a platform team with a spreadsheet.
If you are not an ARMO customer, the same workflow is possible with open-source Kubescape and any SBOM tool, it just takes more glue. The point is the same: do not grep Dockerfiles. Scan what is actually running.
A manual check for one container, if you need it right now:
php -v
php -r ‘echo PHP_VERSION;’
# official Docker images
echo $PHP_VERSION
# which SAPI
ls /usr/lib/apache2/modules/libphp*.so /usr/lib*/httpd/modules/libphp*.so 2>/dev/null
ps -o comm= -C php-fpm,php-fpm8.3,frankenphp,lsphp
# risk-increasing settings (use the web SAPI’s ini, not the CLI’s)
php -i | grep -E ‘session.upload_progress.enabled|memory_limit|post_max_size|fatal_error_backtraces’
How You Would Know Someone Got In
The uncomfortable truth about PHP2Shell is that a successful exploit leaves almost nothing on the wire that a WAF can reliably catch, and nothing on disk until the attacker decides to write something. The request is a form upload. The response, if the exploit worked, is a normal 200. The PHP process has the same command line it always had.
What the exploit cannot hide is behavior. Three layers, from weakest to strongest:
1. The brute-force phase is loud. Successful exploitation on x86-64 needs to defeat ASLR, which means hundreds of oversized multipart requests over a few minutes, each one crashing a worker. Your PHP-FPM master log fills with child N exited on signal 11. Apache logs AH00052. The PHP error log shows Allowed memory size of N bytes exhausted … in Unknown on line 0, which is an OOM outside script execution and is very rare in normal operation. Fastly put it well: a handful of isolated segfaults are not unusual, dozens within minutes are. If you ship web server logs to a SIEM, a burst of worker crashes per pod is a cheap and version-agnostic alert.
2. The request has a shape. The public exploits reach the vulnerable code through PHP’s session upload progress feature, which means a multipart body containing a form field named PHP_SESSION_UPLOAD_PROGRESS. Amazon, Hadrian and Abstract all point at this field. Variants seen in the wild also use a PHPSESSID form field, a PHP open tag or a serialized PHP object in an upload’s filename, and urlencoded bodies with a field name of a thousand characters or more. None of these is proof of exploitation, and scanners are sending them by the million, but any of them against a workload that does not use upload progress bars deserves a look. This is useful enrichment, not a primary signal.
3. A PHP worker started a process. This is the one that matters. A request-serving PHP process is a long-lived handler that, in the overwhelming majority of deployments, never calls execve. When it does legitimately (sendmail from mail(), ImageMagick’s convert, wp-cron), it always goes through /bin/sh -c \, and the set of known commands for a given workload is small and stable. A PHP worker spawning a bare shell, a shell with -i, curl | sh, base64 -d, a /dev/tcp/ reverse shell, or id; uname -a is not application code. It is the moment of compromise, regardless of which CVE, which SAPI, or which PoC the attacker used.
Every serious detection vendor converged on the same signal within a day. Elastic’s “Payload Execution by Web Server”, Abstract’s Linux shell rule, the Sigma and Falco rules in the community repos: all of them key on parent process in the PHP worker set, child process in the shell-and-tools set.
We want to be honest about the order in which things happened, because it illustrates why we built the product the way we did.
Anomaly detection caught it first. ARMO’s runtime engine learns an application profile for every workload: the processes it executes, the files it opens, the network destinations it talks to, the syscalls it makes. A PHP pod, after its learning period, has a profile that says “this container runs php-fpm and occasionally sendmail, and nothing else.” When an exploit made a worker spawn /bin/sh, that was an unexpected process execution against the profile, and it raised an incident with no PHP2Shell-specific logic involved. This is the behavioral approach we have argued for since day one: the attacker’s technique changes, the fact that a web worker should not be running shells does not.
We then added direct detection, for two reasons. First, profile-based anomaly detection depends on having a learned baseline. A pod that was deployed yesterday, or one whose baseline happened to be learned while an attacker was already inside, has a weaker profile. Second, when a CISO asks “do we have coverage for PHP2Shell,” the answer should be a named rule, not an explanation of how profiling works. So we shipped two rules, both now in the default managed ruleset for every customer:
- PHP Worker Spawned Shell or Attack Tool (PHP2Shell Post-Exploitation), severity Critical. Fires when a process whose parent is php-fpm, php-cgi, lsphp, frankenphp, apache2 or httpd executes a shell started without -c (which PHP’s exec family never produces), a sh -c command carrying a reverse-shell, download-and-run, decode or recon token, or a direct child that is a downloader, netcat, interpreter one-liner, base64, chmod or a recon binary. It does not consult the application profile, so it fires on a brand-new pod and on a pod whose baseline is already poisoned. nginx is deliberately absent from the parent list, because nginx does not run PHP; its php-fpm sibling does.
- Potential PHP2Shell Exploitation Attempt, severity Low. Fires on inbound HTTP carrying the exploit’s fingerprint: a multipart body with a PHP_SESSION_UPLOAD_PROGRESS or PHPSESSID field, a PHP open tag or serialized object in an upload filename, or a urlencoded field name of a thousand characters or more. The name is deliberate. This is an attempt signal, it will fire on scanners, and it is there so that when the Critical rule fires you can look back and see the attempts that preceded it.
Seeing the payload, not just the aftermath. The second rule is possible because the ARMO sensor does not stop at the syscall boundary. It reconstructs the application layer of the pod’s network traffic, HTTP requests included, as they arrive at the workload. That deep application-layer introspection is what lets us flag the exploit payload itself, the malformed multipart body with the session upload progress field, at the moment it hits the PHP worker, rather than waiting for the consequences of a successful exploit to show up as a process or a file. Most runtime tools can only tell you that a shell was spawned. We can also tell you which request did it, and show you the attempts that failed before the one that worked.
Both layers, the anomaly engine and the explicit rules, sit on the same eBPF sensor and the same incident pipeline, so an attempt, a crash burst and a spawned shell on the same workload land in one incident with the process tree, the request and the network connections attached. For customers who have enabled response, the Critical rule can be paired with an automatic kill of the spawned process.
What we have seen so far. Across our customer base we have observed PHP2Shell exploitation attempts against production workloads at several customers since October 21. The affected customers have been notified with the workloads, the source addresses and the requests involved. We are not publishing attribution or indicators beyond what the vendors above have already released, because at this point the scanning volume dwarfs the number of actors with a working exploit, and a list of scanner IPs is not useful to anyone.
In priority order:
- Patch. 8.2.35, 8.3.36, 8.4.27, 8.5.12, or your distribution’s backport. Rebuild images rather than patching running containers. Use the SBOM workflow above to make sure you got all of them, then re-scan to confirm the fixed version is what is actually running.
- Reduce the surface while you patch. Set session.upload_progress.enabled=0 unless the application needs it. On PHP 8.5, set fatal_error_backtraces=0. Lower post_max_size and max_file_uploads to what the application uses. Prefer PHP-FPM over mod_php, and set pm.max_requests so workers recycle. Do not use RLIMIT_AS or RLIMIT_DATA as a memory cap; they trigger the vulnerable path.
- Block the obvious at the edge. If you have a WAF, enable the vendor’s PHP2Shell rules. Cloudflare, AWS WAF, Check Point and others shipped them on day one. If your applications do not use PHP’s upload progress feature, dropping multipart requests that carry PHP_SESSION_UPLOAD_PROGRESS costs you nothing. Treat this as noise reduction, not as the fix: the WAF sees a form upload, and form uploads are legitimate traffic.
- Harden the pod so a successful exploit goes nowhere. readOnlyRootFilesystem: true with explicit writable volumes means the payload cannot drop a webshell into the docroot. A NetworkPolicy that limits egress from web pods to the database, the cache and the handful of APIs they call turns a reverse shell into a connection timeout. Running the worker as a non-root user with no capabilities limits what the shell can do when it does start. Kubescape’s posture controls flag every one of these on every workload, and they are cheap.
- Detect the behavior, not the CVE. Every PHP workload you run should have a baseline, and every deviation from it should be an incident. PHP2Shell is the current reason. The next PHP core bug, or the next WordPress plugin RCE, or the next deserialization gadget in a framework, will produce exactly the same first observable: a worker spawning a process. Build for that.
There is a certain irony in a bug class this old (PHP has been calling longjmp() on out-of-memory since the Zend engine was written) producing a vulnerability this severe in 2026. Memory-unsafe runtimes carry this risk forever, and the fix in php-src, which replaces the bailout with a proper unwind, is the kind of structural change that should have happened long ago.
But the lesson for defenders is not about PHP. It is that the exploit was visible from the moment it succeeded, to anyone watching what the process did instead of what the request looked like. The teams that found out first were not the ones with the best WAF signatures. They were the ones who knew what their PHP workers were supposed to do, and noticed when one of them did something else.
A developer clones a repository and opens it in VS Code at 10:47 a.m. Before...
A missing null check in libssh’s SFTP directory listing code lets a malicious server crash...
Get the information you need directly from our experts!
×