ACTIVE EXPLOITATIONPHP2Shell pre-auth RCE in PHP core — emergency patching from $10/site, EOL PHP coveredPHP2Shell RCE — patch from $10→
All posts
Field note 01October 22, 202617 min read

PHP2Shell: Expectation vs Reality — The Walls Fell, Host Calibration Remains

October 24 update: public PHP2Shell chains crossed major FPM, stock-configuration and worker-affinity barriers. Reliable remote exploitation still depends on per-host calibration—and exposure is not RCE proof.

  • php2shell
  • CVE-2026-109618
  • CVE-2026-109619
  • RCE
  • research
  • field-report

A field report on CVE-2026-109618 / CVE-2026-109619 — what the headlines promised, what the lab proved, and what actually fires on production servers. Updated October 24 as the exploit ecosystem changed.

When the PHP2Shell disclosure dropped on October 20, 2026, the numbers were terrifying: a CVSS 4.0 9.2 pre-auth RCE in PHP core, present since 5.4.0 (2012), demonstrated against stock WordPress, Drupal, Joomla, Magento and Laravel. "Every PHP site on the internet" was the ambient temperature of security Twitter that week.

At OctaSec we do one thing with claims like that: we try to break real systems with them — in our labs first, then against what we're authorized to touch. So we reproduced the best public exploit, verified the follow-ups, and then mapped, one by one, the distance between a stock Docker container and a hardened production host.

That distance turned out to be the entire story.

October 24 editor's note: several barriers in the original October 22 report have now fallen. Read the October 24 update before the original five-walls analysis. The earlier sections remain as a timestamped lab record; where the two differ, the dated update controls.

TL;DR

  • PHP2Shell is real, critical, and pervasive. Fixed in 8.2.35 / 8.3.36 / 8.4.27 / 8.5.12 (Oct 21, 2026). PHP ≤ 8.1 gets no official fix, ever.
  • The public demos are genuine — we reproduced the best early one at 3/3, ~10 seconds per run. Public follow-ups now document stock php.ini-production, display_errors=Off, 128M memory limits and stock 150-worker prefork exploitation. An application-dependent FPM chain also exists.
  • Our original authorized production sweep remains an honest negative for that point in time, not evidence that those hosts are safe today. We did not fire availability-affecting memory-corruption chains at production systems.
  • Host sensitivity is the remaining wall: identical PHP versions on different hosts can require different heap calibration. Remote exploitation is possible, but it is not a reliable spray. Public memory-corruption chains must also be treated as availability-affecting during setup, whatever their post-setup "zero-crash" marketing says.
  • Our checker remains safe and non-destructive (~300 bytes, one oracle request plus one fingerprint GET). It assesses patch-level exposure; it does not claim reliable RCE, and it never fires an exploit chain.

The bugs, in plain English

Both CVEs live in code that runs before your application does. When PHP receives a multipart/form-data request — any file upload form — it parses the body inside php_request_startup(), before the target script's first line executes. A legacy feature, session.upload_progress (on by default since PHP 5.4), initializes session machinery in that pre-boot window to track upload progress.

That single design decision creates the entire attack surface:

CVEOfficial titlePlain English
CVE-2026-109618 (GHSA-w8hw-w9fx-j79w)RCE via OOM corruptionA request hits the memory limit; PHP's error handling escapes mid-bookkeeping, leaving half-built structures behind. Request shutdown later treats garbage as live data.
CVE-2026-109619 (GHSA-6wmf-4rv5-p3rp)RCE via stale global stateWorker globals keep pointing at freed memory. The next request on the same worker touches those dangling pointers before re-initialization.

Why this is worse than a typical web bug: the trigger is any multipart POST to any PHP script. The application doesn't need an upload form, doesn't need session_start(), doesn't need to be buggy. A page containing only <?php echo "OK"; is a valid target.

Attribution note: found by Ryan Austin (Calif) with GPT-5.6, independently by Wiz Research, with OpenAI coordinating. Be aware that Wiz/Sansec file the sub-bugs under the opposite CVE numbers than PHP's own advisories — half the internet has the mapping swapped. PHP's advisories are authoritative.

The disclosure storm

Details leaked ~18 hours before the patch. Within 48 hours we counted 338 public GitHub repos referencing the CVEs. We surveyed all of them and deep-read roughly 50:

  • ~40% — same-day AI-generated noise (banner checkers, "PoCs" that test nothing)
  • ~25% — mitigation scripts, patched Docker images, EOL backports
  • ~20% — detection content (Suricata/Sigma/YARA/Zeek, nuclei templates)
  • ~10% — honest lab reproductions of the app-assisted chains
  • A handful — genuinely novel exploitation engineering

