PHP2Shell and the Node Brotli RCE: what broke in October 2026 and how to patch it

PHP and Node.js both shipped critical fixes on October 21, 2026. What PHP2Shell and the Node Brotli bug are, how to check your servers, and how to patch them properly.

A Mohammed Habib Oct 23, 2026 11 min read 140 views Updated Oct 24, 2026
Cover for PHP2Shell and the Node Brotli RCE: what broke in October 2026 and how to patch it

On October 21, 2026, PHP and Node.js both shipped emergency security releases on the same day. Each one fixes a bug that lets a stranger on the internet run code on your server without logging in. If you self-host anything — a WordPress site, Nextcloud, a Node API, a router web UI — at least one of them probably applies to you.

TL;DR - PHP: upgrade to 8.5.12, 8.4.27, 8.3.36 or 8.2.35 (or your distro's backport), then restart PHP-FPM / Apache. - Node.js: upgrade to 26.12.1, 24.22.1 or 22.23.4, then restart every Node service. Node 18, 20 and 25 get no fix. - Upgrading the package is only half the job. A process that started before the upgrade keeps running the old, vulnerable code until you restart it.

This guide is written for people who run their own servers but aren't security specialists. I'll explain what each bug is in plain terms, how to check your own machines with read-only commands, and how to fix them on the common platforms. There are no exploit details here.

Two words you'll need

  • Runtime: the program that actually executes your code. For a PHP site that's php-fpm, mod_php inside Apache, or similar. For a Node app it's the node binary.
  • Worker: a long-running runtime process that handles requests. PHP-FPM keeps a pool of them alive so it doesn't have to start PHP for every page view. That's fast, but it also means a worker can keep running old code for days.

Keep the second one in mind. It's the part most people get wrong.

PHP2Shell: what broke

"PHP2Shell" is the nickname for two bugs in PHP itself — not in WordPress, Laravel or any plugin:

  • CVE-2026-109618 — memory corruption when PHP runs out of memory while parsing a request.
  • CVE-2026-109619 — PHP reuses some global state from an earlier request when it shouldn't.

Each is rated 9.2 (Critical) on CVSS v4. Both are reachable by an unauthenticated request, before your application code even runs. That's why your framework or plugins don't matter here: the bug sits in the layer underneath them.

What's affected: any PHP that serves web requests. mod_php (PHP loaded inside Apache) is the worst case, and PHP-FPM, php-cgi, FrankenPHP and LiteSpeed are all in scope too. Researchers don't fully agree on which setups have a proven full exploit, so treat all of them as vulnerable. PHP on the command line only (cron scripts, Composer) isn't the target.

Timeline: the first exploitation attempts were seen around October 17. Fixed versions came out on October 21, and watchTowr reported attacks in the wild the same week. Public proof-of-concept code exists. Assume scanning has already reached your IP.

Fixed versions: 8.5.12, 8.4.27, 8.3.36 and 8.2.35. PHP 8.1 and older get no official release. If you're on one of those, you need a vendor backport (your distro, cPanel, CloudLinux and so on) or an upgrade to a supported branch.

Node.js CVE-2026-111497: the Brotli bug

Brotli is a compression format, like gzip. Node ships its own copy of the Brotli decoder. The bug: a specially broken Brotli stream makes the decoder write past the end of a small internal buffer. That kind of memory corruption can end in remote code execution.

Your Node app is exposed if it decompresses Brotli data it doesn't control. The common ways that happens:

  • fetch() responses. Node's built-in fetch asks servers for Brotli by default and decodes the reply for you. A malicious or compromised server you call can send a poisoned response.
  • Request bodies with Content-Encoding: br, if your framework or middleware decompresses uploads.
  • WebSocket messages, if your setup uses compression.

Node rates the bug High. The CVE record itself carries a CVSS v4 score of 9.2. The same release fixes nine more vulnerabilities, including TLS hostname-check problems and DNS name handling bugs, so upgrading matters even if you're sure you never touch Brotli.

Fixed versions: 26.12.1, 24.22.1 and 22.23.4. Node 18, 20 and 25 are end-of-life and won't be fixed. If you run one of them, the only fix is moving to a supported major.

How to check your servers (read-only)

You're answering three questions:

  1. Which runtime version is actually running?
  2. Is it older than the fixed version?
  3. Did the running processes restart after the upgrade?

None of the commands below change anything.

Step 1: list every PHP and Node on the machine

# PHP binaries that exist on this machine
for b in php php-fpm php-fpm8.2 php-fpm8.3 php-fpm8.4 php-fpm8.5; do
  command -v "$b" >/dev/null && "$b" -v | head -1
done

# Installed PHP packages
dpkg -l 'php*' 2>/dev/null | awk '/^ii/ {print $2, $3}'   # Debian / Ubuntu
rpm -qa 'php*' | sort                                     # RHEL, Rocky, Alma
apk info -v 2>/dev/null | grep '^php'                     # Alpine

# Node on the host
node -v; which -a node

Then check inside your Docker containers. A container has its own PHP or Node, completely separate from the host's:

docker ps --format '{{.Names}}' | while read -r c; do
  printf '%-28s ' "$c"
  docker exec "$c" sh -c 'php -v 2>/dev/null | head -1; node -v 2>/dev/null' | tr '\n' ' '
  echo
done

A blank result means that container has neither runtime. Don't trust image tags on their own: node:22-alpine can point to a build from before the fix.

Step 2: compare against the fixed versions

Runtime Safe at or above Notes
PHP 8.2.35 · 8.3.36 · 8.4.27 · 8.5.12 compare within your branch
Node 22.23.4 · 24.22.1 · 26.12.1 18, 20, 25: no fix exists

One catch on Debian and Ubuntu: distros often fix the bug without changing the version number much (a "backport"). So php -v showing an older-looking 8.x version can still be patched. To be sure, search the package changelog for the CVE number:

zcat /usr/share/doc/php8.*/changelog.Debian.gz | grep -m1 -E '10961[89]'

A match means your distro has patched it.

For Node, check your distro's security tracker before trusting its nodejs package. Some distro builds link the system Brotli library instead of Node's bundled copy, so they're only fixed once that library is. At the time of writing, Debian 13 (trixie) still lists Brotli as unfixed. The simplest route there is the NodeSource repository or the official Node builds.

Step 3: check the processes, not just the package

This is the step most guides skip. After you upgrade PHP, dpkg happily reports the new version while every PHP-FPM worker is still running the old code it loaded at startup. You can see this in /proc:

for p in $(pgrep -f php-fpm); do
  printf '%s %s\n' "$p" "$(readlink /proc/$p/exe)"
done

If a line ends in (deleted), that process is running a program file that has since been replaced on disk. The package is patched, but the process isn't. Restart the service and run the check again.

The Node version of this question is "which node does my service really use?" Run systemctl cat <service> to see the path in ExecStart, then run that exact path with -v. If you use nvm, the node in your shell is often not the one your service runs.

Step 4: look at what the internet sees

Version checks tell you what's installed. This tells you what a stranger can find out about you:

curl -sSI https://your-site.example/ | grep -iE '^(server|x-powered-by):'
curl -sS -o /dev/null -w '%{http_code}\n' https://your-site.example/status.php

A header like X-Powered-By: PHP/8.3.12, or a public phpinfo() page, isn't the vulnerability itself. It just tells attackers exactly which servers to try first. Hide both.

How to fix it

The order is the same everywhere: upgrade, restart, verify.

Test, patch, restart, verify — with the fixed build matrix

Debian / Ubuntu

sudo apt update
sudo apt install --only-upgrade 'php8.3*'   # use your branch: 8.2, 8.3, 8.4 or 8.5
sudo systemctl restart php8.3-fpm           # or: sudo systemctl restart apache2

--only-upgrade updates what's already installed without adding anything new.

RHEL, Rocky, AlmaLinux

sudo dnf upgrade --refresh 'php*'
sudo systemctl restart php-fpm

Alpine

apk update && apk upgrade
rc-service php-fpm83 restart   # match your version

Docker

Restarting a container isn't enough. It restarts the same old image. Change the base image to a fixed version and rebuild:

FROM php:8.3.36-fpm-alpine
# or
FROM node:22.23.4-alpine
docker build --no-cache -t yourapp .
docker compose up -d

For images you don't build yourself (Nextcloud AIO, mailcow, app-store apps), pull the vendor's updated image and recreate the containers. If the vendor hasn't shipped a fixed image yet, you're still exposed. Limit who can reach that app until they do.

cPanel and shared hosting

Update EasyApache PHP packages through WHM, or ask your host to confirm they've deployed patched builds. On versions older than 8.2 you depend on their backports, such as CloudLinux alt-php.

Node from NodeSource

sudo apt update
sudo apt install --only-upgrade nodejs
node -v
sudo systemctl restart your-app      # or: pm2 reload all

Verify, for real

php -v | head -1
node -v
for p in $(pgrep -f php-fpm); do readlink /proc/$p/exe; done | sort -u

You're done when the versions are at or above the fixed builds and no line says (deleted).

If you can't patch today

These reduce the risk. They don't remove it. PHP itself says no setting fully protects you.

  • PHP: set session.upload_progress.enabled = 0 in php.ini, and on PHP 8.5 also fatal_error_backtraces = 0. This closes some attack paths, not all of them. Restart PHP afterwards.
  • Node: if nothing you run needs compressed uploads, reject them at your nginx reverse proxy:

nginx if ($http_content_encoding ~* br) { return 415; }

This doesn't help with fetch() responses. - Shrink your exposure: put admin panels behind a VPN or an IP allow-list instead of the open internet.

Signs you were already hit

Check your logs back to October 14:

  • Bursts of multipart POST requests followed by 500 errors or "memory limit" messages.
  • PHP-FPM workers crashing (segfaults in the PHP-FPM log or journalctl).
  • Very large PHPSESSID cookies. A real one is about 26 to 40 characters; kilobytes is not normal.
  • New or recently changed .php files in your web root, new cron jobs, new users or SSH keys.

If you find any of these, don't just clean up and move on. Save the logs, take the machine off the internet, and treat it as compromised.

Lessons that matter after the patch

  • "Patched" isn't "restarted." A package upgrade can succeed while the PHP-FPM master keeps the old binary mapped. Worse, a rushed restart can leave a stale socket behind and turn the site into a 502. Stop the service cleanly, start it, then check the site.
  • App catalogs lag behind. Ready-made app images and appliance updates often take days to pick up a fix. A forgotten "static file" container can still be on an end-of-life Node; it doesn't feel like a real Node app, but the bug doesn't care.
  • Your distro's package isn't always the fix. As mentioned above, a distro nodejs that relies on an unpatched system Brotli library stays vulnerable after apt upgrade.
  • Public admin panels multiply the risk. Every login page you publish through a reverse proxy is one more PHP or Node app a stranger can reach. Most don't need to be public. An access list or VPN removes them from the attack surface entirely.

A free scanner for the outside view

I built a small read-only scanner at scan.dirazi.online. Give it a hostname and it does four ordinary GET requests:

  • reads the response headers (Server, X-Powered-By);
  • checks whether /status.php exposes a phpinfo()-style page;
  • checks /api/v1/status and /rest/settings for leaked configuration;
  • reads the TLS certificate (issuer, expiry, self-signed or not).

A real scan of nodejs.org in the Dirazi Exposure Scanner: headers, TLS certificate, status endpoints, redirect chain

It sends no attack payloads and writes nothing. It refuses private and local addresses, so nobody can use it to poke around inside a network. It only sees what your server advertises. If your server hides its version (which it should), the result is "check on the server" — use the commands above.

One lesson from building it: the first version reported "no TLS certificate" for nodejs.org, a site that obviously has one. The cause was TLS 1.3 session resumption: a resumed connection doesn't resend the certificate, so the code read nothing. Turning off session caching on the scanner fixed it. Test your testing tools. A scanner that silently misses something turns "unknown" into "looks clean," which is worse than no scanner.

Quick checklist

  1. List every PHP and Node, on the host and in every container.
  2. PHP below 8.2.35 / 8.3.36 / 8.4.27 / 8.5.12 (and no distro backport)? Upgrade it.
  3. Node below 22.23.4 / 24.22.1 / 26.12.1, or on 18/20/25? Upgrade or rebuild.
  4. Restart PHP-FPM, Apache and every Node service. Confirm no (deleted) processes.
  5. Remove X-Powered-By headers and public phpinfo() pages.
  6. Check logs since October 14 for the signs above.
  7. Put admin panels behind a VPN or allow-list.

Sources

Comments (0)

Join the discussion — sign in to comment.

Sign in

No comments yet — be the first to share your thoughts.