Repository navigation
fix: rebuild the image on PHP 8.3.37 and patch three dependency advisories - #6
Merged
Merged
Conversation
Every published image - latest, 1, 1.20260820 and 1.20260820.0444, on
ghcr.io and Docker Hub alike - runs PHP 8.3.33, which is what
php:8.3-cli-alpine pointed at when the last release was built on 20 August.
Three PHP security releases have shipped since, with 27 advisories between
them:
- 8.3.35 (24 Sep), 12: among them TLS hostname verification falling back to
the CN after a SAN mismatch (CVE-2026-91769), a heap overflow on a crafted
wildcard certificate CN (CVE-2026-91767), and credentials leaking across
origins when the HTTP stream wrapper follows a redirect (CVE-2026-91766).
- 8.3.36 (21 Oct), 2: the "php2shell" remote code execution bugs,
CVE-2026-109618 and CVE-2026-109619, both now in CISA's KEV catalogue.
- 8.3.37 (19 Nov), 13: among them the session RCEs CVE-2026-126714
("phpAfterShell") and CVE-2026-115560, and the timezone cache
use-after-free CVE-2026-129496.
8.3.37 fixes all of them. A few sit in parts this image never runs - FPM,
SOAP, CGI, Windows - but a patch release is the unit PHP ships fixes in.
The floating tag already resolves to 8.3.37. None of it reached anyone
because nothing has built an image since: the publish workflows run for a
release or by hand, and neither has happened. Pinning the patch version puts
the PHP an image ships in the diff - a publish run, for a release or by hand,
now builds the PHP its tag was reviewed with - and turns the next security
release into a one-line fix(docker) change that releases by its type.
AGENTS.md now says so, because the same bump committed as chore would merge
without rebuilding anything.
The rebuild also moves Alpine from 3.24.1 to 3.24.4: OpenSSL 3.5.7 to
3.5.9, curl 8.21.0 to 8.23.0, zlib 1.3.2 to 1.4.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
composer audit --locked - the first step of composer check, and a gate in CI - now fails on main. Advisories published since the last release cover two packages that ship in every install and every image: - symfony/yaml 7.4.15: unbounded recursion in the inline lexer lets a single document crash the process (CVE-2026-109413, high), and exponential and quadratic parse times let one hold it (CVE-2026-123792). Fixed in 7.4.18 and 7.4.23. - symfony/filesystem 7.4.15, through aws-sdk-php: Path treats any prefix before "://" as a root, so a path can escape its base directory (CVE-2026-135803). Fixed in 7.4.23. Neither is known to be reachable from a client. symfony/yaml parses only what the operator supplies - the configuration file, read on every request and command, and config:set values - and nothing a client sends is ever read as YAML. Nothing in src/ uses symfony/filesystem directly. Both still ship, though, and the audit gate cannot pass around them. Both go to 7.4.24, the newest 7.4 patch: symfony/yaml through its pin with composer require, symfony/filesystem in the lock alone, since transitive packages are held only by the lock, as the README notes. Resolved on PHP 8.2, the floor CI tests, so nothing in the lock needs a newer PHP than composer.json allows. No other package moved. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Even on PHP 8.3.37 the image still carried libxml2 2.13.9-r2, with CVE-2026-86144 (high) fixed in -r3, while Alpine 3.24 already ships -r5. The official PHP image is rebuilt for PHP and Alpine releases rather than for every Alpine package fix, so the libraries PHP links against can trail the repositories it was built from. libxml2 is one of them, and a client can reach it: Slim's body parsing hands it the body of any XML request to a route, ahead of authentication. aws-sdk-php parses Route53's responses with it too. apk upgrade in the runtime stage closes that gap without leaving the image's Alpine branch, so the ABI PHP was compiled against holds. Today it moves libxml2 to 2.13.9-r5, and zstd-libs, which only libcurl uses, from 1.5.7 to 1.6.0. grype now reports no fixable vulnerability in the image, down from 121 in the published one. A cached copy of that layer would quietly undo it. Its cache key is the base image and the command, so it would bring back the packages of whichever build made it first - often CI's, days before a release - and, because CI and both publish workflows share one GitHub Actions cache scope and each export replaces the last, not necessarily the same build for both architectures. So the publish workflows build the runtime stage without the cache (no-cache-filters), and every release takes the fixes available the day it is built, on both architectures. The vendor stage still caches; composer.lock fixes what it produces. The price is compiling pcntl again on each release, under emulation for arm64. The comment that called the base image tag "the pin that matters" now says what the tag pins - PHP - since the packages around it no longer come from it alone. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
DManavi
force-pushed
the
dmanavi-php-cve-image-updates
branch
from
November 27, 2026 00:05
c79628c to
7b9a45f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every published image (
latest,1,1.20260820,1.20260820.0444, on both ghcr.io and Docker Hub) runs PHP 8.3.33. PHP has shipped three security releases since then. Separately,composer audit --locked, which CI runs as a gate, now fails on three dependency advisories. All three commits arefix, so merging this cuts a release, and the release rebuilds and republishes both images.1. PHP 8.3.33 → 8.3.37 (
fix(docker))The runtime base is now pinned to
php:8.3.37-cli-alpine. The floatingphp:8.3-cli-alpinetag already resolves to the same index digest (sha256:6af812ec…). The published images fell behind only because nothing has built an image since 20 Aug. (There was no 8.3.34 release.)All 26 CVEs
8.3.37 is the latest 8.3 release and fixes all of them. Two 19 Nov advisories appear only under 8.6.0 (CVE-2026-129474 and CVE-2026-129182), and they affect PHP 8.5+ only. A few advisories cover parts this image never runs: FPM, CGI, Windows, and SOAP (not compiled in).
AGENTS.mdgains a Traps entry: a PHP bump has to be committed asfix(docker). Committed aschore, it merges without a release, and the published images keep the old PHP.2. Alpine security updates the PHP image is missing (
fix(docker))Even on 8.3.37, the base image still carries libxml2 2.13.9-r2 (CVE-2026-86144, high, fixed in -r3), while Alpine 3.24 already ships -r5. The official image is rebuilt for PHP and Alpine releases, not for every Alpine package fix.
libxml2 is reachable by clients: Slim's app-level body parser runs
simplexml_load_stringon any XML request body before the/v1/hostsgroup'sAuthenticationMiddlewareruns (src/Http/AppFactoryBuilder.php:35,config/routes.php:39-45). aws-sdk-php also uses it to parse Route53 responses.apk upgrade --no-cachein the runtime stage, staying on the image's own Alpine branch. Today it changes exactly two packages: libxml2 2.13.9-r2 → -r5, and zstd-libs 1.5.7 → 1.6.0 (used only by libcurl).publish-ghcr.ymlandpublish-dockerhub.ymlnow setno-cache-filters: runtime. Every release gets that day's Alpine fixes on both amd64 and arm64. The vendor stage still caches, andcomposer.lockfixes what it produces. The cost is rebuilding pcntl on each release, under emulation for arm64.3. symfony/yaml and symfony/filesystem 7.4.15 → 7.4.24 (
fix)These are dependencies, not PHP itself, but they ship in the same image, and every PR currently fails CI's audit step because of them.
Pathtreats any prefix before://as a rootNeither is known to be reachable from a client:
config:setvalues. Nothing a client sends is ever read as YAML.src/never uses symfony/filesystem directly.I pinned symfony/yaml via
composer requireand updated symfony/filesystem in the lock only. I resolved on PHP 8.2, the CI floor, and no other package moved.Verification (local, Docker 29.9)
1.20260820.0444PHP_VERSIONcomposer audit --locked--only-fixedgrype doesn't match the PHP interpreter itself, so the PHP CVEs above rest on the version check and PHP's own advisories.
composer checkpasses: audit clean, formatting OK, PHPStan max reports no errors, and 641 tests pass (1 skipped).composer validatepasses.docker build --no-cache-filter runtimetakes the vendor stage from cache, rebuilds every runtime step and re-runsapk upgrade.pcntlis loaded,expose_phpis off, and PHP starts with no warnings.providers:list,config:validateandhosts:listsucceed with the example config.update --all --dry-runwith a placeholder token reaches DigitalOcean over TLS and is rejected cleanly./healthand/apireturn 200.HEALTHCHECKreportshealthy.The code review raised one Medium issue (the cache problem in section 2) and three Low wording errors in comments and commit messages. All are fixed, and the commits were rewritten so their messages stay accurate.
After merge: the release workflow runs, publishes to GHCR, Docker Hub and Packagist, and then
verify-release.ymlchecks the published packages.