Junk warning: at least one "mass exploit" repo is Telegram-group bait with no code, and several high-star PoCs implement a mechanism (post_bytes_processed UAF) that multiple independent labs — and our own source read — could not reproduce. Stars ≠ correctness, especially this week.

What we reproduced in the lab

All labs are Docker: official php:*-apache images, FPM builds of 8.2.34, a from-source 8.4.27, and legacy builds of 5.6 / 7.4 / 8.0 / 8.1.

ChainLab result
Zero-precondition RCE (mod_php, 8.4.26)✅ 3/3, uid=33(www-data) proof each run, ~10s. Leaks heap + libphp base through Set-Cookie: PHPSESSID (Heartbleed-style OOB read), then a forged HashTable whose destructor pointer is zif_system — PHP's own session teardown calls it
52× memory amplification✅ our own bisection on a 128M target: 2.28 MB body → HTTP 200; 2.57 MB → OOM. Matches the published 52.3× threshold exactly
Content-Type separator WAF bypass✅ multipart/form-data, boundary=X parses fully and engages upload-progress; defeats Content-Type-anchored rules
Chain A (session poisoning + LFI)✅ end-to-end RCE on PHP 5.6 → 8.2.34; still works on patched 8.4.27 — it's an unpatched by-design weakness, not one of the CVEs
Chain C (serialize-handler mismatch → __destruct)✅ end-to-end RCE on 5.6 → 8.2.34; also survives the patch
109619 pre-RINIT __wakeup✅ reproduced on 7.4+ (needs opcache preload or an app-resolvable class)
109618 OOM corruption✅ worker-kill corruption confirmed; weaponized form classified DoS-class and gated
display_errors=Off leak chain⚠️ the leak works with display_errors off (chunk + libphp base recovered) — the fire stage did not survive a rebuild (see Wall 5)
Warning-count patch oracle✅ 8.2.34 → 3 warnings (vulnerable), 8.4.27 → 2 warnings (patched), 100% separation in our A/B

October 24 update — the walls fell, and a new one appeared

Within 72 hours of disclosure, a follow-up research sweep shared with OctaSec revisited every wall in the original report. We cross-checked the update against the public exploit repositories and primary ecosystem sources. “Closed” below means that a documented chain now addresses the barrier under its stated lab conditions. It does not mean every production host is exploitable, or that OctaSec independently reproduced every claimed run.

Original wallOctober 24 status
FPMClosed as a categorical barrier, with application prerequisites. kengwang's FPM chain steers the session-file writer through stale BG(unserialize) decoder state, uses empty-filename RFC1867 chunks for memory amplification and arms a four-worker pool through nginx round-robin. The public chain requires a page that calls session_start() and a writable document root, so this is not universal zero-precondition FPM RCE. The follow-up could not independently reproduce it after a from-source rebuild changed the binary and invalidated baked heap constants.
Worker affinityClosed for the tested stock prefork configuration. 9bie's current chain holds 149 keep-alive connections so the chain stages reach one remaining child under stock MaxRequestWorkers=150. The follow-up reproduced pinned 150/150. This is also intrusive: worker saturation is not a safe production probe.
display_errors=OffClosed for the documented mod_php chain. 9bie's pure chain targets official php.ini-production and reports full RCE with display_errors=Off and memory_limit=128M (10/10 author-reported). The follow-up reproduced the worker pinning, OOM arm and dual-base leak, with intermittent full-chain results in its environment.
memory_limit=128MClosed. Duplicate-header amplification and empty-filename RFC1867 chunks removed the original small-body barrier. We independently verified the duplicate-header direction during the original research.
Per-build offsetsMostly closed for covered builds, not unknown hosts. The follow-up reports a 5,828-row per-build offsets catalog covering Docker Hub PHP tags and major distro builds, with leak-confirmed profile selection. That catalog and its coverage were reported by the sweep; we have not independently audited every row. Blind calibration against a wholly unknown build remains open.

The new wall — host sensitivity

Three independent exploit repos failed in the follow-up's environment for the same underlying reason: ZendMM heap-grooming constants can be calibrated to a particular host and runtime state, not merely a PHP version. A chain that was reliable on the author's Debian 6.6 host missed on a Kali 7.1 kernel with the same PHP version.

That negative result is consistent with our own earlier rebuild failure and with the portability evidence in the draft Metasploit module: its distro-built PHP target failed the heap-leak stage even after symbol offsets were supplied. Correct offsets alone do not guarantee correct heap geometry.

