Ubuntu Patches Critical php2shell PHP Flaws: Update Now

Share

The short version: two critical PHP vulnerabilities, CVE-2026-109618 and CVE-2026-109619, nicknamed php2shell, let an attacker run code on a server without logging in. They affect any PHP application. Ubuntu has already shipped fixed PHP packages for every supported release, from 14.04 to 26.10, so the fix is one update and a restart away.

KEY TAKEAWAYS

1Critical rating: both flaws score 9.2 on CVSS 4.0, which is rated CRITICAL, and allow unauthenticated remote code execution in any PHP application.
2Fixes are out: Ubuntu released patched PHP packages for 26.10, 26.04, 24.04, 22.04 and older LTS releases through Ubuntu Pro.
3Disclosure came early: a public leak moved the disclosure forward by one day, to 21 October 2026 at 14:00 UTC.
4Update, then restart: installing the fix is not enough. Restart Apache, PHP-FPM or the app using PHP, or reboot.
5Plain desktops are fine: if PHP is not installed, you are not affected. One command tells you.

What happened

Two flaws, one nickname: Canonical’s security team says the bugs result in unauthenticated remote code execution (RCE) for any PHP application. In plain terms, anyone who can reach your PHP site over the network could run commands on the server with the same rights as the PHP application, without a password.

A leak sped things up: the PHP Foundation was working with Linux distributions on a coordinated release planned for 22 October 2026 at 14:00 UTC. Because details leaked publicly, the disclosure was moved forward to 21 October 2026 at 14:00 UTC, and Ubuntu published its fixes the same day.

Who needs to act

You should update if you run PHP on Ubuntu: that includes a WordPress site, a LAMP or LEMP stack, a home server with Nextcloud, a VPS hosting a PHP app, or a local PHP development setup on your laptop. If it runs PHP and other machines can reach it, treat this as urgent.

You can relax if PHP is not installed: a regular Ubuntu desktop does not ship with PHP, so it is not affected. The check command below shows an empty list in that case.

Fixed PHP versions for each Ubuntu release

These versions come from Ubuntu’s official announcement. If your installed version is the same or newer, you have the fix.

Release Package Fixed in Support
Ubuntu 26.10 (Stonking) php8.5 8.5.9-0ubuntu2.1 Standard
Ubuntu 26.04 LTS (Resolute) php8.5 8.5.4-0ubuntu1.5 Standard
Ubuntu 24.04 LTS (Noble) php8.3 8.3.6-0ubuntu0.24.04.13 Standard
Ubuntu 22.04 LTS (Jammy) php8.1 8.1.2-1ubuntu2.28 Standard
Ubuntu 20.04 LTS (Focal) php7.4 7.4.3-4ubuntu2.29+esm5 ESM
Ubuntu 18.04 LTS (Bionic) php7.2 7.2.24-0ubuntu0.18.04.17+esm14 ESM
Ubuntu 16.04 LTS (Xenial) php7.0 7.0.33-0ubuntu0.16.04.16+esm22 ESM Legacy
Ubuntu 14.04 LTS (Trusty) php5 5.5.9+dfsg-1ubuntu4.29+esm18 ESM Legacy
Chart of Ubuntu releases from 14.04 to 26.10 showing the PHP package and how each release gets the php2shell fix
26.10, 26.04, 24.04 and 22.04 get the fix in standard support. Older LTS releases need Ubuntu Pro.

Step 1: Check if PHP is installed

Open a terminal and run this command. It lists any installed PHP interpreter packages and their versions:

CHECK INSTALLED PHP
apt list '?installed ?name(^php[0-9.]+$)'

Reading the result: if nothing is listed after “Listing… Done”, PHP is not installed and you are not affected. If you see a package such as php8.3, compare its version with the table above.

Step 2: Install the fix

Recommended: upgrade all packages. This picks up the PHP fix along with any other pending security updates. Our apt and snap commands guide explains what each part does.

UPGRADE ALL PACKAGES
sudo apt update && sudo apt upgrade

Targeted option: if you cannot upgrade everything right now, update only the PHP interpreter packages:

UPGRADE PHP ONLY
sudo apt update && sudo apt install --only-upgrade '?name(^php[0-9.]+$)'

Step 3: Restart PHP or reboot

This step matters: a running web server keeps using the old PHP code until it restarts. If your site uses Apache with mod_php, restart Apache:

RESTART APACHE (MOD_PHP)
sudo systemctl restart apache2

Using PHP-FPM with Nginx or Apache? Restart your phpX.Y-fpm service instead. For example, on Ubuntu 24.04 with PHP 8.3 that would be the command below. Not sure of the service name? Our systemctl and journalctl guide shows how to list running services.

RESTART PHP-FPM (EXAMPLE)
sudo systemctl restart php8.3-fpm

Simplest option: reboot, so every application loads the updated PHP packages:

REBOOT
sudo reboot
Ubuntu terminal showing the PHP upgrade command, an Apache restart and apt list confirming the fixed php8.3 version
Example on Ubuntu 24.04 LTS: upgrade PHP, restart Apache, then confirm the fixed version.

What about automatic updates?

Mostly covered, but not finished: unattended-upgrades is turned on by default since Ubuntu 16.04 LTS and installs security updates every 24 hours. That means many servers will already have the patched packages. Ubuntu notes that the affected applications still need a restart or a reboot before the fix takes effect, so do Step 3 even if you did not run apt yourself.

Older Ubuntu releases and Ubuntu Pro

Standard support: Ubuntu 26.10, 26.04 LTS, 24.04 LTS and 22.04 LTS get these fixes through the normal update channels.

Expanded Security Maintenance: Ubuntu 20.04 LTS and 18.04 LTS receive the fix through ESM, which is part of Ubuntu Pro. Ubuntu 16.04 LTS and 14.04 LTS need ESM plus the Legacy add-on. Ubuntu Pro is free for up to 5 machines, so home server owners on an older LTS can enable it at no cost.

Good habit for servers: while you are patching, it is a good time to review which ports your server exposes. Our UFW firewall commands guide and the Ubuntu Server 26.04 LTS manual cover the basics.

Bottom line

php2shell is about as serious as PHP bugs get, but the fix is simple. Run the check command, install the update, and restart your web server or PHP-FPM. If you do not have PHP installed, there is nothing to do.

Sources: Ubuntu blog, USN-8948-1, PHP.net.