PHP2Shell

PHP2Shell is the name for two memory-corruption bugs in the PHP runtime, CVE-2026-109618 and CVE-2026-109619, that let an attacker with no account run code on a web server by sending it HTTP requests. on apache with mod_php the confirmed attack runs before any application code does.

what to doupgrade to PHP 8.2.36, 8.3.37, 8.4.28 or 8.5.13 and restart every PHP worker. the first fix shipped on 21 october 2026 in 8.2.35, 8.3.36, 8.4.27 and 8.5.12; the 19 november releases also fix CVE-2026-115560 on every branch and close a gap the first fix left on 8.3 and later.

sourcesCVE-2026-109618CVE-2026-109619

what is PHP2Shell?

PHP2Shell is two bugs with one root: PHP abandons a request partway through and leaves memory in a state the next piece of code trusts. both are in the runtime itself, so every application on an affected PHP is exposed, whatever framework or CMS it uses, and application logins do not stand in the way.

PHP says the risk covers "all PHP installations serving web requests, including PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP and LiteSpeed", and is highest for mod_php. code runs as the web worker account.

CVE-2026-109618
RCE via OOM corruption

CISA lists it as PHP Memory Corruption Vulnerability

what goes wrong

when a request runs out of memory, PHP jumps straight out of whatever it was doing with longjmp(). if that happens while request memory is only half set up, the request's shutdown code reads memory that was never initialised.

how it is reached

one request that pushes PHP past memory_limit while it parses the body: a multipart body with no declared length, a part carrying a flood of headers, or many empty file fields with deeply nested names.

confirmed on

apache mod_php over HTTP, with default limits. PHP-FPM is susceptible by source analysis, with no complete exploit shown. FrankenPHP is likely susceptible.

9.2 criticalCVSS 4.0, scored by PHP (the CNA)

CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

9.8 criticalCVSS 3.1, scored by NVD

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

advisory GHSA-w8hw-w9fx-j79w

CVE-2026-109619
RCE via stale global state

CISA lists it as PHP Stale Internal Request-State Vulnerability

what goes wrong

a PHP worker keeps global state between requests, and some of it points into one request's memory. when a request dies before that state is reset, the memory is freed but the pointer stays, and the next request on the same worker uses it: a use-after-free.

how it is reached

two requests that land on the same worker. the confirmed routes are session upload progress, which is on by default and needs no session_start() in the application, and on PHP 8.5 the fatal-error backtrace.

confirmed on

mod_php and PHP-FPM for the session route. mod_php for the PHP 8.5 backtrace route.

9.2 criticalCVSS 4.0, scored by PHP (the CNA)

CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

8.1 highCVSS 3.1, scored by NVD

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

advisory GHSA-6wmf-4rv5-p3rp

weakness classes on both records: CWE-416 Use After Free, CWE-755 Improper Handling of Exceptional Conditions, CWE-824 Access of Uninitialized Pointer, CWE-1325 Improperly Controlled Sequential Memory Allocation, CWE-1419 Incorrect Initialization of Resource.

is PHP2Shell being exploited?

timeline

yes. CISA added both CVEs to its known exploited vulnerabilities catalog on 26 october 2026, with a 29 october deadline for US federal agencies.

exploitation started before the fix was public. amazon's honeypots recorded the first attempt on 17 october 2026, four days before PHP's release, so look for compromise from that date and not from the 21st.

unit 42 reports PHP2Shell "being actively exploited against PAN-OS management interfaces that are exposed to the internet", in a campaign that chained it with a linux kernel privilege escalation to reach root.

most traffic is still probing. of the 89,575 requests TU delft counted, 68,286 were probes and 10,633 reached a code-execution step. PHP notes that exploit reliability depends on the PHP build, its extensions and the web server in front.

the yeet programmable firewall

patch CVEsin minutes

When a CVE reaches the exploited list, your yeet network security agent reads it, writes the patch in seconds, and applies the new rule on every host.