Expectation vs reality, final form: the exploit you download may be calibrated to the machine it was written on. Remote exploitation of arbitrary production hosts is possible, but it is a per-target calibration exercise, not a dependable spray. A failed public exploit is not a safety certificate.

“Zero-crash” needs an asterisk

The follow-up observed OOM grooming and worker deaths during setup even for a variant marketed as zero-crash. Zero-crash after setup is not zero-crash end to end. Treat every public memory-corruption chain as availability-affecting against real systems. Application-assisted session poisoning plus LFI remains the quieter family; our public checker uses none of these exploitation paths.

Ecosystem updates worth knowing

  • The Metasploit PR #22036 is a draft, not a merged universal module. Its own evidence documents single-worker and calibration limitations.
  • Exploit-DB 52704 was published on October 22; its documented default profile still requires the original soft-lab settings.
  • Amazon Threat Intelligence says MadPot recorded an exploitation attempt on October 17, four days before public disclosure. AWS also cautions that success against real-world systems is unclear.
  • Neither CVE appeared in the CISA KEV JSON feed when we checked catalog version 2026.10.23 on October 24. Absence from KEV does not mean absence of exploitation attempts.

Original October 22 field report — Docker vs Reality: the five walls

This section preserves our original measurements and conclusions as a historical record; use the October 24 update above for current ecosystem status. Every early "RCE confirmed!" demo we assessed ran against stock official Docker images — Apache prefork + mod_php, display_errors=On, a tiny memory_limit, a single worker. Production is none of those things. Here is each wall, with the evidence as we understood it on October 22.

Wall 1 — SAPI: mod_php vs PHP-FPM

The memory-corruption chains depend on per-process continuity: request A leaves a dangling pointer, request B must land on the same process to consume it, and after a worker crash the replacement must inherit the same memory layout (that's how the ASLR bypass works — a re-forked prefork child shares the master's address space).

  • Apache prefork + mod_php satisfies all of this. The demonstrated RCE completes before application code, on default settings.
  • PHP-FPM kills the child on request-startup failure — the corrupted state dies with it. The official 109619 advisory confirms an FPM RCE path exists, but it is application-assisted. No public zero-app-precondition FPM chain exists as of writing.
  • The awkward part: most modern production PHP is FPM behind nginx, and you often cannot tell from outside — expose_php=Off and header hygiene hide the SAPI. Several of our real targets were "Apache" in the banner with the SAPI genuinely undeterminable passively.

Wall 2 — display_errors

The main chain's first-stage leak is bootstrapped by a max_input_vars warning (it sets headers_sent, which changes cookie behavior the leak relies on). Flip display_errors=Off — as every production hardening guide demands — and the chain dies at stage 1. We verified: 3/3 → 0/3.

A follow-up chain removes this dependency for the leak (we verified the display_errors=Off leak returns both base addresses) — but see Wall 5 for why that doesn't yet equal RCE.

Wall 3 — memory_limit (the wall that fell during our research)

The original demos OOM a tiny 8M limit with a 12 MB body. Production runs 128M+, and a 12 MB body barely dents it — verified: the chain fails 3/3 at 128M.

Then the amplification landed: PHP places no limit on the number of headers per multipart part, and each duplicate ~6-byte header costs real allocations. A 2.57 MB wire body — comfortably under the default 8M post_max_size — exhausts a 128M heap. We verified this independently. This wall is gone. The limiting factor is now post_max_size, and most defaults allow the attack body.

Wall 4 — worker count / affinity

The chain's request pairs must hit the same child process. Single-worker prefork (the lab default) makes this trivial. Production runs tens to hundreds of workers behind a load balancer that round-robins connections. We verified: raising the lab to 4 workers took the exploit from 3/3 to 0/3. Beating this needs worker-affinity tricks (connection reuse, keep-alive pinning, timing under low load) — solvable in principle, unsolved in public code.

Wall 5 — per-build offsets, and the reproducibility tax

Every stage of the weaponized chains is calibrated to a specific libphp.so build: symbol offsets, heap geometry constants, grooming counts. The better repos auto-extract offsets — from the container's own libphp, which you only have if you already control the box. Against a remote unknown build you need the right offsets database.

And builds drift in ways that will bite you: we rebuilt one of the best public chains from its own Dockerfile and the fire stage stopped working, because the Dockerfile's base image is unpinned — today's image has a different libphp layout than the author's validated one. The leak survived; the execution didn't.

