PHP2Shell on Ubuntu and Debian: Patched PHP 7.2-8.4 Without Ubuntu Pro or ELTS
by Danila Vershinin, , revisited on
See Everpatch coverage.
PHP2Shell on Ubuntu 20.04 can be fixed without changing your PHP minor version. Everpatch ships patched PHP 7.4 and 8.0 through 8.4 for focal on amd64, plus PHP 7.2 for Ubuntu 18.04 and PHP 7.3 for Debian 10. The packages are drop-in compatible with stock and Surý installations: package names and configuration paths stay the same.
Free to install with no account or signup. Personal, development and evaluation use is free; commercial production needs GetPageSpeed Ultra for up to 10 servers running your own services, or GetPageSpeed Fleet for client servers and larger fleets. Everpatch covers the PHP layer; operating-system support stays with your distribution.
Running another distribution, or not sure your build is patched? Paste your package list into the PHP2Shell checker. It understands distro backports and gives the fix for every platform.
CVE-2026-109618 RCE via out-of-memory corruption (GHSA-w8hw-w9fx-j79w) CVSS v4.0 9.2
CVE-2026-109619 RCE via stale global state (GHSA-6wmf-4rv5-p3rp) CVSS v4.0 9.2
Affected: PHP 5.4 and later, all web SAPIs (PHP-FPM, mod_php, php-cgi, LiteSpeed, FrankenPHP)
Fixed upstream: 8.5.12, 8.4.27, 8.3.36, 8.2.35 only
Ubuntu 20.04 fix: GetPageSpeed extras (amd64, free to install)
PHP 7.4: 1:7.4.33-31+gps1 PHP 8.0: 1:8.0.30-25+gps1
PHP 8.1: 8.1.34-9+gps1 PHP 8.2: 8.2.35-1+gps1
PHP 8.3: 8.3.36-1+gps1 PHP 8.4: 8.4.27-1+gps1
Ubuntu 18.04 fix: GetPageSpeed extras, php7.2 7.2.34-66+gps1 (free to install)
Debian 10 fix: GetPageSpeed extras, php7.3 7.3.33-35+gps1 (free to install)
Is my Ubuntu or Debian release already patched for PHP2Shell?
Supported Ubuntu and Debian releases got the PHP2Shell patch through a normal apt upgrade. Ubuntu and Debian backport the fix without changing the PHP version, so php -v still shows the old number: compare the package version instead, with dpkg -l 'php*-cli'.
| Release | Stock PHP package | First patched version | Source |
|---|---|---|---|
| Ubuntu 26.10 | php8.5 |
8.5.9-0ubuntu2.1 |
apt upgrade |
| Ubuntu 26.04 LTS | php8.5 |
8.5.4-0ubuntu1.5 |
apt upgrade |
| Ubuntu 24.04 LTS | php8.3 |
8.3.6-0ubuntu0.24.04.13 |
apt upgrade |
| Ubuntu 22.04 LTS | php8.1 |
8.1.2-1ubuntu2.28 |
apt upgrade |
| Ubuntu 20.04 | php7.4 |
7.4.3-4ubuntu2.29+esm5 (Ubuntu Pro only) or 1:7.4.33-31+gps1 |
Ubuntu Pro, or Everpatch |
| Ubuntu 18.04 | php7.2 |
7.2.24-0ubuntu0.18.04.17+esm14 (Ubuntu Pro only) or 7.2.34-66+gps1 |
Ubuntu Pro, or Everpatch |
| Debian 13 trixie | php8.4 |
8.4.27-1~deb13u1 |
apt upgrade |
| Debian 12 bookworm | php8.2 |
8.2.35-1~deb12u1 |
apt upgrade |
| Debian 11 bullseye | php7.4 |
no Debian fix; Surý ships 1:7.4.33-31 |
Surý repository |
| Debian 10 buster | php7.3 |
7.3.33-35+gps1 |
Freexian ELTS, or Everpatch |
Everpatch packages are free to install; commercial production use requires GetPageSpeed Ultra or Fleet. If your release says apt upgrade, run it and restart PHP-FPM or Apache. Surý PPA users on Ubuntu 22.04 and 24.04 get the patched 8.2.35, 8.3.36, 8.4.27 and the backported 1:7.4.33-31, 1:8.0.30-25 and 8.1.34-9 the same way. The rest of this guide is for Ubuntu 20.04, Ubuntu 18.04 and Debian 10, where apt upgrade alone brings no patch.
Supported releases and PHP versions
| Operating system | PHP branches | Architecture | Existing installations covered |
|---|---|---|---|
| Ubuntu 20.04 (focal) | 7.4, 8.0, 8.1, 8.2, 8.3, 8.4 | amd64 (x86_64) | Stock PHP 7.4 and frozen Surý PPA packages for the listed branches |
| Ubuntu 18.04 (bionic) | 7.2 | amd64 (x86_64) | Stock PHP 7.2 and frozen Surý PPA packages |
| Debian 10 (buster) | 7.3 | amd64 (x86_64) | Stock PHP 7.3 and frozen Surý packages |
These eight operating-system/PHP combinations are available on amd64. Choose your existing release and PHP branch; these upgrades keep the same PHP minor version. Personal, development and evaluation use is free; commercial production use requires GetPageSpeed Ultra for up to 10 servers running your own services, or GetPageSpeed Fleet for client servers and larger fleets.
How to fix PHP2Shell on Ubuntu 20.04
Add the GetPageSpeed extras repository, then upgrade the PHP branch you already run:
wget https://extras.getpagespeed.com/release-latest.deb
sudo apt install ./release-latest.deb
sudo apt update
sudo apt upgrade 'php7.4-*'
sudo systemctl restart php7.4-fpm
The packages use the same php7.4-* names, the same /etc/php/7.4 layout and the same epoch as the sury.org builds, so both a stock Ubuntu 7.4.3 install and a frozen sury 7.4.33-20 install upgrade in place. Your php.ini, FPM pools and enabled modules carry over untouched. Running Apache mod_php? Restart apache2 instead of PHP-FPM.
Ubuntu 18.04 and Debian 10 get the same fix
Everpatch also ships drop-in compatible PHP 7.2 packages for Ubuntu 18.04 and PHP 7.3 packages for Debian 10, where Surý no longer publishes updates. Add the repository exactly as above, then:
sudo apt upgrade 'php7.2-*' && sudo systemctl restart php7.2-fpm # Ubuntu 18.04
sudo apt upgrade 'php7.3-*' && sudo systemctl restart php7.3-fpm # Debian 10
Patched versions to expect: 7.2.34-66+gps1+ubuntu1804+stable and 7.3.33-35+gps1+deb10+stable. No epoch here: unlike php7.4, sury never used one for 7.2/7.3, and these versions sort above stock, ESM and ELTS builds outright. Both builds passed the same upgrade-in-place validation as focal: the PHP2Shell probes reproduce on the stock baseline and are fixed after the upgrade, with identical module sets and preserved configs.
PHP 8.0 and 8.1 on Ubuntu 20.04
Focal servers that installed PHP 8.0 or 8.1 from the Surý PPA before it dropped the suite are covered too. The same repository ships php8.0 1:8.0.30-25+gps1 and php8.1 8.1.34-9+gps1, with the existing package names and configuration layout.
sudo apt upgrade 'php8.0-*' && sudo systemctl restart php8.0-fpm # PHP 8.0
sudo apt upgrade 'php8.1-*' && sudo systemctl restart php8.1-fpm # PHP 8.1
Frozen PPA installs upgrade in place with configuration and modules preserved, and fresh installs (sudo apt install php8.1-fpm) work on stock focal too.
PHP 8.2, 8.3 and 8.4 on Ubuntu 20.04
Servers that stayed on focal after the sury PPA stopped building it can now
install 8.2.35-1+gps1, 8.3.36-1+gps1 or 8.4.27-1+gps1 from the same
repository. These are amd64 packages with the existing php8.x-* names and
/etc/php/8.x layout. Your PHP minor version stays the same.
After adding the repository and running sudo apt update, upgrade the branch
you already use. For PHP 8.4 with FPM:
sudo apt upgrade 'php8.4-*'
sudo systemctl restart php8.4-fpm
Use 8.2 or 8.3 instead for those branches. For Apache mod_php, also run
sudo apt install --only-upgrade libapache2-mod-php8.4 and restart apache2
instead of FPM. A fresh PHP 8.4 FPM install is
sudo apt install php8.4-fpm php8.4-cli.
Each branch passed fresh installation and an upgrade from the original focal
PPA packages, with edited configuration and enabled modules preserved. The
checks exercise real Apache and FPM requests, package removal and coexistence
with PHP 8.0 and 8.1. You can still upgrade Ubuntu when convenient; these
packages cover servers that remain on focal.
What PHP2Shell is
The PHP security team published two critical advisories on October 21, 2026: CVE-2026-109618 and CVE-2026-109619. Researchers named the pair PHP2Shell.
CVE-2026-109618, remote code execution via out-of-memory corruption. PHP handles an out-of-memory error by jumping out of whatever it was doing. If that happens during request startup, for example while parsing a multipart upload, the request data is only half initialised. The cleanup that follows treats it as valid, and an attacker who controls the request controls that memory.
CVE-2026-109619, remote code execution via stale global state. Some request-owned state survives after its memory has been freed. The next request served by the same worker can use it before normal initialisation resets it. Confirmed paths include session upload progress and INI diagnostics emitted before initialisation.
Both rate CVSS v4.0 9.2 and need no authentication. php.net says every PHP installation serving web requests is at risk. Tenable reports that PHP2Shell is now broadly exploited in the wild.
Why Ubuntu 20.04 servers are stuck
Ubuntu fixed PHP2Shell in focal’s php7.4 only as 7.4.3-4ubuntu2.29+esm5, available exclusively to Ubuntu Pro subscribers. Without Pro attached, apt upgrade leaves you at the last free update from standard support, which predates the fix by more than a year of security work.
The usual escape hatch is gone too. Ondřej Surý’s PPA (ppa:ondrej/php), the de-facto source of PHP on Ubuntu, deleted its focal packages in May 2025 when Ubuntu 20.04 left standard support. The last focal build of php7.4 was 1:7.4.33-20; sury’s PHP2Shell fix, 1:7.4.33-31, exists for Debian 11+ and Ubuntu 22.04+, but was never built for focal. A server that installed PHP from the PPA has been frozen for seventeen months, and the PPA’s own index for focal is now empty.
Upstream php.net published only a minimal source-only backport for 7.4, aimed at people who compile their own PHP.
When your existing repositories no longer supply the update, a drop-in package lets you keep the current PHP branch while you plan the migration.
What exactly GetPageSpeed ships
Everpatch packages are drop-in compatible with Surý’s PHP packages and stock Ubuntu/Debian installs on the releases listed above. The phpX.Y-* package names, /etc/php/X.Y configuration layout and extension packaging stay familiar, so you can upgrade the PHP branch your application already uses.
The PHP 7.4 packages include more than the PHP2Shell fix. The October 2026 security batch also addresses mysqlnd packet overreads, OpenSSL hostname verification bypasses, phar TAR entry injection, SOAP and XML hardening, FastCGI allowed_clients IPv6 bypass and HTTP redirect credential leaks.
How the build was validated. In a pristine ubuntu:20.04 container, the test harness installs the stock focal PHP 7.4 baseline and proves both PHP2Shell probes reproduce there: a memory-limit exhaustion unwinds through the vulnerable path, and the rfc1867 session upload-progress hook fires. It then upgrades in place to the GetPageSpeed packages and proves both probes are fixed, php -m lists the identical module set, hand-edited configuration survives, and PHP-FPM keeps serving after an out-of-memory request. The same harness ran again against the published repository through the exact commands above before this post went live.
Check whether your server is vulnerable
dpkg -l 'php7.4-cli' | awk '/^ii/{print $3}'
7.4.3-4ubuntu2.xwithout+esm: vulnerable (stock focal, no Pro).1:7.4.33-20+ubuntu20.04.1+deb.sury.org+1or older: vulnerable (frozen sury PPA).7.4.3-4ubuntu2.29+esm5: patched via Ubuntu Pro.1:7.4.33-31+gps1+ubuntu2004+stable: patched via GetPageSpeed.
Prefer a one-command check? CVEfox reads every installed PHP package, knows Ubuntu, Debian and Surý backports, and prints the exact fix. Add the GetPageSpeed APT repository (three commands), then run sudo apt install cvefox && cvefox scan.
Rollback and caveats
Because the packages carry the same epoch and higher version than both stock and sury builds, apt prefers them naturally; apt install php7.4-cli=<old version> rolls back if you ever need to.
One behaviour changes, by design. A request that hits memory_limit now ends its worker immediately: shutdown functions do not run and buffered output is not sent. This is the same trade the PHP security team made in its own EOL backports, because the unsafe unwinding is exactly what PHP2Shell abuses. Code that relied on catching memory exhaustion in a shutdown handler will need attention.
And to be clear about the bigger picture: PHP 7.4 is end-of-life, and Ubuntu 20.04 is out of standard support. This package keeps the PHP layer patched while you plan the migration; it does not make either supported again.
FAQ
Is PHP 7.4 on Ubuntu 20.04 affected by CVE-2026-109618?
Yes, unpatched PHP 7.4 builds are affected. Ubuntu supplies its focal fix through Ubuntu Pro (ESM), and the Surý PPA no longer builds for focal. Everpatch provides a drop-in compatible PHP 7.4 package for Ubuntu 20.04. Compare the full package release with the fixed versions above; php -v alone cannot establish whether a backport is installed.
I installed PHP from ppa:ondrej/php. Does this upgrade work for me?
Yes. On focal, the packages keep the PPA names and configuration layout. Upgrade the PHP branch you already use; this does not switch your PHP minor version.
Do I need a GetPageSpeed subscription?
The packages are free for personal, development and evaluation use. Commercial production use requires a subscription under the repository terms: GetPageSpeed Ultra for up to 10 servers running your own organization’s services, or GetPageSpeed Fleet for servers you administer for clients, or fleets larger than 10. Redistribution, a contractual SLA or PO procurement go through GetPageSpeed Enterprise. Unlicensed installations may display a notice on HTML pages.
Is setting session.upload_progress.enabled=0 enough?
No. It blocks one confirmed path for CVE-2026-109619 and does nothing for CVE-2026-109618. The PHP security team says only an update is a complete fix. For what NGINX and ModSecurity can block in the meantime, see PHP2Shell mitigation in NGINX.
What about PHP 7.2 on Ubuntu 18.04, or Debian 10?
Both are covered now: php7.2 7.2.34-66+gps1 for Ubuntu 18.04 and php7.3 7.3.33-35+gps1 for Debian 10, from the same repository. Install exactly as above, substituting the PHP version. Focal’s PHP 8.0 through 8.4 are covered too; use the instructions for your existing branch above.
Conclusion
Fix PHP2Shell on Ubuntu 20.04 by upgrading the PHP branch your application already uses, then restarting PHP and testing the application. Everpatch also covers Ubuntu 18.04 and Debian 10 through the same repository. Use the compatibility table above to choose the package for your release.
Running these servers for a business? Every new PHP CVE has to be ported again to releases their vendors stopped building. GetPageSpeed Ultra funds that work and keeps up to 10 servers running your own services patched for the next one ($500/year), together with the full GetPageSpeed repository of NGINX builds and modules for focal. Administering servers for clients, or more than 10? GetPageSpeed Fleet starts at $800/year. See Everpatch for every platform we cover.
Running Amazon Linux 2? See PHP2Shell on Amazon Linux 2: patched PHP 7.2 for x86_64 and Graviton.
Still on CentOS 7? See PHP2Shell on CentOS 7 for that platform’s packages.