Skip to content

feat: ship patched PHP images without the official php images - #40

Merged
itsrafsanjani merged 5 commits into
mainfrom
fix/cve-php-base-pipeline
Oct 21, 2026
Merged

itsrafsanjani merged 5 commits into
mainfrom
fix/cve-php-base-pipeline

Conversation

@itsrafsanjani

@itsrafsanjani itsrafsanjani commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Why

  • PHP security release on 2026-10-21 (CVE-2026-109618, CVE-2026-109619).
  • The official php:*-fpm-alpine images come some hours after php.net. We must not wait for them.
  • The arm64 build under QEMU takes 60–80 min. Native arm64 runners are free for public repos.
  • pecl.php.net returned 504 and "No releases available". All PHP jobs of run 39570023231 failed.

What changes

  • New build-base.yml:
    • Gets the docker-library files for <minor>/alpine3.24/fpm from one docker-library/php master commit.
    • Sets PHP_VERSION, PHP_URL, PHP_ASC_URL and PHP_SHA256. Stops if a line does not match.
    • Keeps the sha256 check and the GPG check of the .asc file.
    • Builds amd64 and arm64 on native runners. Checks PHP_VERSION in the image. Pushes by digest.
    • Merges into <org>/php-base:<prefix><minor>-fpm-alpine and <org>/php-base:<prefix><version>-fpm-alpine.
    • Inputs: php_version and php_sha256 (lists, same order), tag_prefix, alpine.
  • php/Dockerfile: new ARG BASE_IMAGE (default php:${PHP_VERSION}-fpm-alpine) for the builder and final stages. The cli-alpine stages do not change.
  • php/retry.sh: retries each install-php-extensions call 5 times, 30 s apart, then fails.
  • deploy.yml:
    • PHP and OLS build on native runners, push by digest, then merge the manifest list.
    • Structure tests run on amd64 and arm64.
    • New workflow_dispatch inputs: php_versions, base_image, tag_suffix, openlitespeed.
    • build-builder runs after merge-php and uses the PHP image with the same tag suffix.
    • cancel-in-progress: false. A push to main must not cancel a release run.
  • builder/Dockerfile: new ARG PHP_IMAGE, so a test tag builds on a test tag.

Dry run (8.2.34, test tags only)

  • See the comment below for the run URLs and timings.

Risks

  • A push to main or the 1st/15th cron rebuilds meghsh/php:<minor> from the official images. Before the official images have the patch, this reverts the fix. Merge this PR with [skip ci] in the commit subject.
  • build-base.yml also runs on a PR when the test-base-image label is added. It builds 8.2.34 with test- tags only.
  • If php.net publishes the tarball before the .asc, the base build fails at the GPG step. This is intentional.

- Add build-base.yml. It builds the docker-library php:<minor>-fpm-alpine
  image with a PHP version that the official images do not have yet.
- Build amd64 and arm64 on native runners, push by digest, then merge
  into <org>/php-base:<minor>-fpm-alpine and <org>/php-base:<version>-fpm-alpine.
- Keep the sha256 check and the GPG check of the .asc file.
- Add ARG BASE_IMAGE to php/Dockerfile for the builder and final stages.
- Build each arch on a native runner (amd64 on ubuntu-latest, arm64 on
  ubuntu-24.04-arm). Push by digest, then merge the manifest list.
- Remove QEMU from the PHP and OLS builds. Run the structure test on both arches.
- Add workflow_dispatch inputs: php_versions, base_image, tag_suffix, openlitespeed.
- Pass the PHP image to the builder image, so a test tag builds on a test tag.
- Set cancel-in-progress to false. A push to main must not cancel a release run.
- Retry each install-php-extensions call 5 times, 30 seconds apart.
- Add -n to the jq version check in deploy.yml. Without it, jq waits for input and every version is rejected.
- Set pipefail in build-base.yml, so a bad version or sha256 stops the run.
- Run the base dry run on the PR only when the test-base-image label is added.
  Before, each push to the PR started a new 15-minute base build.
- PHP advisory GHSA-6wmf-4rv5-p3rp (CVE-2026-109619) names session upload
  progress as a confirmed exploit path.
- PHP advises to keep it disabled after the patch when the feature is unused.
- PHP image: conf.d/zz-security.ini, and an FPM php_admin_flag so a site
  .user.ini cannot enable it again.
- OLS image: mods-available/zz-security.ini.
- Structure tests check the effective value and the FPM pool file.
- The final stage copies only /usr/local/etc/php from the builder stage.
- /usr/local/etc/php-fpm.d/zz-security.conf was lost, and the structure test failed.
@itsrafsanjani
itsrafsanjani force-pushed the fix/cve-php-base-pipeline branch from 334021f to 44e917e Compare October 21, 2026 14:29
@itsrafsanjani
itsrafsanjani marked this pull request as ready for review October 21, 2026 14:57
@itsrafsanjani
itsrafsanjani merged commit 65c366c into main Oct 21, 2026
9 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant