PHP2Shell is two critical PHP bugs disclosed on October 21, 2026: CVE-2026-109618 (remote code execution via out-of-memory corruption) and CVE-2026-109619 (remote code execution via stale global state). Both are CVSS 4.0 9.2 and need no authentication. Attacks are already happening.
Upstream fixed only PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35. Everything else depends on your vendor.
The version-number trap
Most people check with php -v. On a patched Ubuntu 24.04 that still prints PHP 8.3.6, because Ubuntu backported the fix into its own package (8.3.6-0ubuntu0.24.04.13). Debian, RHEL, AlmaLinux, Rocky, Remi and others do the same in different ways. A version scanner that only reads the upstream number flags patched servers as vulnerable, and can wave through an unpatched EOL build.
The package release is what matters:
rpm -qa 'php*' # RHEL, CentOS, Alma, Rocky
dpkg -l 'php*' # Debian, Ubuntu
I built a free PHP2Shell checker that reads that output in your browser and knows each vendor's fixed builds. Nothing you paste leaves the page.
What NGINX can and can't do
We tested edge mitigations on Rocky Linux 10 with NGINX 1.30 and PHP-FPM 8.3. Three results surprised me:
-
Stock NGINX already blunts one attack path. CVE-2026-109618 can use a multipart body "without a usable declared content length". With the default
fastcgi_request_buffering on, NGINX de-chunks the body and hands PHP-FPM the realCONTENT_LENGTH. Keep buffering on for PHP. -
client_max_body_sizeis the best single lever. NGINX rejects an oversized chunked body with413before PHP parses a byte. -
The popular
PHP_VALUEtrick does not work.fastcgi_param PHP_VALUE "session.upload_progress.enabled=0"left upload progress enabled in our test. Set it in the FPM pool instead:
php_admin_flag[session.upload_progress.enabled] = off
The advisory also warns that per-request INI values from the frontend which raise a warning are themselves a trigger for CVE-2026-109619, so audit what you send:
grep -rn 'PHP_VALUE\|PHP_ADMIN_VALUE' /etc/nginx /etc/php-fpm.d /etc/php
None of this replaces updating PHP. Edge rules stop the known request shapes, and the advisories document paths that need no special upload at all.
Still on CentOS 7? Or frozen on Ubuntu 20.04?
Remi stopped building for CentOS 7 in June 2024, and php.net shipped nothing for PHP 7.x there. GetPageSpeed's Everpatch publishes PHP2Shell-fixed builds of PHP 5.6 to 8.4 for CentOS 7, in both Remi package shapes, free to install. Personal, development and evaluation use is free. Commercial production requires Ultra for up to 10 servers running your own organization's services, or Fleet for client servers you administer or larger fleets, under the repository terms:
yum -y install https://extras.getpagespeed.com/release-latest.rpm
yum --enablerepo=getpagespeed-extras-php74 upgrade 'php-*'
systemctl restart php-fpm
Everpatch also ships patched DEB packages for the suites the Surý PPA dropped: PHP 7.4 and 8.0-8.4 for Ubuntu 20.04, PHP 7.2 for Ubuntu 18.04 and PHP 7.3 for Debian 10, all on amd64. These keep the existing package names and configuration layout, so you can update your current PHP branch while planning the OS migration. The Ubuntu and Debian guide lists package versions and upgrade commands. These are PHP packages; they do not provide complete Ubuntu OS maintenance.
Then restart every PHP process, whatever your platform. Running workers keep the old code in memory.
The full write-up has fixed versions per distro, the ModSecurity rules we tested, detection commands and a timeline: PHP2Shell: check, fix and mitigate.
Top comments (0)