PHP2Shell arrives from the KEV feed, the agent drafts a rule, a person applies it
  • minutes

    Mean Time to Mitigate

    Every new RCE is now a contest of agent speed.

  • 3 to 6 ms

    rule to live

    Policy is applied without restarts or redeploys, measured in our lab.

  • per host

    enforcement

    This host-based IPS bridges your NGFW patch gap immediately.

virtual patch: PHP2Shell · php2shell.pfc
// php2shell.pfc: virtual patch for CVE-2026-109619 and// CVE-2026-109618. Runs at XDP on the PHP host, on the// cleartext hop behind TLS termination.nocase;reassemble 80;pattern progress  = "PHP_SESSION_UPLOAD_PROGRESS";pattern multipart = "multipart/form-data";pattern chunked   = "transfer-encoding: chunked";regex   nested    = "(\[[^\]\r\n]{0,4}\]){12}"; filter {  if (proto != 6) decide pass;  if (dport != 80) decide pass;  if (len == 0) decide pass;   mask m = within(payload, 2048);   // CVE-2026-109619, session upload progress: the field that  // reaches session handling before the request is initialised.  // The wire form of session.upload_progress.enabled=0, with  // no PHP worker restarted.  if (any(m, progress)) {    log(96);    decide rst("php2shell_upload_progress", 0);  }   // CVE-2026-109618: a multipart body with no declared length  // gets past the post_max_size check and keeps supplying data.  if (all(m, multipart, chunked)) {    log(96);    decide rst("php2shell_unsized_multipart", 0);  }   // CVE-2026-109618: a field name nested twelve levels deep  // multiplies the arrays PHP builds for every part.  if (any(m, nested)) {    log(96);    decide rst("php2shell_nested_names", 0);  }   // PHP's advice for apps that take no uploads. Off until the  // host sets it.  if (knob("block_multipart") ?? 0 == 1) {    if (any(m, multipart)) decide rst("multipart_blocked", 0);  }   decide pass;}

36 instructions · 4 patterns · 385 DFA states

  • PHP2Shell-shaped request, no rule loadedreached PHP
  • the same request, rule loadedblocked
  • ordinary requests, rule loaded5 of 5 passed

tested on linux 6.12 against unpatched PHP 8.3.35, on 20 nov 2026.

which PHP versions are affected, and which fix it?

every supported branch was affected, and PHP fixed all four on 21 october 2026. install the 19 november 2026 release of your branch, which completes the fix.

PHP branches affected by PHP2Shell and the releases that fix it
PHP 8.5vulnerable8.5.0 to 8.5.11first fixed8.5.12install now8.5.13
PHP 8.4vulnerable8.4.0 to 8.4.26first fixed8.4.27install now8.4.28
PHP 8.3vulnerable8.3.0 to 8.3.35first fixed8.3.36install now8.3.37
PHP 8.2vulnerable8.2.0 to 8.2.34first fixed8.2.35install now8.2.36
PHP 8.1 and olderend of lifevulnerableall releasesfirst fixedno PHP releaseinstall nowa vendor backport, or 8.2 and later

PHP 8.1 and older: PHP published minimal source backports for 7.4, 8.0 and 8.1, and distributions and long-term-support vendors ship them as packages. NVD's affected ranges start at 7.3.0 for CVE-2026-109618 and 5.4.0 for CVE-2026-109619.

  • PHP 8.5.0 through 8.5.11 are vulnerable to PHP2Shell. 8.5.12 is the first fixed release; install 8.5.13, which also fixes CVE-2026-115560, CVE-2026-129481 and CVE-2026-129182.
  • PHP 8.4.0 through 8.4.26 are vulnerable to PHP2Shell. 8.4.27 is the first fixed release; install 8.4.28, which also fixes CVE-2026-115560 and CVE-2026-129481.
  • PHP 8.3.0 through 8.3.35 are vulnerable to PHP2Shell. 8.3.36 is the first fixed release; install 8.3.37, which also fixes CVE-2026-115560 and CVE-2026-129481.
  • PHP 8.2.0 through 8.2.34 are vulnerable to PHP2Shell. 8.2.35 is the first fixed release; install 8.2.36, which also fixes CVE-2026-115560.
  • PHP 8.1 and older are end of life and vulnerable to PHP2Shell, and the PHP project released no fixed version for them.

