01 What Happened
On 21 October 2026 the PHP project shipped emergency releases for two vulnerabilities collectively named PHP2Shell: CVE-2026-109618 and CVE-2026-109619. Both are rated 9.2 on CVSS v4.0. Both sit in the PHP engine itself rather than in any library, framework or application.
The practical consequence is that an unauthenticated HTTP request can reach the flawed code. PHP validated unauthenticated remote code execution against Apache with mod_php, where the request is handled in-process and the flaw fires before application code runs. The second flaw lists memory disclosure as a confirmed impact even where execution is not achieved.
The exposure is unusually wide. PHP accounts for roughly 69.3% of websites whose server-side language is known, per W3Techs. Independent estimates put over 1.3 million internet-exposed hosts in the potentially-vulnerable range, against a Shodan count of more than 1.9 million exposed hosts running PHP at all.
mod_php, php-cgi, FrankenPHP, LiteSpeed, containers, CI runners, and the forgotten internal tool nobody has redeployed since 2023.02 Timeline
03 The Two Bugs
This one is a cleanup failure. While PHP is still assembling the incoming request data, it exhausts its allowed memory. Out-of-memory handling interrupts the process mid-initialisation, and the cleanup routine that runs next treats that half-constructed state as valid and operates on it.
The trigger demonstrated in testing is mundane: a single unauthenticated POST carrying one enormous form field name — around 3.5 MB. No credentials, no session, no application interaction.
The second is a use-after-free. A worker retains references to request memory after that memory has been released. A subsequent request handled by the same worker process can then reach the stale state, and an attacker able to influence what occupies that memory can control its contents.
Session Upload Progress — governed by session.upload_progress.enabled, which is on by default — is one confirmed route to this flaw. It is explicitly not the only one, which matters a great deal when we get to mitigations.
pm.max_requests=1 disrupts it.04 Not All Setups Are Equally Exposed
Every PHP installation serving web requests is affected, but the demonstrated impact differs by SAPI. This distinction is useful for prioritising a patch queue — it is not a reason to leave anything unpatched.
| Configuration | Demonstrated position |
|---|---|
Apache + mod_php | Highest risk. PHP validated unauthenticated RCE for CVE-2026-109618 before application code runs, and session-lifecycle RCE for CVE-2026-109619. Patch these first. |
| PHP-FPM | For CVE-2026-109618, FPM blocks the specific startup-failure sequence, but is still considered susceptible under other conditions — no complete FPM exploit has been publicly demonstrated. For CVE-2026-109619, PHP validated RCE against FPM; that path needs a suitable application operation, a fatal error, and a later request reaching the same worker. |
php-cgi, FrankenPHP, LiteSpeed | Named by PHP as at risk. Less publicly characterised than the two above, which is a reason for caution rather than comfort. |
In every case code executes with the privileges of the web worker. Whatever that account can read — database credentials, API keys, session stores, mounted secrets — is in scope from the first successful request.
05 Why Hardening Fails Here
The 9.2 rating is the least interesting number in this advisory. What makes PHP2Shell worth studying is position in the stack.
Most of what we build to defend an application runs inside the application: authentication middleware, session validation, CSRF tokens, input sanitisation, role checks, rate limiting on sensitive routes. All of it is reached only after PHP has parsed the request and handed control to your code.
These flaws fire before that handoff. The controls are not bypassed or defeated by anything clever — they are simply never reached. A meticulously audited application with exemplary input validation sits in exactly the same position as an abandoned one.
This inverts normal triage. The usual first question — are we actually using the vulnerable feature? — has no useful answer. If the host parses HTTP requests with an affected PHP build, it is exposed. That makes asset inventory, not patch analysis, the capability under test.
06 The Disclosure Broke Down
Coordinated disclosure exists to give defenders a patch before attackers get a target. Here the sequencing failed twice.
An exploitation attempt was logged on 17 October, four days before any fix existed publicly. Then on 20 October, vulnerability details leaked ahead of the scheduled release. By the time fixed builds appeared the following afternoon, the usual grace period between public knowledge and available patch had collapsed to approximately nothing.
07 Exploitation Status — Read Carefully
This is the section most likely to be misreported, so it is worth separating precisely what has been observed from what has been proven.
- Amazon Threat Intelligence recorded an attempt on 17 October and further attempts before and after disclosure, characterising the flaws as being broadly exploited. It also stated it was unclear whether the pre-disclosure attempts would have succeeded against real systems.
- watchTowr observed exploitation of both CVEs against its honeypot network on 21 October.
- Cloudflare reported early attacks emerging.
- CISA stated on 21 October that it had not itself observed exploitation — while cautioning that this should not be read as evidence that attempts had not occurred.
- The PHP security team inspected proof-of-concept code circulating after the leak and did not identify any functional exploits at release time.
A related caution: publicly circulating proof-of-concept code for this pair includes both pranks and outright malware. Running an unvetted PHP2Shell “PoC” against your own infrastructure is an excellent way to become the incident you were testing for.
08 Detection
Useful indicators exist, with an important caveat below.
| Signal | What it means |
|---|---|
| Very large request bodies | Relevant to CVE-2026-109618. Bodies are frequently not logged, so filter on request size at the proxy or WAF rather than content. |
| Deeply nested multipart requests | Unusual multipart structure is worth surfacing even without a confirmed signature. |
Unknown on line 0 | Memory-exhaustion errors in PHP logs, consistent with the out-of-memory path being reached. |
AH00052 in Apache logs | A child process crashed — the engine fell over mid-request. |
| Shell parented to a web worker | Strong post-exploitation signal. A shell whose parent is apache2, httpd, php-fpm or php-cgi has no legitimate explanation. |
| Unexplained outbound connections | Egress from a PHP worker that does not match known application behaviour. |
| New files in web roots, upload, cache or tmp | Webshell placement. Worth baselining these directories regardless of this CVE. |
| New cron jobs or accounts | Persistence established after initial access, tied to the web worker’s context. |
| CVE-2026-109619 | No published log signature. Absence of evidence carries very little weight here. |
AH00052 tells you someone tried something clumsy; it does not tell you they succeeded. Equally, a clean exploit may leave neither a crash nor a memory error — so a quiet log is not a clean bill of health. Treat these as triage leads, not verdicts.09 Remediation
Upgrade the runtime. Application-level changes do not help, because PHP handles the request first.
| Branch | Fixed release |
|---|---|
| PHP 8.5.x | 8.5.12 |
| PHP 8.4.x | 8.4.27 |
| PHP 8.3.x | 8.3.36 |
| PHP 8.2.x | 8.2.35 — note this branch reaches end of life on 31 December 2026 |
| PHP 8.6 RC | 8.6.0RC4. RC3 does not carry the fix. |
| PHP 8.1 and older | Unsupported upstream. Minimal source backports exist for 7.4, 8.0 and 8.1, and some distributions ship patched packages — confirm with your provider rather than assuming. |
- Check the package, not the banner. Distributions such as Ubuntu and Red Hat backport fixes without changing the upstream version string, so
php -vcan look unpatched when it is fine — and occasionally the reverse. Compare package versions. - Rebuild images with
docker build --pull. Anything pinned to a specific patch tag needs the tag updated first, or you will faithfully rebuild the vulnerable version. - Restart every PHP worker after upgrading or changing configuration. Long-lived workers keep running old code.
- If you find signs of compromise, do not patch first. Isolate the host, capture memory, disk and logs, then rotate every credential the PHP process could read. Patching destroys the volatile evidence that tells you what happened.
Several advisories list .ini changes as stopgaps. They deserve a precise reading, because the gap between closes a known path and fixes the bug is where people get hurt.
•
session.upload_progress.enabled=0 only helps if applied in configuration read before request parsing. Setting it via application-level ini_set() or an FPM .user.ini is too late to help.
• On PHP 8.5,
fatal_error_backtraces=0 addresses an additional sub-path.
•
memory_limit=-1 removes a predictable trigger for CVE-2026-109618, but underlying allocation failures can still reach the vulnerable code.
One item is worth flagging as actively counterproductive: using OS-level RLIMIT_AS or RLIMIT_DATA to constrain memory is not a mitigation here. Those limits can themselves induce the allocation-failure condition the first bug depends on. The instinct to clamp memory is reasonable and, in this specific case, wrong.
10 The AI Angle
The first of these flaws was found during an AI-assisted audit of the PHP source. That detail has been widely reported, and deserves more thought than the headline it usually gets.
Set the two facts beside each other. The earliest affected code path dates to PHP 5.4.0. PHP’s request-handling path is among the most heavily trafficked code on the public internet, read by an enormous number of competent engineers across more than a decade. A memory-safety bug reachable by an unauthenticated POST survived all of that — and then two independent parties found it within a month of each other, once this class of tooling was pointed at it.
The honest reading is neither that AI is magic nor that human review failed. It is that a cheap new way of searching old code has arrived, and the cost of finding this class of bug has dropped sharply. That cuts both ways: the same economics apply to whoever audits your dependencies next, and to whoever audits them for less friendly reasons.
11 Sources & Caveats
Written 23 October 2026, two days after the patch, and revised the same day as further reporting landed. This remains a fast-moving incident. The exploitation picture in particular shifted materially between first and second draft — it moved from “contested” to “attempts widely observed” within forty-eight hours. Verify current status before acting on anything here. I have deliberately made no claim about CISA KEV listing, having been unable to confirm it at the time of writing.
Upstream advisories: GHSA-w8hw-w9fx-j79w (CVE-2026-109618) and GHSA-6wmf-4rv5-p3rp (CVE-2026-109619). The original research is published at calif.io.