Dev.to Security 🔐 Cybersecurity 👁 0 📖 4 min read

PHP from Ubuntu can be patched while php -v shows an older version: check your OS vendor's advisory

The short version A fully patched Ubuntu 24.04 server answers php -v with 8.3.6. The upstream fix for October's critical PHP flaws is 8.3.36. The server is still fixed. Ubuntu backports security fixes into the PHP ver

PHP from Ubuntu can be patched while php -v shows an older version: check your OS vendor's advisory

The short version

  • A fully patched Ubuntu 24.04 server answers php -v with 8.3.6. The upstream fix for October's critical PHP flaws is 8.3.36. The server is still fixed.
  • Ubuntu backports security fixes into the PHP version it shipped, so php -v cannot tell you whether you are patched. The package version can, once you compare it with the "fixed in" version in your OS vendor's advisory.
  • A distro suffix such as ~deb12u1 on the version string does not mean the fix is in. Debian 12 has one such version marked vulnerable and another marked fixed, and numbering differs by OS: Debian 12's fixed version matches upstream.

Before you read on

This is part of my series Protect Your Own Service Yourself. It is for anyone running PHP that was installed with apt on Ubuntu or Debian.

A patched server that looks thirty releases behind

Here is a container running Ubuntu 24.04, right after installing PHP from the Ubuntu packages.

Real output from an Ubuntu 24.04 container right after installing PHP from the Ubuntu packages. php -v prints "PHP 8.3.6 (cli)". dpkg-query -W php8.3-cli prints "php8.3-cli 8.3.6-0ubuntu0.24.04.14". Searching the package changelog (changelog.Debian.gz) for the CVE IDs returns two lines, "CVE-2026-109618" and "CVE-2026-109619". These four spots are highlighted in yellow

php -v says 8.3.6. In October 2026, php.net shipped 8.5.12, 8.4.27, 8.3.36 and 8.2.35 to fix two critical flaws (CVE-2026-109618 and CVE-2026-109619) that let an unauthenticated request run code on the server. Compared against 8.3.36, this server is thirty patch levels behind, and a check that only compares version numbers will flag it.

It is not behind. The package version is 8.3.6-0ubuntu0.24.04.14, and the package changelog lists both CVEs. Installing PHP-FPM (php8.3-fpm), the package that serves web requests, gave the same version.

Why the number stays old

Ubuntu keeps the PHP version it shipped for the whole life of an OS release. Moving to a new upstream version could break the applications running on it. Instead, it takes the security fix from the PHP project and applies it to the version it already ships. That is a backport.

The PHP advisory says as much.

The PHP advisory on php.net, titled "Security advisory: Critical remote code execution vulnerabilities, update now". It says PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35 fix two critical vulnerabilities that can allow unauthenticated remote code execution. Two lines are highlighted in yellow: "Linux distributions and LTS vendors received the patches in advance, so check your vendor for updated packages" and "PHP 8.1 and older no longer receive updates from the PHP project. Some distributions and LTS vendors provide backported fixes"

So on a server where PHP came from Ubuntu's packages, php -v tells you which PHP the OS release started with. It does not tell you whether the fix is in.

How to check: the package version against the advisory

Ubuntu publishes a page for each CVE. Here is the table from the page for the first one.

Part of the table on Ubuntu's page for CVE-2026-109618 (ubuntu.com/security/CVE-2026-109618), listing each package by Ubuntu release and status. Two rows are highlighted in yellow: php8.1 on "22.04 LTS jammy" is "Fixed in 8.1.2-1ubuntu2.28", and php8.3 on "24.04 LTS noble" is "Fixed in 8.3.6-0ubuntu0.24.04.13". The other rows say "Not in release"

For php8.3 on 24.04, the fix landed in 8.3.6-0ubuntu0.24.04.13. The server above has .14, which is newer, so it is fixed. The same table shows PHP 8.1 fixed on Ubuntu 22.04, even though the PHP project no longer ships new 8.1 releases.

The check takes four steps.

  1. Get the version of the package that actually serves web requests. For PHP-FPM, run dpkg-query -W php8.3-fpm; for Apache's PHP module, dpkg-query -W libapache2-mod-php8.3 (use your own PHP version in place of 8.3). php -v reports the command-line PHP; PHP-FPM and Apache's PHP module are separate packages.
  2. Find the "fixed in" version for your OS release in your vendor's advisory. For Ubuntu, add the CVE ID to https://ubuntu.com/security/. For Debian, add it to https://security-tracker.debian.org/tracker/. This advisory has two CVEs, so check both pages. On Debian's page, the fixed version is in the "Fixed Version" column of the lower table.
  3. Check that your package version is the same or newer. If the strings are hard to compare by eye, dpkg --compare-versions <yours> ge <fixed> && echo fixed prints fixed when yours is the same or newer.
  4. After updating, restart PHP-FPM or Apache. A running PHP keeps running the old code until it is restarted.

A distro suffix is not proof

A version ending in ubuntu… or deb12u1 tells you the OS vendor built the package. It does not tell you the fix is in. Debian's tracker shows why.

The "Vulnerable and fixed packages" table on Debian's security tracker page for CVE-2026-109618 (security-tracker.debian.org/tracker/CVE-2026-109618). Two rows for php8.2 on Debian 12 (bookworm) are highlighted in yellow: "bookworm" with 8.2.32-1~deb12u1 is "vulnerable", and "bookworm (security)" with 8.2.36-1~deb12u1 is "fixed". Below them, rows for php8.4 on trixie and later are "fixed". In the lower table of fixed versions, the php8.2 bookworm row is highlighted: Fixed Version 8.2.35-1~deb12u1, origin DLA-4848-1

On Debian 12, php8.2 8.2.32-1~deb12u1 in the regular archive is vulnerable, and 8.2.36-1~deb12u1 in the security archive is fixed. Both end in ~deb12u1. Only servers that receive security updates and have installed them are fixed.

The lower table's "Fixed Version" column gives 8.2.35-1~deb12u1 for Debian 12. Unlike Ubuntu, Debian moved to the same 8.2.35 number as upstream this time. Numbering differs by OS, so in either case compare against the "fixed in" version in the advisory.

A number can look old and be fixed. A number can carry the vendor's name and still be vulnerable. Either way, the answer is the "fixed in" version in your OS vendor's advisory.

Terms

  • Fixed release: the version that contains the fix. For this PHP advisory: 8.5.12, 8.4.27, 8.3.36 and 8.2.35.
  • OS package: software built by an OS vendor such as Ubuntu or Debian for its own release. PHP installed with apt is one.
  • OS vendor: whoever builds and ships the OS and its packages, such as Ubuntu (Canonical) or Debian.
  • Backport: applying a fix from a newer release to the version already shipped, without changing to the new version number.
  • CVE ID: the identifier given to each published vulnerability. Here, CVE-2026-109618 and CVE-2026-109619.
  • PHP-FPM: the program that runs PHP for requests passed on by the web server.
  • Remote code execution: someone elsewhere on the network being able to run commands on your server.

In this series, in an age when attack tools are free and one click away for anyone, I show step by step how to check your own service yourself and close the gaps before someone else finds them. The target is always our own service; the series does not cover attacking anyone else's site.
If running the checks yourself is hard, EarthLink Network can do the assessment for you. Found a gap you can't fix? We'll handle the fix. Feel free to reach out.
If this was useful, please like and follow.

Our products are listed at https://www.eln.ne.jp/products

EarthLink Network builds its own products to run the whole company on AI — each one born from a need along the way. See the full index of what we build:

→ The 18 products EarthLink Network builds in-house

For more about the company and each product, visit www.eln.ne.jp.

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.