php2shell: Cloudflare Blocked It, So We Are Done? — Not Until You Upgrade PHP. Why Running Out of Memory Is the Trigger, and Three Things to Check Now
The bug lives inside the PHP runtime. The attacker pushes memory to choose where a request stops. My notes said "FPM kills the worker, so it is fine". In Docker, both FPM and mod_php kept the same worker for the next request
Two PHP vulnerabilities came out on October 21. People call them php2shell. On Korean and Japanese timelines the most repeated line was "Cloudflare blocked it before disclosure". That is true, and it is not the end. After reading this you will get why the bug happens from one picture, and you can check your own server in five minutes: the version, how PHP runs, and one setting.
I don't describe how to attack. Only why it happens.
The bug is inside PHP
This is not a WordPress plugin problem. The bug is in the PHP runtime, so updating your site code or plugins does not fix it. Any PHP that serves web requests is affected. The official PHP notice lists PHP-FPM, Apache mod_php, php-cgi, FrankenPHP and LiteSpeed. The score is CVSS v4.0 9.2. A 10.0 circulated before release; according to Tenable's write-up, that score was wrong.
Running out of memory is the trigger, not the bug
When PHP goes over memory_limit, it raises a fatal error and ends the request right there. It does not finish what it was doing. It jumps out. Normally that is a safety net.
The trouble starts when "what it was doing" is half done. In plain words, the official notice says:
CVE-2026-109618: PHP runs out of memory while it is building request data (a multipart body, for example). The data is half built, but the request cleanup code treats it as valid and frees it
CVE-2026-109619: after a request ends with a fatal error, a reference to its internal state survives even though the memory behind it is freed. When the same worker takes the next request, it uses that dead reference before normal initialization resets it. The confirmed paths are session upload progress and PHP 8.5's
fatal_error_backtraces
The attacker can't change your PHP code. What they can do is push memory so that the stop happens where they want. Memory exhaustion is not the vulnerability. It is the trigger that makes a rare halfway stop happen on demand. If you take one line from this post, take that one.
"FPM kills the worker, so it is fine" turned out wrong
When I first noted this topic, I wrote: on a fatal error FPM kills the whole worker process, so the dead reference dies with it. mod_php keeps the worker alive and carries it into the next request. That is why mod_php is the worst.
I checked it in Docker. The official images php:8.4-fpm (behind nginx) and php:8.4-apache (mod_php), both PHP 8.4.28. One worker each. I alternated a page that prints the PID with a page that deliberately goes over memory_limit (128M).
order FPM (pm=static, 1) mod_php (prefork, 1)
pid.php pid=7 pid=17
oom.php pid=7 Fatal error pid=17 Fatal error
pid.php pid=7 pid=17
oom.php pid=7 Fatal error pid=17 Fatal error
pid.php pid=7 pid=17
Both kept the same worker for the next request. The FPM log has no line about a child exiting. A fatal error while running code does not make FPM kill the worker either. My note was wrong.
So why is mod_php the worst? The GitHub advisory (GHSA-w8hw) answers it. The difference is what happens when request startup fails. FPM ends the child at that point. mod_php runs the request shutdown no matter what, even when startup failed, so it cleans up half-built data before any app code runs. For 109619, the advisory says a path was validated on FPM too: startup succeeds, a fatal error happens while running, and the same worker takes the next request. Running FPM is no reason to relax.
The advisory lists pm.max_requests=1 (a fresh worker for every request) as an FPM option, so I tried it. The PID changed every time: 7, 8, 9, 10. It costs speed. On Docker for Mac, three runs of 300 sequential curl requests went from 6.5–7.0 ms to 8.2–9.6 ms per request. That's a rough number, and on a real server the gap depends on opcache. Use it to hold the line until you upgrade.
How much does the WAF block?
Cloudflare turned the rules on by default for every free and paid WAF from 03:02 UTC on October 21, about nine hours before disclosure. It is the first use of a feature called full transaction detection. It looks not only at the request but also at the origin's response in the same HTTP transaction, and can block there. In other words, the request alone is sometimes not enough to tell normal from attack.
It is still first aid. I see two gaps.
It only sees traffic that goes through Cloudflare. A request straight to the origin IP gets no check at all (Tenable's write-up). Check that your DNS record is proxied (orange cloud) and that the origin refuses requests from outside Cloudflare
Cloudflare itself writes that sites which changed
session.upload_progress.nameare not covered by the rule, and that patching is still required. It also saw attackers keep mutating payloads to get past the rules
Attacks are real. According to Tenable's roundup, CISA added both CVEs to KEV (its list of exploited bugs) on October 26, and Trail of Bits confirmed exploits against pre-patch 8.2 through 8.5. The PHP team said it saw no working exploit at disclosure. Two weeks changed that.
Three things to check now
1. Version. The fixed versions are 8.5.12 / 8.4.27 / 8.3.36 / 8.2.35. PHP 8.1 and older no longer get releases from the PHP project. 7.4 to 8.1 have minimal source backports only, and anything older has no fix. Whether your distro or LTS vendor shipped a backport is something you check with them.
And today you go one step further. On November 19 another set of security releases came out: 8.5.13 / 8.4.28 / 8.3.37 / 8.2.36. The NEWS file in the 8.4.28 source lists three more session CVEs fixed (CVE-2026-115560, 126714, 129481), and the SimpleXML crash in 8.4.27 that Tenable pointed out (GH-24488) is fixed there too. If you upgrade, go to the latest.
One thing I checked with Docker images: pulling the tag php:8.1-apache gave 8.1.34. 8.1 has no official fix, so anything on that tag is still exposed.
2. How PHP runs. The CLI php -v and the PHP behind your web server are often different. Check from the web. Upload this file for a moment, open it, and delete it right after.
<?php
echo PHP_VERSION, ' ', PHP_SAPI, ' upload_progress=', ini_get('session.upload_progress.enabled');
apache2handler means mod_php. That's the riskiest, so upgrade it first. fpm-fcgi means FPM.
3. One setting: session.upload_progress.enabled. This is for holding on until you can patch. The PHP notice says set it to 0 and restart every worker. It says plainly that ini_set() or FPM's .user.ini will not do. memory_limit=-1 is also listed, but it has to be set so the app can't override it, and even then a real allocation failure can still reach the bug. Hiding errors with display_errors or @ doesn't help. In the notice's own words, these measures reduce exposure "but do not make an installation safe."
While measuring I found one more thing. Run the official images without a php.ini and this value differs by version.
image upload_progress default
php:8.4.26 1
php:8.4.27 1
php:8.4.28 0
php:8.5 (8.5.13) / 8.3 (8.3.37) / 8.2 (8.2.36) 0
php:8.1 (8.1.34) 1
In the 8.4.28 source, the compiled default in ext/session/session.c changed from "1" to "0". But the comment in php.ini-production from the same source still says ;session.upload_progress.enabled = On, and I couldn't find a line about the default change in NEWS. If your site shows upload progress, that feature may have quietly stopped after the November upgrade. If your php.ini sets the value explicitly, that value stays. Either way, check your own server with the file above.
What to do, and when
| Action | What it stops | When |
|---|---|---|
| Cloudflare WAF rules (on paid plans, confirm Block mode) | Known patterns through the proxy | Today. If already on, just confirm |
| Settings like upload_progress=0 or max_requests=1 | Some confirmed paths | Holding on when you can't upgrade yet |
| Upgrade to the latest PHP patch and restart workers | The bug itself | The real fix. As soon as you can |
If you stop at the WAF, the day your origin is reachable or a variant gets past the rules, you are open. On 8.1 or older there is no patched version at all, so the upgrade plan comes first.
If you have an old PHP server you need to upgrade but haven't touched because you don't know what will break, ask us at https://www.negabaro.com/contact. We also take on version upgrades together with an infrastructure check.
How It Works
Running out of memory is the trigger: it makes the fatal error fire at a halfway point, so half-built data or freed memory gets used
A fatal error while running kills the worker in neither FPM nor mod_php (same PID in Docker); mod_php is worst because it runs shutdown even after startup fails
The WAF only sees traffic through Cloudflare; close direct access to the origin IP, and patch anyway
Fixed in 8.5.12 / 8.4.27 / 8.3.36 / 8.2.35; today go to the November releases (8.4.28 and friends); 8.1 and older get no official release
Check PHP_VERSION, PHP_SAPI and upload_progress from the web; from 8.4.28 the compiled default is 0
Use Cases
References
- PHP — 2026-10-21 security announcement (CVE-2026-109618, 109619)
- GitHub — GHSA-w8hw-w9fx-j79w (state corruption on out-of-memory)
- GitHub — GHSA-6wmf-4rv5-p3rp (stale state in the next request)
- Cloudflare — WAF protection for php2shell and full transaction detection
- Tenable — php2shell FAQ (exploitation status, KEV)
- PHP — 2026-11-19 security releases (8.5.13, 8.4.28, 8.3.37, 8.2.36)