distribution packages

distributions patch their own PHP packages. some keep the old upstream version number, so php -v cannot tell you whether the fix is in.

Distribution packages that carry the PHP2Shell fix
debian 13packagephp8.4first fixed package8.4.27-1~deb13u1version numbermoves to the fixed releaseadvisoryDSA-6574-1
debian 12packagephp8.2first fixed package8.2.35-1~deb12u1version numbermoves to the fixed releaseadvisoryDLA-4848-1
ubuntu 24.04packagephp8.3first fixed package8.3.6-0ubuntu0.24.04.13version numberstays the sameadvisoryUSN-8948-1
ubuntu 22.04packagephp8.1first fixed package8.1.2-1ubuntu2.28version numberstays the sameadvisoryUSN-8948-1
RHEL 10packagephpfirst fixed package8.3.36-1.el10_2version numbermoves to the fixed releaseadvisoryRHSA-2026:87070
RHEL 9packagephp:8.3 modulefirst fixed package8.3.36-1.module+el9.8.0+25109+6886e21aversion numbermoves to the fixed releaseadvisoryRHSA-2026:87079

PHP also ships inside appliances and management interfaces you cannot upgrade yourself. NCSC-NL's inventory tracked 976 products on 18 november 2026: 218 fixed and 211 still vulnerable. for those, apply the vendor's update or take the interface off the network.

how do I check whether my PHP is patched?

check the PHP that serves web requests. the php on your shell's path can be a different build from the one PHP-FPM or apache loads.

read the version

enough when you install PHP's own releases or the official container images. run it for the binary that serves requests.

php -v | head -1
  • vulnerablePHP 8.3.35 (cli) (built: Sep 25 2026 17:43:54) (NTS)
  • first fixPHP 8.3.36 (cli) (built: Nov 5 2026 20:30:59) (NTS)

tested: output from the official php:8.3.35-cli-alpine and php:8.3.36-cli-alpine images.

ask the build whether it has the fix

works on PHP 8.2 and later, including backports where the version number does not move. the fix commit adds an INI setting, memory_hard_limit_percent, so a build that knows the setting carries the october fix. it says nothing about the november follow-ups.

php
php -r 'var_dump(ini_get("memory_hard_limit_percent"));'
  • no fixbool(false)
  • fix presentstring(0) ""

tested: we ran it on the official 8.3.35 and 8.3.36 images and on patched ubuntu 24.04, debian 12 and debian 13 packages. it does not work on PHP 8.1 and older: the minimal backport leaves the setting out, so ubuntu 22.04's patched PHP 8.1 still prints bool(false). use the changelog there.

read the package changelog

the distribution's own record of what a package fixes, and the check to use on PHP 8.1 and older.

apt changelog php8.3-cli | grep -E 'CVE-2026-10961[89]'
  • patched- debian/patches/CVE-2026-109618_109619.patch: Avoid state corruption via
  • not patchedno output

tested: output from ubuntu 24.04 (php8.3-cli) and ubuntu 22.04 (php8.1-cli).

restart every worker

PHP-FPM and apache keep the old code in memory until they restart. a reload is not enough for the configuration mitigations either.

systemctl restart php8.3-fpm

the patch

one commit fixes both CVEs on every supported branch. on PHP 8.3 it changes 392 files, 270 of them tests, adding 10,833 lines and removing 1,020. the excerpts below are copied from that commit.

for CVE-2026-109618, running out of memory no longer jumps out of the code that was running. the allocator records a pending error and lets that code finish, and the request ends at the next safe point. a second, higher limit ends the process outright with _exit(137).

