Skip to content
Control Plane Labs

Finding Every PHP and Node.js Runtime You Run

PHP2Shell and Node2Shell are both exploited. How to find the PHP and Node.js copies a dependency scan misses, check them against the fixed versions, and verify.

Control Plane Labs Staff

Published October 31, 2026

Two runtime bugs landed in the same week, and both are now under attack. CISA added the PHP pair to its Known Exploited Vulnerabilities catalog on October 26 and the Node.js Brotli bug on October 27. Most teams patched the servers they know about first. The trouble is the copies they don’t know about: a container image built in August, a second PHP build behind a different virtual host, an old node under a version manager, a vendor appliance with its own PHP.

This guide covers where those copies live, how to check each one against the fixed versions, and the pitfalls that make a vulnerable runtime look patched. It doesn’t cover how the bugs are exploited.

What is affected

The PHP security advisory says the fixes are in PHP 8.5.12, 8.4.27, 8.3.36, and 8.2.35, released October 21. The two bugs are tracked as GHSA-w8hw-w9fx-j79w, corruption after an out-of-memory error, and GHSA-6wmf-4rv5-p3rp, stale per-request state reused by a later request on the same worker. PHP says every installation that serves web requests is at risk, including PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP, and LiteSpeed. It rates mod_php highest, because a demonstrated attack fires before any application code runs. PHP 8.1 and older get no releases. The PHP team published minimal source backports for 7.4, 8.0, and 8.1, and distributions may ship their own.

The Node.js October security release describes CVE-2026-111497 as an out-of-bounds write in the Brotli decoder bundled with Node.js. An attacker who can supply Brotli data that an application decompresses with node:zlib can corrupt process memory. The fixes are in 22.23.4, 24.22.1, and 26.12.1, and later releases on each line include them. Qualys notes that exposure includes HTTP clients and proxies that accept Content-Encoding: br, so a service doesn’t need a Brotli upload endpoint to be in scope. Lines 23, 25, and 20 and older got no fix and need to move to a supported line.

Runtime Fixed in No fix from the project
PHP 8.5 / 8.4 / 8.3 / 8.2 8.5.12 / 8.4.27 / 8.3.36 / 8.2.35 8.1 and older (source backports for 7.4 to 8.1 only)
Node.js 26 / 24 / 22 26.12.1 / 24.22.1 / 22.23.4 25, 23, 21, 20 and older

Where runtimes hide

The list below is what an inventory pass should cover. Qualys makes the same point for Node.js: copies sit in version managers, container images, single-executable apps, and serverless functions “that dependency checks never touch.”

  • The web server’s PHP, not the shell’s. php on your PATH is the CLI build. Apache may load a different libphp module, and each PHP-FPM pool runs the php-fpm binary for its branch. A host can have all three at different versions.
  • More than one branch per host. Shared hosts and Debian or Ubuntu systems with third-party repositories often have php8.2-fpm and php8.4-fpm installed side by side.
  • Version managers. nvm, fnm, Volta, asdf, and mise each keep their own node binaries in your home directory. A CI runner can have a dozen.
  • Container images. A floating tag such as node:22 or php:8.4-apache was only patched if the image was rebuilt and pulled after the fix. Pinned digests stay on whatever they were built with.
  • Bundled runtimes. Single-executable applications, desktop tools, and CLIs that ship their own node aren’t fixed by updating the system Node.js.
  • Appliances and vendor products. PHP sits under firewall admin pages, NAS interfaces, PBX systems, and management consoles. The Dutch NCSC’s php2shell tracker listed 929 products on October 31, with 217 marked vulnerable and 165 fixed. You can’t patch those yourself, so track the vendor’s fix.

Checking PHP

Start with what the web server actually loads. On Apache, apachectl -M (or httpd -M) lists modules. A php_module entry means mod_php, which is the highest-risk setup.

apachectl -M 2>/dev/null | grep -i php
ls /usr/sbin/php-fpm* /usr/local/sbin/php-fpm 2>/dev/null
for b in /usr/sbin/php-fpm* /usr/local/sbin/php-fpm; do [ -x "$b" ] && "$b" -v | head -n1; done
php -v | head -n1

Run the version comparison with each binary you found, not only the CLI. This one-liner prints whether the running PHP is on a fixed release for its branch:

php -r '$f=["8.5"=>"8.5.12","8.4"=>"8.4.27","8.3"=>"8.3.36","8.2"=>"8.2.35"];
$b=PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;
echo isset($f[$b]) ? (version_compare(PHP_VERSION,$f[$b],">=") ? "ok " : "VULNERABLE ") : "UNSUPPORTED ",
PHP_VERSION, " ", PHP_SAPI, PHP_EOL;'

PHP_SAPI prints cli when you run it from a shell. To confirm the version a site serves, you can drop a one-line file that echoes PHP_VERSION and PHP_SAPI into a path only you can reach, request it once, and delete it. Don’t leave a phpinfo() page behind. The X-Powered-By header is a weak signal, because expose_php is often off. You can check it with our header inspector, but a missing header proves nothing.

Distribution packages are the main false positive. Debian, Ubuntu, and RHEL often backport fixes without changing the upstream version, so 8.2.28 from a vendor may already be patched. Bitdefender’s advisory recommends searching the package changelog for the CVE IDs instead:

# Debian / Ubuntu (substitute your branch)
apt changelog php8.2-common 2>/dev/null | grep -E 'CVE-2026-10961[89]'
# RHEL family
rpm -q --changelog php-common | grep -E 'CVE-2026-10961[89]'

After you update, restart every worker. A PHP-FPM pool or Apache process that started before the update keeps the old code in memory. If you can’t update right away, the PHP advisory lists partial mitigations, including session.upload_progress.enabled=0 set in php.ini or the pool configuration rather than ini_set(), and it is explicit that they “do not make an installation safe.” A follow-up advisory on October 23 suggests keeping that setting off until the next regular PHP release, even after patching, for a separate and unlikely case tracked as CVE-2026-115560.

Checking Node.js

Find every node binary first, then check each one. The search below covers system paths and the common version-manager directories:

