GrepBoard/Manuals
605 manuals ·

PHP shows 8.3.6, is it patched? Check the package version

·Tested on Ubuntu 24.04 · php8.3 8.3.6-0ubuntu0.24.04.13 · older build 8.3.6-0maysync1 (packages unpacked and inspected)·Test scope ↓·4 steps

Ubuntu keeps php -v at 8.3.6 after backporting a fix. Tell whether you are patched from the package version and the changelog's CVE entries.

The advisory says versions below 8.3.36 are affected, yet php -v on Ubuntu 24.04 still prints 8.3.6 after the fix. Distributions keep the upstream number and only raise the suffix, so judge by the package version and its changelog. The CVEs here come from PHP RCE CVE-2026-109618 and CVE-2026-109619; the method works for other packages too.

[1] See what php -v actually tells you. This is the fixed package (8.3.6-0ubuntu0.24.04.13), unpacked and run.

console
$ php -v
output
PHP 8.3.6 (cli) (built: Oct 19 2026 15:16:58) (NTS)Copyright (c) The PHP Group

The leading 8.3.6 is the same before and after the fix. Only the build date differs, which is weak evidence.

[2] Read the package version. On a live host, dpkg -l 'php8.3*' shows it in the version column and dpkg-query -W prints it (neither could be run on the test server, which has no PHP installed). Below, the same field is read from the downloaded .deb.

console
$ dpkg-deb -f php8.3-cli_8.3.6-0ubuntu0.24.04.13_amd64.deb Package Version
output
Package: php8.3-cliVersion: 8.3.6-0ubuntu0.24.04.13

You are fixed if this equals or exceeds the version in USN-8948-1: 8.3.6-0ubuntu0.24.04.13 for 24.04.

[3] To find which build fixed a given CVE, search the changelog for the CVE number. Try the APT command first.

console
$ apt changelog php8.3-cli
output
Err:1 https://changelogs.ubuntu.com php8.3 8.3.6-0ubuntu0.24.04.13 Changelog  Changelog unavailable for php8.3=8.3.6-0ubuntu0.24.04.13 (404  Not Found [IP: 185.125.190.48 443])
console
$ zcat /usr/share/doc/php8.3-common/changelog.Debian.gz | head -3
output
php8.3 (8.3.6-0ubuntu0.24.04.13) noble-security; urgency=medium   * SECURITY UPDATE: Remote RCE via state corruption issue
console
$ zcat /usr/share/doc/php8.3-common/changelog.Debian.gz | grep -n CVE-2026-109618
output
4:    - debian/patches/CVE-2026-109618_109619.patch: Avoid state corruption via293:    - CVE-2026-109618

The top entry is .13 and line 4 names the patch, so that entry brought the fix. The earlier build (8.3.6-0maysync1, from the plain noble pocket) gets zero hits from the same search.

console
$ zcat /usr/share/doc/php8.3-common/changelog.Debian.gz | head -1$ zcat /usr/share/doc/php8.3-common/changelog.Debian.gz | grep -c CVE-2026-109618
output
php8.3 (8.3.6-0maysync1) noble; urgency=medium0

[4] Let dpkg order two versions. Do not compare suffixed strings by eye.

console
$ dpkg --compare-versions 8.3.6-0maysync1 lt 8.3.6-0ubuntu0.24.04.13 && echo older
output
older

Where checks go wrong

Comparing against the upstream number with version_compare() flags the fixed 24.04 package as too old. This result comes from the fixed package used above.

console
$ php -r 'var_dump(version_compare(PHP_VERSION, "8.3.36", "<"));'
output
bool(true)

true does not mean vulnerable. Do not apply the upstream-number rule to distribution packages.

A 404 from apt changelog does not mean the patch is missing. Read the changelog.Debian.gz inside the package, as above.

#php#apt#cve#ubuntu