Repository navigation
Patch PHP for CVE-2026-109618/109619 and bump FrankenPHP to 1.13.1 - #7
Merged
Merged
Conversation
PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35 fix two unauthenticated RCEs (CVSS 9.2) affecting every SAPI that serves web requests, FrankenPHP included. Neither php:*-zts-alpine nor dunglas/frankenphp ships them yet, so each frankenphp Dockerfile gains a php-patched stage that rebuilds PHP from the php.net tarball (sha256-pinned) with the upstream image's own configure flags and copies the result over the base. FrankenPHP links libphp.so dynamically and patch releases keep the same API numbers, so the swap needs no FrankenPHP rebuild. The patched tarball also replaces /usr/src/php.tar.xz so core extensions installed later (intl, gd, mysqli, ...) build from fixed source. The build fails if php doesn't report the patched version. 8.2 also needs php-src#18743 (as docker-library applies) for its JIT to assemble on Alpine 3.24. FROM pins move from 1.9 / 1.11.1 / 1.12.4 to 1.13.1 across the board, which also picks up FrankenPHP's own 2026-10-04 security fixes. Drop the php-patched stage once the FROM image ships the patched PHP.
- Fail the php-patched stage when the base already ships PHP at or above PHP_PATCH_VERSION; copying over it would silently downgrade. - Version guard now also checks `frankenphp php-cli`, which runs the libphp.so the server embeds; the `php` CLI is a separate binary and could report the patched version while web requests run the old lib. - Strip only the exact `PHP_UNAME=Linux - Docker` token from the reused configure options and fail on any other PHP_UNAME, instead of dropping everything after it. - Copy only /php-install/usr/: PEAR's installer also writes registry dotfiles (.channels, .registry, ...) at INSTALL_ROOT, which were landing in the image's /. - Removal note lists everything to delete once upstream catches up.
Member
Author
Review round 1 (the only round, by request)A fresh-context reviewer ran
After c0a05a4, all four images were rebuilt locally (amd64). Each reports the patched version via |
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.
Why
PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35 fix two unauthenticated remote code execution bugs (CVE-2026-109618, CVE-2026-109619; CVSS v4.0 9.2) that affect every PHP SAPI serving web requests, FrankenPHP included. As of today neither
php:*-zts-alpinenordunglas/frankenphp(latest: 1.13.1, built Oct 10) ships the fixed versions.What
Out-of-band PHP rebuild in each
php/8.{2,3,4,5}/frankenphp/Dockerfile: a newphp-patchedstagephp-<patch>.tar.xzfrom php.net and verifies the sha256 pinned in the Dockerfile (taken from php.net's releases JSON)php-config --configure-options) and docker-library's build deps and recipemake installs into a staging root, which the final stage copies over the base:libphp.so, CLI/phpdbg binaries, shared extensions, headers,php.ini-*, and/usr/src/php.tar.xz(so core extensions installed later, e.g. by the wordpress variant, build from patched source)PHP_VERSION,PHP_URL,PHP_ASC_URLandPHP_SHA256env are updated to matchFrankenPHP links
libphp.sodynamically and patch releases keep the same API numbers, so FrankenPHP itself isn't rebuilt.Guards:
RUNfails the build unless bothfrankenphp php-cli(which runs the embeddedlibphp.so) and thephpCLI report the patched version.php-patchedstage fails if the base already ships PHP at or above the patch version, so it can't silently downgrade once upstream catches up.8.2 also applies php-src#18743 (pinned by sha256, same as docker-library's 8.2 alpine images). Without it, the 8.2 ZTS JIT fails to assemble on Alpine 3.24.
FrankenPHP 1.13.1 for all four versions. They were on 1.9 (8.2), 1.11.1 (8.3, 8.5) and 1.12.4 (8.4); 1.13.x also includes FrankenPHP's own 2026-10-04 security fixes.
The dev and wordpress variants rebuild automatically because the base Dockerfiles changed. wordpress-dev doesn't get patched by the merge run (see below).
Follow-up: once the FROM image ships these versions or newer, the
php-patchedstage fails the build. Then remove that stage, thePHP_PATCH_*ARGs, and the ARG/COPY/ENV block afterLABEL.After merging
wordpress-devisFROM …-frankenphp-wordpressbut builds in the same job aswordpress, in parallel, so this run'swordpress-devimages are built on the old, unpatched wordpress tag. That race already existed; it isn't new in this PR.mainwithbuild_php_82,build_php_83,build_php_84andbuild_php_85. Don't start it while the merge run is still going:cancel-in-progresswould cancel the merge run. This second run'swordpress-devpulls the now-patched wordpress tag.docker run --rm --entrypoint frankenphp ghcr.io/aliasproject/php:<ver>-frankenphp-wordpress-dev php-cli -r 'echo PHP_VERSION;'before rolling out.Testing (local, amd64)
PHP_VERSION(8.2.35 / 8.3.36 / 8.4.27 / 8.5.12), with OPcache active, nophp -mwarnings, no error logs, and a passing healthcheck.8.4-frankenphp-wordpressbuilt on the patched base: gd, mysqli, soap and exif all report 8.4.27.8.4-frankenphp-devand8.2-frankenphp-devbuild.PHP_PATCH_VERSION=8.4.26, and the version guard run against the unpatched upstream libphp.mainor a manual dispatch, so the merge run is the first arm64 build.Known gaps
frankenphp versionstill prints the old PHP version. That string is compiled into the Go binary; the PHP actually running is the patched one.php82package)make installbecause the reused configure options include--with-pear, downloadsinstall-pear-nozlib.pharfrom pear.php.net without a pinned hash. docker-library's own base build does the same.