for CVE-2026-109619, request shutdown now clears the globals that code can reach before the next request has started up, and the session upload-progress handler resets its own state before it touches a session.

the multipart parser also loses what made the out-of-memory condition easy to reach: it stops reading once a body runs past post_max_size, and it keeps only the two part headers it uses.

commit 3c832b523ee1 · Arnaud Le Blanc ·

Avoid state corruption via bailout

- Replace bailout on OOM with UnwindExit
  - Properly reset various globals that may be accessed during startup
  
  Fix GHSA-w8hw-w9fx-j79w (CVE-2026-109618)
  Fix GHSA-6wmf-4rv5-p3rp (CVE-2026-109619)

co-authored by Ilija Tovilo, Jakub Zelenka, Nora Dossche, Nicolas Grekas

files
392
tests
270
added
+10,833
removed
−1,020
PHP 8.5 31c0ea7d7ff1PHP 8.4 506e87fa7dcdPHP 8.3 3c832b523ee1PHP 8.2 01a40e89fbfc

CVE-2026-109618+527 −124 in this file

the old out-of-memory handler raised the error and called zend_bailout(), a longjmp() out of whatever was running. the new one records a pending error and returns. past the hard limit the process exits.

@@ -368,31 +380,160 @@ static ZEND_COLD ZEND_NORETURN void zend_mm_panic(const char *message) 	abort(); }  -static ZEND_COLD ZEND_NORETURN void zend_mm_safe_error(zend_mm_heap *heap,-	const char *format,-	size_t limit,   ⋮-	size_t size)+static ZEND_COLD ZEND_NORETURN void zend_out_of_memory(void);+ +static ZEND_COLD void zend_mm_delayed_verror(const char *format, va_list args) {+	if (ZEND_HAS_OOM()) {+		return;+	}  -	heap->overflow = 1;-	zend_try {-		zend_error_noreturn(E_ERROR,   ⋮-	} zend_catch {-	}  zend_end_try();-	heap->overflow = 0;-	zend_bailout();-	exit(1);   ⋮+	EG(delayed_oom).state = ZEND_OOM_STATE_PENDING;+ +	zend_atomic_bool_store_ex(&EG(vm_interrupt), true);+}   ⋮+static ZEND_COLD ZEND_NORETURN void zend_mm_hard_limit_error(zend_mm_heap *heap,+		size_t add_size ZEND_FILE_LINE_DC)+{   ⋮+	_exit(137);+}

what changes for you after the upgrade

  • a new INI setting, memory_hard_limit_percent. left unset, the hard limit is 200% of memory_limit below 1 GB and memory_limit plus 1 GB above that.
  • a request that reaches the hard limit ends the worker with exit status 137, and its shutdown handlers do not run.

how do I detect PHP2Shell attempts?

no single signal is proof either way. PHP's advisory warns that "absence of an error in logs is not proof of safety", and each request shape below also has legitimate uses.

in requests

  • a multipart POST carrying the upload-progress field, by default PHP_SESSION_UPLOAD_PROGRESS.

    Content-Disposition: form-data; name="PHP_SESSION_UPLOAD_PROGRESS"

    applications that use upload progress send it too.

  • multipart/form-data sent with Transfer-Encoding: chunked or with no Content-Length.

    Content-Type: multipart/form-data; boundary=...Transfer-Encoding: chunked
  • hundreds of parts in a small body, many empty file fields, field names nested many levels deep, or a flood of header lines inside one part.

    body size alone tells you little: TU delft saw a body of 1 MB or more in only 424 of 89,575 requests.

in logs

  • PHP fatal errors for exhausted memory on requests that never reached a script, and runs of HTTP 500 or worker restarts right after multipart requests.

    PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 65536 bytes)

on the host

  • a shell or downloader such as sh, curl or wget started by the web server or PHP-FPM account.

    this is evidence the attack already worked. the host needs incident response, not a filter.

