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.
updated read as markdown
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.
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
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.

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.
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.
| branch | vulnerable | first fixed | install now |
|---|---|---|---|
| PHP 8.5 | vulnerable8.5.0 to 8.5.11 | first fixed8.5.12 | install now8.5.13 |
| PHP 8.4 | vulnerable8.4.0 to 8.4.26 | first fixed8.4.27 | install now8.4.28 |
| PHP 8.3 | vulnerable8.3.0 to 8.3.35 | first fixed8.3.36 | install now8.3.37 |
| PHP 8.2 | vulnerable8.2.0 to 8.2.34 | first fixed8.2.35 | install now8.2.36 |
| PHP 8.1 and olderend of life | vulnerableall releases | first fixedno PHP release | install 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 | package | first fixed package | version number | advisory |
|---|---|---|---|---|
| debian 13 | packagephp8.4 | first fixed package8.4.27-1~deb13u1 | version numbermoves to the fixed release | advisoryDSA-6574-1 |
| debian 12 | packagephp8.2 | first fixed package8.2.35-1~deb12u1 | version numbermoves to the fixed release | advisoryDLA-4848-1 |
| ubuntu 24.04 | packagephp8.3 | first fixed package8.3.6-0ubuntu0.24.04.13 | version numberstays the same | advisoryUSN-8948-1 |
| ubuntu 22.04 | packagephp8.1 | first fixed package8.1.2-1ubuntu2.28 | version numberstays the same | advisoryUSN-8948-1 |
| RHEL 10 | packagephp | first fixed package8.3.36-1.el10_2 | version numbermoves to the fixed release | advisoryRHSA-2026:87070 |
| RHEL 9 | packagephp:8.3 module | first fixed package8.3.36-1.module+el9.8.0+25109+6886e21a | version numbermoves to the fixed release | advisoryRHSA-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.
- vulnerable
PHP 8.3.35 (cli) (built: Sep 25 2026 17:43:54) (NTS) - first fix
PHP 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.
- no fix
bool(false) - fix present
string(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.
- patched
- debian/patches/CVE-2026-109618_109619.patch: Avoid state corruption via - not patched
no 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.
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
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.
CVE-2026-109618+188 −27 in this file
the multipart parser stops reading a body that has run past post_max_size, and stores only Content-Disposition and Content-Type from each part, once.
CVE-2026-109619+48 −2 in this file
request shutdown clears state that the next request can reach before its own startup. the first hunk is the new setting the patched-build check above looks for.
CVE-2026-109619+56 −11 in this file
upload progress runs before the session module is initialised for the request. it now resets the session globals first, and stops if the session did not come up cleanly.
what changes for you after the upgrade
- a new INI setting,
memory_hard_limit_percent. left unset, the hard limit is 200% ofmemory_limitbelow 1 GB andmemory_limitplus 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.applications that use upload progress send it too.
multipart/form-datasent withTransfer-Encoding: chunkedor with noContent-Length.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.
on the host
a shell or downloader such as
sh,curlorwgetstarted 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
| rule set | rules | source |
|---|---|---|
| emerging threats open (suricata) | rulesSIDs 2072548 to 2072554, 2072556, 2072557 | sourcerules file |
| cloudflare managed rules | rulesPHP Remote Code Execution Attack (CVE-2026-109618, CVE-2026-109619) #1 to #7 | sourcecloudflare |
| nuclei templates | rulesCVE-2026-109618.yaml, CVE-2026-109619.yaml | sourceprojectdiscovery |
| corelight (zeek and suricata) | rulesphp2shell-detect | sourcecorelight |
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.
| stopgap | closes | leaves open | what it costs |
|---|---|---|---|
set session.upload_progress.enabled=0per PHP advisory | closesthe confirmed session routes of CVE-2026-109619 | leaves openother variants, by PHP's account | what 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 advisory | closesthe confirmed fatal-backtrace route of CVE-2026-109619 | leaves openevery other piece of request state | what it costsa restart of every worker |
set memory_limit=-1per PHP advisory | closesthe controllable out-of-memory failure behind CVE-2026-109618 | leaves opena failed mmap() still reaches the bug | what 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 advisory | closesthe multipart routes into both bugs | leaves openapplication paths that exhaust memory another way | what it costsevery file upload breaks. PHP suggests it only for applications that take none |
| turn on your edge WAF's PHP2Shell ruleper cloudflare | closesknown request shapes that cross the edge | leaves openrequests that reach the origin directly, service-to-service traffic, and on cloudflare an upload-progress field you renamed | what 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 host | leaves opentraffic that reaches the host encrypted, variants the rule does not name, and fields placed past the first 2 KB of the request | what 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
from the PHP project
- PHP security advisory: RCE via OOM corruptionCVE-2026-109618
- PHP security advisory: RCE via stale global stateCVE-2026-109619
- php.net: critical remote code execution vulnerabilities, update nowrelease announcement, 21 oct 2026
- php-src: Avoid state corruption via bailoutthe fix, PHP 8.3 branch
- PHP security advisory: use-after-free after interrupted session shutdownCVE-2026-129481, the incomplete fix
- the PHP foundation: today's PHP security releasediscovery and disclosure account
government and CERT
- CISA known exploited vulnerabilities catalogadded 26 oct 2026
- CISA alert: critical vulnerabilities in PHP require immediate patching21 oct 2026
- NVD: CVE-2026-109618CVSS 3.1 9.8
- NVD: CVE-2026-109619CVSS 3.1 8.1
- NCSC-NL: php2shellinventory of products that embed PHP
researchers
- calif: PHP2Shellthe first reporter's write-up
- wiz: php2shell.comorigin of the name
- TU delft: PHP2Shell exploitation trackerlive honeypot counts
vendors and distributions
- amazon: PHP2Shell exploitation prior to public disclosurefirst attempt, 17 oct 2026
- unit 42: threat briefPAN-OS exploitation
- cloudflare: PHP vulnerabilities and WAF protectionedge rule coverage and its limit
- ubuntu: USN-8948-1package versions
- debian security trackerpackage versions
changelog and credits
- 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.
- 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.