Back to the blog
SecurityPHPDevOps

PHP RCE: the two critical flaws and how to protect yourself

November 06, 2026·7 min read·Diego Horvatti

On October 21, the PHP team published the kind of notice nobody likes to read: two PHP RCE flaws, both with a CVSS of 9.2. They let someone with no login run code on your server. In at least one scenario, the attack happens before a single line of your application runs. If you run a client's WordPress, an old Laravel app or that admin panel nobody remembers building, this post is for you.

The official announcement is in the php.net news archive. I'll sum up what matters and tell you what I would do in your place.

What happened to PHP

There are two different bugs. Both live in the request lifecycle, not in some obscure extension.

The first is CVE-2026-109618. When PHP runs out of memory in the middle of starting up a request, some internal data is left half built. When it's time to clean up the request, PHP treats that garbage as valid data. Corrupted memory under attacker control is the classic recipe for remote code execution.

The second is CVE-2026-109619. State that belongs to one request survives after its memory has been freed. The next request served by the same worker can use that stale state before PHP resets everything. It's a use-after-free across requests.

These are the patched versions:

  • PHP 8.5.12
  • PHP 8.4.27
  • PHP 8.3.36
  • PHP 8.2.35

8.6.0 RC4 already ships with the fix too. If you're testing an earlier RC, update.

Who is exposed to this PHP RCE

Short answer: almost everyone serving web requests with PHP. The notice lists PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP and LiteSpeed. The CLI running cron isn't the main problem. The problem is the PHP that takes traffic from the internet.

According to the team itself, the highest risk is mod_php. There's a demonstrated exploit where an unauthenticated request triggers the attack before the application code. That means your auth middleware, your in-framework WAF and your input validation are useless here. PHP goes down before it ever reaches them.

When the flaw is in the runtime, the best written code in the world won't protect you.

There's a detail that catches a lot of people: PHP 8.1 and earlier no longer get updates from the project. Given the severity, the team published minimal source backports for 7.4, 8.0 and 8.1. That helps people who compile by hand. For everyone else, the way out is your distribution, an LTS vendor or moving to a newer version.

And a calendar reminder: PHP 8.2 reaches end of life on December 31, 2026. If you're touching it now, jump straight to 8.4 or 8.5.

How to check and update your server

Start by finding out what is really running. Don't trust what the README says.

# binary version
php -v

# version FPM is serving (can differ from the CLI!)
php-fpm8.3 -v

# in a container
docker exec my-app php -v

I've seen servers with the CLI on 8.3 and FPM stuck on an old package, because someone installed two versions from the PPA and forgot. Check both.

If you use Docker, look at the base image tag:

# floating tag: only picks up the fix if you rebuild
FROM php:8.3-fpm

# pinned tag: explicit, but you have to bump the number
FROM php:8.3.36-fpm

With a floating tag, the fix only lands when the image is rebuilt with --pull. An image built in September and deployed today is still vulnerable. With a pinned tag, you have to change the number. I prefer pinned: it shows up in the diff and everyone sees it.

On Debian or Ubuntu servers, the distributions got the patches before the announcement. Usually an apt update && apt upgrade and a service restart is enough. Really restart it. An FPM worker that stays up keeps using the old binary loaded in memory.

sudo systemctl restart php8.3-fpm
# or, on Apache with mod_php
sudo systemctl restart apache2

On shared hosting, open a ticket and ask for the exact version. "We're on 8.3" isn't enough. You want to hear "8.3.36".

What if I can't update today?

It happens. Some clients require a maintenance window, some legacy servers have no new package, people go on vacation. The notice includes mitigations, with an honest warning: they cut down known attack paths, but they don't make the install safe. Use them as a bandage while you schedule the update.

For the out-of-memory flaw (109618):

  • Set memory_limit=-1 in a way the application can't override, like php_admin_value in the FPM pool or in the Apache config. Make sure nothing else puts a finite limit back.
  • Lower post_max_size. No uploads, 8M. With uploads, 32M. Keep upload_max_filesize below that.
  • Limit body size, number of fields, multipart parts and headers in Nginx or your proxy. That includes requests without a usable Content-Length.
  • Use a container or cgroup memory limit as the ceiling, ideally killing only the affected worker. Don't use RLIMIT_AS or RLIMIT_DATA, because they trigger exactly the vulnerable allocation failure.

Removing PHP's memory limit feels strange, and it is. The idea is to remove the memory failure the attacker can control and let the container cap the usage.

For the stale state flaw (109619):

; php.ini or FPM pool, never via ini_set() or .user.ini
session.upload_progress.enabled = 0

; PHP 8.5 only
fatal_error_backtraces = 0

After that, restart every worker. The config has to apply before request parsing, which is why ini_set() inside the application does nothing.

The notice also asks you to remove invalid or deprecated settings that produce diagnostics before startup, and to fix fatal errors and timeouts an attacker can trigger. Hiding the error with display_errors=0 or @ doesn't help. The vulnerable path runs just the same.

Two days later, an extra notice came out about session.upload_progress, citing a third CVE (CVE-2026-115560) with a full advisory promised for the next bugfix release. In other words: turn that option off even after updating. Almost nobody uses it on purpose.

What this changes for people who aren't "PHP devs"

My daily stack is TypeScript, Bun and Postgres. Even so, I've been in this spot more than once. PHP sneaks into the project through the back door: the company blog on WordPress, the legacy system the React front end talks to, the phpMyAdmin someone put up "just to debug" in 2021.

The problem is rarely knowing there's a flaw. The problem is not knowing where PHP is running. So the practical lesson is an inventory:

  • List every service that answers HTTP and write down the runtime and exact version.
  • Prefer pinned image tags and a bot (Renovate, Dependabot) opening a PR when a patch ships.
  • Have a way to rebuild and restart everything in minutes, not days.

The "PHP is dead" joke comes back every week on Twitter. Dead, nothing. It runs a huge slice of the web, and that's exactly why a flaw like this is so serious. A popular runtime is a popular target. The same goes for Node, Bun or whatever you use: one day the notice will be about your stack.

My take

The PHP team did a good job here. They gave a day's warning, shipped patches for four supported versions, sent early fixes to the distributions and even published backports for dead versions. And they explained the mitigations without pretending they solve the problem. That's how a mature open source project should handle a critical flaw.

The part that's on you is boring and simple: find where PHP runs, update and restart the workers. If you have a server with mod_php exposed to the internet and you haven't updated yet, stop reading and go do it now. The rest can wait.

If you want to see how I handle deploys and updates in my projects, take a look at what I'm building.

LinkedIn summary

Two PHP flaws rated 9.2 let someone with no login run code on your server.

On mod_php, the attack happens before your application runs. Auth middleware and input validation never even get called.

When the flaw is in the runtime, the best written code in the world won't protect you.

The fix is boring and simple: check the CLI version and the FPM version (they can differ), update to 8.3.36, 8.4.27 or 8.5.12 and restart the workers.

The hard part is almost never knowing about the flaw. It's finding out where PHP is running: the client's WordPress, the legacy dashboard, that forgotten phpMyAdmin.

I wrote a full guide with mitigations for anyone who can't update today. The link is in the comments.

#PHP #CyberSecurity #DevOps #WordPress #Laravel