Critical PHP vulnerability: unauthenticated RCE, update now
On October 21, the PHP team published the kind of advisory nobody wants to read: two flaws that allow remote code execution on the server, without login, on practically every installation that serves web requests. It's a critical PHP vulnerability with a CVSS v4.0 score of 9.2. More than three weeks have passed since then. If you have a forgotten WordPress on a VPS, a legacy Laravel app, or that internal dashboard "nobody touches", this post is for you.
My daily work is TypeScript, Bun, and Postgres. Even so, I inherit PHP all the time: client sites, old plugins, an API someone wrote in 2017. I think a lot of people here are in the same spot.
What happened with PHP
The official advisory on php.net describes two CVEs:
- CVE-2026-109618, RCE via corruption on OOM. When PHP runs out of memory in the middle of processing, it can be interrupted while internal request data is only partially initialized. During request cleanup, that invalid data is treated as valid.
- CVE-2026-109619, RCE via stale global state. Some internal state that belongs to a request survives after its memory has been freed. The next request that lands on the same worker can use that garbage before normal initialization resets everything.
The fixed versions are 8.5.12, 8.4.27, 8.3.36, and 8.2.35. PHP 8.6.0 RC4 and later also ship with the patch.
Who is exposed: PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP, and LiteSpeed. In other words, almost everyone. The team considers the risk highest on mod_php, where there is a demonstrated exploit in which an unauthenticated request triggers the attack before any application code runs.
That last detail is what matters most.
Why this flaw is worse than the usual ones
Most PHP security flaws I see come from the application: SQL injection in a form, unvalidated uploads, unserialize on user input. You fix your code, deploy, and you're done.
Here the problem is in the runtime. Your code can be perfect, with validation everywhere, tests, CSP, and a WAF configured. It doesn't matter. The attack happens during request parsing, before your index.php even executes.
When the bug is in the runtime, the quality of your code won't protect you.
There's a second point. The global state bug depends on worker reuse. An FPM worker serves thousands of requests in its lifetime. If a malicious request leaves junk behind, the next one, which may belong to another user, steps on it. The very model that makes PHP fast in production is what opens the door.
People coming from the Node/Bun world should pay attention here. We live with long-running processes and in-memory state between requests. The type of bug is different, but the lesson is the same: anything that survives from one request to the next is attack surface.
How to tell if my server is vulnerable
First, find out which PHP is actually running. The one in your terminal and the one in FPM can differ, and that fools a lot of people.
# CLI version
php -v
# FPM version (the binary name varies by distro)
php-fpm8.3 -v
# or create a temporary file and open it in the browser
echo '<?php echo PHP_VERSION;' > /var/www/html/v.php
Once you've checked, delete v.php. Don't trade one security problem for another.
If the version is lower than 8.5.12, 8.4.27, 8.3.36, or 8.2.35 on its respective branch, you are vulnerable.
On Linux distros, the "upstream" version can be misleading. Debian and Ubuntu backport fixes and keep the old number. So check the package changelog:
apt changelog php8.3-fpm | grep -i "CVE-2026-10961"
If the CVE shows up, the patch is there. Distros and LTS vendors received the fixes before disclosure, so the packages should be available.
On Docker, it's simpler: pull the new image and rebuild. If your Dockerfile uses php:8.3-fpm without pinning the patch, a docker pull solves it. If it pins something like php:8.3.30-fpm, change the tag.
What about PHP 8.1 or older?
Here comes the uncomfortable part. PHP 8.1 and earlier no longer get updates from the project. Given the severity, the security team made an exception and published minimal source backports for 7.4, 8.0, and 8.1, in branches on the php-src GitHub. That helps people who compile from source, but it isn't a ready-made package.
In practice, you have three paths:
- Use an LTS vendor or distro that backports fixes.
- Compile with the minimal patch, if you know what you're doing.
- Migrate to a supported version.
While we're on the subject: PHP 8.2 reaches end of life on December 31, 2026. If you're touching the stack now, don't stop at 8.2. Go straight to 8.4 or 8.5 and avoid repeating this exercise two months from now.
I can't update today. Now what?
It happens. A client who won't approve a maintenance window, a server nobody knows who set up. The official advisory lists mitigations and makes it clear that they reduce exposure, but they don't make the installation safe. Think of them as a bandage until surgery.
For the OOM flaw:
; in the FPM pool, so the application can't override it
php_admin_value[memory_limit] = -1
php_admin_value[post_max_size] = 8M
php_admin_value[upload_max_filesize] = 6M
memory_limit=-1takes the flaw that's controllable through PHP's memory limit off the table. Check that no pool, directory, or.htaccesssets a finite limit back.- Keep
post_max_sizelow: 8M if the application doesn't handle uploads, 32M if it does.upload_max_filesizealways below it. - Use a container or cgroup limit as an availability barrier, ideally killing only the affected worker. No
RLIMIT_ASorRLIMIT_DATA, because they can trigger exactly the vulnerable allocation failure. - Set limits on the proxy or web server for request size, number of fields, multipart parts, and headers. That includes requests without a usable
Content-Length.
For the global state flaw:
session.upload_progress.enabled = 0
; PHP 8.5 only
fatal_error_backtraces = 0
Put this in php.ini or the FPM pool and restart all workers. ini_set() and .user.ini won't work, because they run too late.
It's also worth cleaning up invalid or deprecated settings that raise warnings before initialization. And a warning here: hiding the error with @, display_errors=0, or error_reporting does nothing. The bug happens anyway. You just stop seeing it.
About session.upload_progress: two days later, another informational advisory came out (CVE-2026-115560) recommending you disable this option until the next fix release. If you don't use PHP's native upload progress bar, and almost nobody does, turn it off and forget about it.
What I'd take from this for my workflow
My strong opinion: if you can't tell in 30 seconds which runtime version is in production, your problem isn't this CVE. It's inventory. This CVE just made it visible.
A few cheap changes I adopted and recommend:
- Pin the runtime version in a single place (
Dockerfile,.tool-versions, or equivalent) and treat patch updates as routine, not as an event. - Subscribe to the security feed of the languages you run. PHP gave notice a day early, on October 20, with the release date and time. Anyone subscribed had time to prepare.
- Keep a list of your "forgotten" sites and servers. Every dev has one. Mine was a WordPress site for a 2021 event that was still online. Yes, I laughed nervously.
The good news is that the process worked. Advance notice, patches for four supported branches, out-of-cycle backports for dead versions, and well-documented mitigations. Plenty of languages with more money behind them don't do half of that.
Now the part that's up to you: updating. I did it on the projects I maintain, including some that are here in my portfolio. It took less time than writing this post.
LinkedIn summary
A critical PHP flaw lets attackers run code on your server without logging in, and your code won't protect you. There are two CVEs rated 9.2, and the attack runs before your index.php. Validation, tests, and a WAF make no difference when the bug lives in the runtime. PHP-FPM, mod_php, FrankenPHP, and LiteSpeed are exposed. The fixed versions are 8.5.12, 8.4.27, 8.3.36, and 8.2.35. My take: if you can't tell in 30 seconds which version runs in production, the problem isn't the CVE. It's inventory. I updated my projects and found a WordPress site from 2021 still online. I laughed nervously. I wrote a step-by-step guide to check and mitigate. If you inherit PHP like I do, it's worth a look. #PHP #InfoSec #CyberSecurity #DevOps #WebDev #Backend