public detection rules

Public detection rules for PHP2Shell
emerging threats open (suricata)rulesSIDs 2072548 to 2072554, 2072556, 2072557sourcerules file
cloudflare managed rulesrulesPHP Remote Code Execution Attack (CVE-2026-109618, CVE-2026-109619) #1 to #7sourcecloudflare
nuclei templatesrulesCVE-2026-109618.yaml, CVE-2026-109619.yamlsourceprojectdiscovery
corelight (zeek and suricata)rulesphp2shell-detectsourcecorelight

what can I do if I can't upgrade PHP yet?

PHP's own advisories say only the upgrade is complete: "There is no complete generic configuration mitigation". each stopgap below closes one route and leaves others open, so stack the ones that fit.

Stopgaps for PHP2Shell, what each one closes and what it leaves open
set session.upload_progress.enabled=0per PHP advisoryclosesthe confirmed session routes of CVE-2026-109619leaves openother variants, by PHP's accountwhat it costsupload progress reporting stops. set it with php_admin_value so the application cannot turn it back on, then restart every worker
on PHP 8.5, set fatal_error_backtraces=0per PHP advisoryclosesthe confirmed fatal-backtrace route of CVE-2026-109619leaves openevery other piece of request statewhat it costsa restart of every worker
set memory_limit=-1per PHP advisoryclosesthe controllable out-of-memory failure behind CVE-2026-109618leaves opena failed mmap() still reaches the bugwhat it costsPHP stops limiting its own memory. put a cgroup limit around the workers first, and never use RLIMIT_AS or RLIMIT_DATA
block multipart/form-data at the web serverper PHP advisoryclosesthe multipart routes into both bugsleaves openapplication paths that exhaust memory another waywhat it costsevery file upload breaks. PHP suggests it only for applications that take none
turn on your edge WAF's PHP2Shell ruleper cloudflareclosesknown request shapes that cross the edgeleaves openrequests that reach the origin directly, service-to-service traffic, and on cloudflare an upload-progress field you renamedwhat it costsnone if you already route through it
run a virtual patch on the PHP host (see above)closesthe known request shapes, on every route into the hostleaves opentraffic that reaches the host encrypted, variants the rule does not name, and fields placed past the first 2 KB of the requestwhat it costsno PHP restart. TLS has to end before the host

PHP2Shell questions

is PHP 8.3.35 vulnerable to PHP2Shell?

yes. PHP 8.3.0 through 8.3.35 are vulnerable. 8.3.36 carries the first fix, and 8.3.37 also fixes CVE-2026-115560 and CVE-2026-129481, so install 8.3.37.

which PHP versions fix CVE-2026-109618 and CVE-2026-109619?

PHP 8.2.35, 8.3.36, 8.4.27 and 8.5.12, released on 21 october 2026, fix both. PHP 8.2.36, 8.3.37, 8.4.28 and 8.5.13, released on 19 november 2026, also fix CVE-2026-115560, a session upload progress bug, and on 8.3 and later a gap the first patch left (CVE-2026-129481), so those are the versions to install.

does PHP2Shell affect nginx with PHP-FPM, or only apache with mod_php?

both. mod_php carries the highest risk: the out-of-memory bug was exploited over HTTP there with default settings, before any application code ran. on PHP-FPM the session route of CVE-2026-109619 was validated, and CVE-2026-109618 is susceptible by source analysis with no complete exploit shown. plan as if PHP-FPM is affected.

does an attacker need to be logged in to exploit PHP2Shell?

no. both bugs are in the PHP runtime and are reached while PHP parses the request, so an application's own login does not stand in the way.

does setting session.upload_progress.enabled=0 stop PHP2Shell?

partly. it blocks the confirmed session routes of CVE-2026-109619 and nothing else: not CVE-2026-109618, and not the other ways stale state can be reached. set it where the application cannot override it and restart every worker. PHP suggests leaving it off even after you upgrade if you do not use the feature.

