November 13, 2026
A 438KB Request Killed the Vulnerable PHP Build. The Patched One Parsed It in 56MB.
The insert at zend_hash.c:1122 is still there in 8.4.27. What got deleted is the longjmp that armed it.

By Raj Namdev
7 min read
30-second version:_ PHP2Shell (CVE-2026โ109618, CVE-2026โ109619) is two unauthenticated RCEs in PHP itself, patched October 21, in the KEV catalog since October 26, affecting every PHP since 5.4 โ the runtime behind 69% of the web's known server-side languages. Instead of summarizing the advisories, I compiled the last vulnerable release (8.4.26) and the fixed one (8.4.27) from php.net tarballs and fired the documented memory-exhaustion trigger at both. The vulnerable worker died mid-request on a 20,480-byte allocation and its process was replaced. The patched build caught the same request at a new multipart part limit, ran the script, and answered the next request on the same connection. The patch deleted the OOM longjmp โ and left the vulnerable-looking insert ordering in place on purpose. The bug had been found in 2024 and left unfixed because nobody had proven an exploit._
This morning I downloaded php-8.4.26.tar.gz and php-8.4.27.tar.gz from php.net, compiled both with the same minimal configuration, and sent both the same 438,104-byte HTTP request: 1,200 multipart file-upload parts with empty filenames and field names nested 60 levels deep. That request is the documented trigger for CVE-2026-109618, built the way PHP's own advisory describes it.
The two builds disagreed about everything that mattered.
What PHP2Shell is, in one paragraph
Two bugs in the PHP interpreter, both rated CVSS 4.0 9.2 by the PHP security team, both reachable by an unauthenticated attacker over plain HTTP. CVE-2026โ109618 corrupts state through out-of-memory handling; CVE-2026โ109619 leaves request-owned state pointing at freed memory for the next request on the same worker. Every PHP installation serving web requests is at risk โ PHP-FPM, mod_php, php-cgi, FrankenPHP, LiteSpeed โ with the demonstrated exploit working against mod_php before any application code runs. Affected versions run back to PHP 5.4.0, released in 2012. The August discovery came from Ryan Austin of Calif during OpenAI's Patch the Planet initiative, with model assistance, and independently from Wiz.
The 438KB that breaks 128MB
The trigger is arithmetic, not magic. A multipart part with filename="" is an empty upload control: it doesn't count toward max_file_uploads, but PHP still builds all six $_FILES entries for it โ name, full_path, type, tmp_name, error, size. I verified that on my build first: a two-part request reported files=2.
letters = "abcdefghijklmnopqrstuvwxyz"
nest = "".join(f"[{letters[i % 26]}{i}]" for i in range(60))
part = (f"--{b}\r\nContent-Disposition: form-data; "
f'name="u{i}{nest}"; filename=""\r\n\r\n\r\n')
body = "".join(part for i in range(1200)).encode()letters = "abcdefghijklmnopqrstuvwxyz"
nest = "".join(f"[{letters[i % 26]}{i}]" for i in range(60))
part = (f"--{b}\r\nContent-Disposition: form-data; "
f'name="u{i}{nest}"; filename=""\r\n\r\n\r\n')
body = "".join(part for i in range(1200)).encode()Nest each field name 60 levels โ u0[a0][b1][c2]โฆ โ and every one of those entries costs a HashTable chain, a Bucket, and a zend_string per level. Two calibration runs, same build, same defaults:
Depth 40โ2,600 parts, 690KB body, $_FILES registered: 1,020 (capped), heap peak 98MB โ no fatal Depth 60โ1,200 parts, 438KB body, $_FILES registered: โ , heap peak past 128MB โ fatal, worker dies
At depth 40, more than double the parts hit the max_input_vars brake and stopped at 98MB. At depth 60, fewer than half the parts walk past 128MB โ on a body that's 5% of the default post_max_size of 8MB. Depth is the amplifier none of the limits price.
The five lines that made it a vulnerability
In my 8.4.26 tree, Zend/zend_hash.c:962:
add_to_hash:
idx = ht->nNumUsed++;
ht->nNumOfElements++;
p = ht->arData + idx;
p->key = key = zend_string_init(str, len, ...);add_to_hash:
idx = ht->nNumUsed++;
ht->nNumOfElements++;
p = ht->arData + idx;
p->key = key = zend_string_init(str, len, ...);The count goes up before the bucket exists. If that key allocation fails, PHP calls zend_bailout() โ a longjmp that unwinds the C stack past every cleanup in its path. But zend_array_destroy() (line 1815 in the same file) walks the table to nNumUsed and runs a destructor on every bucket it finds. A half-built bucket, counted but never initialized, is now something teardown trusts.
The request-variable registration path hits this during php_request_startup() โ before the application exists. What turns it into RCE is a SAPI fork: mod_php runs php_request_shutdown() even after startup fails (sapi_apache2.c:664, bailout at line 672, request destructor still called at line 730), so the malformed table gets consumed. FPM exits the worker instead, killing the state with it.
Same request, two builds
My lab: php-cgi as a FastCGI server, one worker, an ini with nothing but production defaults โ memory_limit=128M, post_max_size=8M, max_file_uploads=20, max_input_vars=1000.
8.4.26 โ Response: Fatal: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in Unknown on line 0. Worker: dead โ the child process was replaced, and the same connection reset on reuse.
8.4.27 โ Response: Warning: Multipart body parts limit exceeded 1020 โ then the script ran and echoed files=1020. Worker: alive โ the same connection answered the next request.
Two more findings. With the part limit lifted to isolate the allocator, the patched build parsed the same 1,200ร60 request at 56MB of heap โ no fatal. The vulnerable build needed more than 128MB for that body. And pushed to its real ceiling with 3,000 parts, the patched build's fatal arrived as a deferred event: same "Allowed memory size" message, reporting a 2,097,152-byte resize, raised at a safe point instead of mid-allocation.
What the patch actually is
The NEWS entry is titled "Avoid state corruption via bailout," and it isn't a guard clause. Counting the changed lines in my trees: 661 in zend_alloc.c, 304 in zend_hash.c, 218 in rfc1867.c, 75 in session.c, plus 241 oom_* test files. The mechanisms:
- Soft OOM. Passing
memory_limitno longer longjmps. The error is queued โ message, filename, line number, stateZEND_OOM_STATE_PENDINGโ and raised at the next VM safe point. - Hard OOM. A new
memory_hard_limit_percentini (default 200% of the limit, or a 1GB buffer) arms a second threshold that ends the process with_exit(137). - Fallible paths.
femalloc,fpemalloc,HASH_FALLIBLE,HASH_NOMEM: hash resizes and inserts now return failure up the stack instead of unwinding through a longjmp. php_basic_early_rinit(). Request-owned globals get reset beforesapi_activate()โ before parsing can touch them. That's the producer side of the stale-state bug.max_multipart_body_parts. Default-1resolves tomax_input_vars + max_file_uploadsโ 1,020 on defaults โ and the warning path aborts parsing cleanly (rfc1867.c:740).
And the detail I didn't expect: the count-before-init insert is still there in 8.4.27, at zend_hash.c:1122, character for character. They didn't fix the ordering. They removed the interruption, judged the ordering survivable without it, and priced the input strategy that reached it.
It was found in 2024
2004 โ Stefan Esser finds the first PHP memory-limit RCE and never releases the exploit. 2020 โ bug #78876: long multipart variables cause OOM and leak temp files. A symptom gets patched. 2024 โ an OSTIF/Quarkslab audit finds the related issue again. Exploitation unproven, so nothing ships. August 1, 2026 โ Calif finds three interruption points and OOM producers that turn it into pre-auth RCE against WordPress, Drupal, Joomla, MediaWiki, Magento, phpMyAdmin, Nextcloud, Laravel and Symfony. Reported August 11; PHP confirms the RCE PoC on August 15. October 20 โ it leaks: a Hacker News post, a watchTowr confirmation, an exploit video. October 21 โ patches for 8.2โ8.5, source backports for 7.4โ8.1, two GHSAs. Chainguard ships patched builds early, and the diff is public hours before the official release. October 17โ26 โ Amazon's MadPot honeypots see attempts from the 17th, four days pre-disclosure; a researcher demos RCE in the public "Steal My Bitcoin" challenge on the 25th; CISA adds both CVEs to KEV on the 26th; Trail of Bits confirms working exploits the same day. Days after โ Dream Research reports artifacts of a custom exploit chained with a kernel flaw reaching root on 24 internet-facing firewalls and their management server.
What I'd put in the report template
A fatal error is a control-flow hijack of cleanup. Whoever controls when the fatal fires controls which reset code gets skipped. The hunting order that falls out of this patch: find state published before fallible work, find the fatal that skips the matching reset, find who reads the state after โ teardown, or the next request on a reused worker.
Old "unexploitable" findings are a worklist, not a graveyard. The 2024 audit found this and moved on because no exploit existed. The code didn't change between then and August 2026. The severity did, because someone wrote the PoC. When your report is sitting in a triage queue marked "theoretical," the missing exploit is the argument, and "no one's proven it" is a reason to prove it, not to close it.
And when a CVE this size lands, read the patch, not the writeup. The fix is the pattern library: queue instead of longjmp, cap the input amplification, reset state before parsing. PHP's security team published the whole method for finding the next one.
What this lab doesn't show
My SAPI is php-cgi, which follows the FPM school: on a real request-startup OOM, both builds exit the worker by design โ I observed exactly that on the patched build past its ceiling. The exploitable teardown-consumption is mod_php's, and I didn't build Apache. I demonstrated the trigger, the fatal, the worker death and the new part limit โ not code execution. Heap peaks are allocator-arena measurements from memory_get_peak_usage(true). Everything above was run November 13 against the php.net tarballs, single worker, no other traffic.
Sources
All lab results are from my own runs on November 13, 2026, against source tarballs downloaded that day. External facts are marked with their origin.
- Builds โ
php.net/distributions/php-8.4.26.tar.gzandphp-8.4.27.tar.gz, configured--disable-all --enable-cli --enable-cgi --enable-session --without-pear --disable-phpdbg, gcc 15.2, both "Build complete." - Lab ini (defaults only) โ
memory_limit=128M,post_max_size=8M,max_file_uploads=20,max_input_vars=1000,max_input_nesting_level=64,session.upload_progress.enabled=1; the parts-cap-isolation runs setmax_multipart_body_parts=100000. - Observed, 8.4.26โ1,200 empty-filename parts, nesting depth 60, body 438,104 bytes:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in Unknown on line 0; worker child PID replaced (101917 โ 101970); same-connection reuse returnedECONNRESET. Depth-40 calibration: files capped at 1,020, ~98MB heap peak, no fatal. - Observed, 8.4.27, defaults โ same request:
Warning: PHP Request Startup: Multipart body parts limit exceeded 1020, script executed (files=1020), worker answered the next request on the same connection. Parts cap lifted: same request parsed with 56MB peak, no fatal. 3,000-part push (1,096,904 bytes): deferredAllowed memory size ... (tried to allocate 2097152 bytes)fatal; worker exited (php-cgi startup-failure behavior,cgi_main.c:2464). - Source quotes โ 8.4.26:
Zend/zend_hash.c:962-965(count before key init),zend_array_destroyat:1815,sapi/apache2handler/sapi_apache2.c:664,671-672,730,sapi/cgi/cgi_main.c:2464-2471. 8.4.27:Zend/zend_hash.c:1122-1126(ordering unchanged),main/rfc1867.c:740(parts limit =max_input_vars + max_file_uploadswhen-1),main.c(memory_hard_limit_percent,php_basic_early_rinit()),Zend/zend_alloc.c(EG(delayed_oom),ZEND_OOM_STATE_PENDING,_exit(137)). Release diff: 638 entries, 241oom_*test files; NEWS: "Avoid state corruption via bailout." - Advisories โ GHSA-w8hw-w9fx-j79w (RCE via OOM corruption) and GHSA-6wmf-4rv5-p3rp (RCE via stale global state), php/php-src, October 21, 2026 โ OOM strategies, SAPI susceptibility, mitigations, severity 9.2.
- Official guidance โ php.net news archive: October 20 advance notice, October 21 security advisory (fixed versions 8.5.12/8.4.27/8.3.36/8.2.35; backports for 7.4โ8.1; "no complete mitigations"), October 23 CVE-2026โ115560 session upload-progress advisory.
- Discovery history โ Calif technical writeup,
calif.io/php2shell(2004 Esser reference, 2020 bug #78876, 2024 OSTIF/Quarkslab audit, the three interruption points, the exploit path analysis, SAPI divergence quotes). - Impact and timeline โ Wikipedia "PHP2Shell" (WSJ, Reuters, BBC, Guardian sourcing; government shutdowns; W3Techs 69.2%; PHP Foundation staffing; Wikipedia-cited Oct 25 "Steal My Bitcoin" RCE); Tenable FAQ (MadPot October 17, KEV October 26 due October 29, Trail of Bits confirmation, Dream Research firewall-root campaign, exposed-host estimates ~1.3M+/1.9M); Huntress rapid response (version guidance,
session.upload_progressmitigation).