If you reproduce anything from this week, pin your base images by digest.

Bonus wall — the edge

Before PHP ever sees your request: Cloudflare deployed managed rules 9 hours before disclosure (including its first-ever response-side blocking rule), Fastly and others followed. We additionally found targets whose edge WAF rejects all multipart bodies outright — which kills every chain in this report before it starts.

The application-assisted chains have their own reality problems

The "simpler" chains (session poisoning + LFI, handler mismatch, pre-RINIT unserialize) don't need heap magic — they need application features, and those turned out to be just as rare in the wild:

  • Chain A (poison + LFI) needs an LFI/include sink. On a 16-host sample of legacy production sites (native sessions, multipart accepted, PHP 5.4–8.1 — perfectly conditioned otherwise), we found zero usable LFI sinks: the dominant stacks are template-deployed SaaS apps whose public controllers are DB-driven with whitelisted parameters, and several hosts run mod_security that 403s traversal and php:// on sight.
  • Modern frameworks starve the session chains entirely: Laravel/Symfony-class apps don't use native PHPSESSID sessions, so there is nothing to fixate or poison through this path.
  • Chain C needs two directories with different session.serialize_handler sharing one save path — a misconfiguration that template-deployed single apps simply don't have.
  • 109619's pre-RINIT chain needs a session-planting feature plus a class resolvable before RINIT — again, app-dependent.

The pattern: the bugs are in PHP core, but every public exploit path still needs one property from the target — the right SAPI, the right ini, the right worker topology, or the right application feature. "Any PHP page is exploitable" is true exactly as long as those stars align.

Real-world testing: the honest negative

This is where our methodology matters. Against a national-scale estate we are authorized to test (hundreds of live production PHP hosts), we ran a two-phase assessment:

  1. Passive sweep (500 hosts): banner/session/framework fingerprinting, multipart reachability, SAPI tells. 53 hosts came out "conditioned" (vulnerable version + native sessions + multipart reaches the PHP parser).
  2. Targeted hunting (16 of the most conditioned, ~115 benign requests total — no DoS shapes, no uploads, no worker-killing): map the app surface, look for the one missing precondition per chain.

Result: zero RCEs. Not because the targets are patched — nearly all run EOL PHP that will never be patched — but because each host was missing exactly one link: the LFI sink, the handler mismatch, the plantable class, or (for the OOM chains) an acceptable way to fire worker-killing traffic at a live public service, which we do not do.

The closest real-world matches to the "ideal victim" profile — an EOL mod_php stack with native sessions and upload-progress provably initializing pre-RINIT (verifiable with two benign requests) — do exist in the estate. They remain one authorized maintenance window away from a definitive test, because the only chains that would settle the question kill workers by design.

Expectation: 9.2 CVSS, "every PHP site RCE'd tonight." Reality: pervasive latent vulnerability, a working exploit class that is genuinely configuration-gated, and a defensive window measured in how long it takes exploit authors to solve worker affinity and per-build calibration — not in whether the bug is real.

What attackers are actually doing

Honeypot telemetry (VulnCheck canaries, Cloudflare, watchTowr) tells a consistent story:

  • Attacks began 07:43 UTC on Oct 21 — seven hours before the patch.
  • The only weaponized chain observed firing in the wild so far is the simplest one: session poisoning + LFI readback — a multipart POST planting <?php … system($_GET['c']) …?> into a session file via a raw upload filename, followed by LFI attempts to include it.
    • IOCs: webshell prefix PWNED::, multipart boundary ------p2s9rdme2st6guc9g0rafic
  • The rest of the traffic is scanning and fingerprinting.
  • Nobody — researchers included — has published a verified RCE against a named, real production target with the memory-corruption chains.

Interpretation: the threat this week is not an unstoppable heap-corruption worm; it's the boring chain pointed at the long tail of legacy apps with file-include sinks — plus a fast-maturing exploit ecosystem that will get there.

Check your own servers — safely

A worrying trend this week: "detector" scanners that verify the bug by crashing your workers. Do not run random PoCs against production; some are DoS by construction (and a few are outright malware-bait).