I'm on ubuntu 24.04 and php -v says 8.3.6. am I patched for PHP2Shell?

you can be. ubuntu backported the fix into 8.3.6-0ubuntu0.24.04.13 without changing the upstream version number. check the package version with dpkg -s php8.3-cli, or run php -r 'var_dump(ini_get("memory_hard_limit_percent"));': a patched build prints a string, an unpatched one prints bool(false). that test works on PHP 8.2 and later.

do I need to restart PHP-FPM after installing the PHP2Shell fix?

yes. running PHP-FPM and apache workers keep the old code in memory until they restart, and a reload is not enough.

is PHP 7.4 or 8.1 affected by PHP2Shell, and is there a patch?

yes, and not from PHP as a release. PHP 8.1 and older are end of life. PHP published minimal source backports for 7.4, 8.0 and 8.1, and distributions and long-term-support vendors ship them: ubuntu 22.04's PHP 8.1 is fixed in 8.1.2-1ubuntu2.28. where no backport exists, move to a supported branch or take the system off the network.

can a WAF or cloudflare protect me from PHP2Shell?

for the traffic that crosses it, against the request shapes it knows. an edge rule does not see requests that reach your origin directly or traffic between your own services, and cloudflare notes its rule does not cover an upload-progress field you renamed. keep the rule on and upgrade anyway.

does updating wordpress, drupal or laravel fix PHP2Shell?

no. the bugs are in PHP itself, underneath the application. update PHP.

what is the difference between CVE-2026-109618 and CVE-2026-109619?

CVE-2026-109618 is one request: it runs PHP out of memory at a moment when request memory is half initialised. CVE-2026-109619 is two requests on the same worker: the first leaves a pointer to freed memory behind and the second uses it. one commit fixes both.

is there a public exploit for PHP2Shell?

proof-of-concept code is public and in use: TU delft counted 10,633 requests that reached a code-execution step between 21 october and 19 november 2026. PHP says reliability depends on the PHP build, its extensions, the web server and the memory layout.

what are the limits of blocking PHP2Shell at the kernel?

it is cover, not the fix: PHP still has the bug, and a request shaped differently from the rule gets through. the rule reads cleartext, so TLS has to end before the PHP host, at a load balancer, CDN or sidecar. it can stop real traffic that looks the same (an application that uses upload progress, sends chunked multipart uploads or nests form fields twelve deep), which is what monitor mode is for. it needs linux 6.1 or later, or a red hat enterprise linux kernel, on hosts you run. our test used the request shapes PHP's advisories describe, not a working exploit.

can I block PHP2Shell without restarting PHP?

yes, in front of PHP. every configuration mitigation needs a restart of every worker. a rule on the request path does not: an edge WAF rule, a web-server block on multipart requests, or a virtual patch on the PHP host such as the yeet programmable firewall, which goes live in milliseconds and also sees requests that skipped the edge.

sources

changelog and credits

  1. page published. facts checked against PHP's advisories, the fix commit, NVD and CISA KEV catalog 2026.11.18. firewall rule tested on linux 6.12 against PHP 8.3.35.
  2. the 19 november releases also fix CVE-2026-115560 on every branch, 8.2 included. the fix commit's test count corrected to 270. the virtual patch now shows its rule and says it covers the known request shapes. checked against CVE.org and KEV catalog 2026.11.23.

reported by Ryan at Calif.io, Wiz and OpenAI, and fixed by Arnaud Le Blanc, Ilija Tovilo, Jakub Zelenka and Nora Dossche, as the CVE records credit them. the researchers named it PHP2Shell.

this page is maintained by yeet, which makes the yeet programmable firewall. we are not affiliated with PHP or with the researchers. tell us if something here is wrong.

see the PHP2Shell rule on your own hosts

30 minutes with an engineer who builds yeet. we check where your TLS ends and which kernel you run, and show the rule in monitor mode before it blocks anything.