{ which -a node 2>/dev/null
  find / -xdev -type f -name node -perm -u+x 2>/dev/null
  ls -d ~/.nvm/versions/node/*/bin/node ~/.volta/tools/image/node/*/bin/node \
        ~/.local/share/fnm/node-versions/*/installation/bin/node 2>/dev/null
} | sort -u > /tmp/node-binaries.txt

Then compare each version against the fixed release for its line. We tested this script against Node.js 22.23.2 and 22.23.4 binaries:

#!/bin/sh
# Usage: nodecheck.sh /path/to/node [...]
for bin in "$@"; do
  v=$("$bin" -p 'process.versions.node' 2>/dev/null) || { echo "unreadable  $bin"; continue; }
  major=${v%%.*}
  case "$major" in
    22) fixed=22.23.4 ;;
    24) fixed=24.22.1 ;;
    26) fixed=26.12.1 ;;
    *)  echo "UNSUPPORTED $v  $bin"; continue ;;
  esac
  lowest=$(printf '%s\n%s\n' "$v" "$fixed" | sort -V | head -n1)
  if [ "$lowest" = "$fixed" ]; then echo "ok          $v  $bin"; else echo "VULNERABLE  $v  $bin (fixed in $fixed)"; fi
done

Output from our test run, with two binaries and one bad path:

$ sh nodecheck.sh ~/.local/node/bin/node /tmp/n4/bin/node /nonexistent
VULNERABLE  22.23.2  /home/user/.local/node/bin/node (fixed in 22.23.4)
ok          22.23.4  /tmp/n4/bin/node
unreadable  /nonexistent

Only run this on binaries that are really node. The script executes each binary, and a single-executable app would run its own code instead of printing a version. For those, check which Node.js release the vendor built with and rebuild or update.

Don’t use process.versions.brotli as a shortcut. Node’s process.versions does report the bundled Brotli version, but the fix was a cherry-picked patch, not a library upgrade. In our test, both the vulnerable 22.23.2 and the fixed 22.23.4 reported brotli: 1.1.0. The Node.js version is the only reliable signal.

Checking containers and clusters

Tags don’t tell you what’s inside an image. Run the runtime itself:

docker run --rm --entrypoint node  node:22-alpine -v
docker run --rm --entrypoint php   php:8.4-apache  -v

For a running cluster, list the images in use, then check one pod per image. The jsonpath output gives one line per pod:

kubectl get pods -A -o jsonpath='{range .items[*]}{.metadata.namespace}{"\t"}{.metadata.name}{"\t"}{range .spec.containers[*]}{.image}{" "}{end}{"\n"}{end}' \
  | sort -k3 -u
kubectl exec -n web deploy/frontend -- node -p 'process.versions.node'
kubectl exec -n web deploy/wordpress -- php -v

The second and third lines use deploy/<name>, which picks one pod from the Deployment. Our kubectl cheat sheet covers the selectors if you need a specific pod. Minimal images without a shell or the runtime on PATH need an image scanner instead. Whatever you use, scan what’s deployed, not just the registry, because old ReplicaSets and CronJobs can keep pulling a digest you already replaced.

Then fix the source of the image, not just the running pods. Rebuild from a base image that includes the fix, push, roll the Deployment, and confirm the new pods report the fixed version. A rebuild that hits a cached base layer won’t pick up the patch, so pull the base image again.

Prioritizing

Patch in this order:

  1. Internet-facing PHP under mod_php. That is the case PHP rates highest risk, and it is where honeypots recorded working shells. The Register reports 35 successful shell executions across three honeypots on October 24.
  2. Other internet-facing PHP: FPM, php-cgi, FrankenPHP, and LiteSpeed.
  3. Node.js services that decompress untrusted Brotli. That includes proxies and anything that fetches from URLs a user controls. Even a failed attempt can crash the process.
  4. Vendor appliances. Restrict their management interfaces to trusted networks until the vendor fix ships. CISA’s PHP alert and the Canadian Centre for Cyber Security both call out third-party products and containers that bundle PHP.
  5. Internal services, CI runners, and developer machines.

Record the binary path, version, and fix date for each runtime as you go. The next runtime CVE will need the same list, and building it during an incident is the slow part.

Verifying the fix

A patch only counts once the running process reports the fixed version. For PHP, request your temporary version file again, or check php-fpm -v and confirm the worker processes restarted after the update. For Node.js, check the version from inside the running service, through a health endpoint or kubectl exec, not just on the host. Avoid intrusive exploit checks against production: Qualys warns that its own active Brotli test can crash services on unpatched Node.js and should only run in test environments or on systems already confirmed patched.

If you also verify the binaries you download, our write-up on the OVHcloud CLI release swap covers pinning hashes and checking attestations.

Frequently asked questions

Which PHP versions fix PHP2Shell?+
PHP 8.5.12, 8.4.27, 8.3.36, and 8.2.35, released October 21, 2026. PHP 8.1 and older get no official release; use a distribution or LTS vendor package, the PHP team's source backport, or upgrade to a supported branch.
Which Node.js versions fix CVE-2026-111497?+
Node.js 22.23.4, 24.22.1, and 26.12.1, and later releases on those lines. Lines 25, 23, 21, 20 and older did not receive a fix and should move to a supported line.
Does updating npm or Composer dependencies fix these bugs?+
No. Both bugs are in the runtime itself: the PHP interpreter and the Brotli decoder bundled with Node.js. You need to update the PHP or Node.js binary that runs your code and restart it.
Why does php -v show a fixed version while my site is still vulnerable?+
php on your PATH is the CLI build. Apache's mod_php and each PHP-FPM pool can be different builds or branches. Check the version the web server loads, and restart workers after updating.
Can I check process.versions.brotli to see if Node.js is patched?+
No. The fix was a cherry-picked patch, so the Brotli version string did not change. In our test, both Node.js 22.23.2 (vulnerable) and 22.23.4 (fixed) reported Brotli 1.1.0. Check the Node.js version instead.
My distribution's PHP version is older than 8.2.35. Is it vulnerable?+
Not necessarily. Debian, Ubuntu, and RHEL often backport security fixes without changing the upstream version number. Search the package changelog for CVE-2026-109618 and CVE-2026-109619.
Are vendor appliances affected?+
Many are. PHP runs inside firewall, storage, and management interfaces. The Dutch NCSC tracker listed 929 products on October 31, with 217 marked vulnerable. Apply vendor fixes and limit management-interface exposure until they ship.

Tags: #php, #nodejs, #php2shell, #node2shell, #kev, #patching, #containers, #inventory