Safe options:

  1. Version check (necessary, not sufficient): anything below 8.2.35 / 8.3.36 / 8.4.27 / 8.5.12 is vulnerable; ≤8.1 has no fix coming. Remember CLI version ≠ web SAPI version, and distro backports can lie in banners.
  2. Warning-count differential oracle (our favorite): one ~300-byte multipart POST with an invalid session id. Unpatched PHP emits 3 session warnings; patched emits 2. Requires display_errors=On to be observable; benign and worker-safe. We validated 100% separation across vulnerable/fixed builds. This answers patch-level exposure, not whether a calibrated exploit will succeed against the host. A patched result does not remove a separate application-level session-poisoning + LFI chain.
  3. Log review for the exploitation shape: Allowed memory size … in Unknown on line 0 bursts, Apache AH00052 child segfaults followed by one slow request, oversized or malformed PHPSESSID cookies, multipart bodies containing PHP_SESSION_UPLOAD_PROGRESS from clients with no upload UI.

Defense that actually works (and what doesn't)

The only complete fix: patch PHP. 8.2.35 / 8.3.36 / 8.4.27 / 8.5.12. Note that 8.1 and older will never get one — community backports exist (including prebuilt guard extensions for 5.6–8.5) but audit before trusting.

If you can't patch yet:

MitigationVerdict
session.upload_progress.enabled = 0Partial — closes the 109619 session path, does not touch 109618's OOM corruption
memory_limit = -1 (admin-enforced)Removes the OOM trigger; watch host RAM. PHP releng: "INI settings alone won't protect you"
Block all multipart/form-data at the web serverEffective but breaks legitimate uploads; test checkout/admin flows
WAF rules (Cloudflare/Fastly/ModSecurity packs)Good stopgap; already being mutated around — the , boundary= separator bypass defeats Content-Type-anchored rules; cloud body-inspection windows (8–128 KB) can be padded past
display_errors=Off, session.use_strict_mode=On, @-suppressionNot mitigations for these bugs
RLIMIT_AS/RLIMIT_DATA as a "sandbox"Actively harmful — they cause the mmap failures this bug feeds on
FPM instead of mod_phpNot a fix. A public application-dependent FPM RCE chain now exists; session and writable-webroot prerequisites still matter
Take the host read-only/offlineWhat PHP core devs themselves recommended pre-patch; several large public-sector operators did exactly that

Detection content worth deploying: Snort SIDs 67359/67360/67375 (Talos), abstract.security's ModSecurity/Suricata pack, Corelight's Zeek notices (PHP_Crash_Sequence, Multipart_Header_Flood), and any alert on web workers spawning shells — the one signal every post-exploitation path shares.

One more reason to patch even if you feel well-configured: independent researchers have demonstrated that app-assisted primitives survive the patch (a var_destroy reentrancy UAF reproduced on 8.4.27; handler-mismatch and raw-filename session injection are unpatched by design). Patching closes the worst door, not every door.

Conclusions

  1. The vulnerability is as bad as advertised; exploitation is not universally reliable. PHP2Shell is a genuine pre-auth RCE class in PHP core. Public chains now work under important production-like conditions, but success still depends on the target's exact runtime and application properties.
  2. Most of the original walls fell quickly. FPM, display_errors=Off, 128M memory limits, stock worker counts and broad offset coverage are no longer categorical barriers. Our original five-walls analysis is useful history, not a reason to defer patching.
  3. Host calibration and availability are the remaining reality checks. Matching a PHP version is not matching a host's heap. A failed exploit proves nothing about safety, and “zero-crash” claims do not make memory-corruption testing safe for production.
  4. The ecosystem is fast and noisy. 338 repos in 48 hours, ~40% AI-generated, several confidently wrong. Verify against source, distrust stars, preserve negative results and pin lab images by digest.
  5. Defense-in-depth still matters. Install the fixed release, use full-body edge inspection where feasible, reduce unnecessary multipart exposure, and watch behavior such as web workers spawning shells. Do not rely on a version banner—or this article—as an exploitability verdict.

All reproductions were performed in self-hosted Docker labs. Real-target assessment was limited to benign, non-destructive probes on systems covered by an authorized testing scope; no availability-affecting techniques were used against production hosts. Original research: Ryan Austin (Calif), Wiz Research, OpenAI; coordinated fix by the PHP security team. Telemetry: VulnCheck, Cloudflare, watchTowr, Sansec, Patchstack. Official advisories: GHSA-w8hw-w9fx-j79w, GHSA-6wmf-4rv5-p3rp; CERT-EU 2026-018.


Running PHP you can't upgrade? OctaSec offers fixed-price emergency PHP2Shell hardening — $10 per site, $100 per server (up to 100 sites), including EOL versions 5.6–8.1 — verified before and after with the non-destructive oracle described in this post.

Keep reading

More field notes

Start here

One finding pays for the engagement.

Book a 30-minute scoping call. If a scanner is enough for you, we'll say so.

Free website check