Skip to content

About

PHP 8.1.34 CLI/FPM Docker image with pinned backports for CVE-2026-109618 and CVE-2026-109619, plus updated native libraries. Documented builds, source and patch checksums, focused regression tests, Trivy reports, and non-root defaults. Linux amd64. UNVERIFIED development preview; independent mysqlnd review remains incomplete.

Topics

Resources

Security policy

Stars

13 stars

Watchers

0 watching

Forks

Repository files navigation

PHP 8.1.34 security backports for Docker

PHP 8.1.34 FPM CVE 2026 Docker image

A PHP 8.1 CLI/FPM image for people who still need to investigate, test or migrate an application that depends on an older PHP runtime.

Moving a legacy application takes time. This project makes the work on its runtime visible: the PHP source, backported patches, native dependencies, build instructions and test evidence live together in one repository. You can pull the existing image, try the small web example or rebuild it yourself.

Current status: UNVERIFIED development preview. Detailed independent mysqlnd review is still unfinished, and the production release gate remains closed. PHP 8.1 reached end of life on 31 December 2025, according to PHP's support history. These backports do not restore official support. Plan a move to a supported PHP branch.

Docker Hub · v1.0.0 preview release · Build workflow · Security status

CVE-2026-109618 and CVE-2026-109619

This image includes targeted fixes for CVE-2026-109618 and CVE-2026-109619 through PHP's official minimal end-of-life backport for PHP 8.1.

CVE Upstream issue Included implementation
CVE-2026-109618 Request-state corruption during out-of-memory handling Official minimal PHP 8.1 EOL backport
CVE-2026-109619 Reuse of stale request-owned global state after its memory is freed Official minimal PHP 8.1 EOL backport

The selected upstream commit is 1d7dec178a094e6e75b229ce22754045f8c6070a. Upstream explicitly identifies both CVE fixes and describes the patch as a minimal mitigation for an EOL version. The build verifies the archive/patch checksums and replays the complete source patch chain. Inputs are locked in source.env; see patch provenance.

This EOL implementation immediately terminates the worker on affected allocation failures without normal shutdown callbacks and disables session upload progress in source and configuration. Applications must tolerate interrupted requests.

These targeted fixes do not restore official support or establish complete security clearance. The image remains UNVERIFIED, the production gate stays closed, and the detailed independent mysqlnd review is still unfinished.

At a glance

Item What you get
PHP 8.1.34, with pinned downstream security backports
Runtime PHP CLI and PHP-FPM; no bundled web server in the PHP image
Platform Linux amd64
Repository release v1.0.0, marked as a prerelease; this is separate from the PHP version
Published image tag 8.1.34-backport.3-fpm-unverified
Default process FPM in the foreground, listening on FastCGI port 9000
Container user UID/GID 10001:10001
Release readiness UNVERIFIED; production_ready=false

Start with a CLI check or the web example. If you are reviewing the build, go to what changed and the test evidence.

Try the image

You need Docker with Linux container support. The image is published for amd64. Other host architectures require working amd64 emulation; native ARM64 builds have not been validated.

Pull the preview:

docker pull shellharbor/php-8.1-cve-2026-docker:8.1.34-backport.3-fpm-unverified

Check the PHP version in an isolated container:

docker run --rm --platform linux/amd64 --network none --read-only \
  --tmpfs /tmp:rw,nosuid,nodev,size=128m \
  --cap-drop ALL --security-opt no-new-privileges \
  --memory 512m --pids-limit 64 \
  shellharbor/php-8.1-cve-2026-docker:8.1.34-backport.3-fpm-unverified php -v

You should see PHP 8.1.34. The backports do not change the upstream version string; the image tag, source locks and build metadata identify this downstream build. To list extensions, replace php -v with php -m in the same command.

Without a command override, the container starts FPM. FPM speaks FastCGI, so pointing a browser at port 9000 will not serve a page. Use a web server such as the Nginx service in the example below, and keep FastCGI off public interfaces.

Pin the published image

A tag is convenient while exploring. A digest selects the exact published artifact:

docker pull shellharbor/php-8.1-cve-2026-docker@sha256:a63f8ee988b6439fb1ab7dbfd216d2701c121b8671d5e6c173e4c241f12e0c3a

The same digest is recorded in the v1.0.0 release. A commit-qualified tag is also available:

shellharbor/php-8.1-cve-2026-docker:8.1.34-backport.3-fpm-unverified-5b71fcc5e816

There is no latest or production-ready Docker tag.

Run the web example

The repository includes a small PHP page and a separate Nginx container. This lets you check a complete HTTP → Nginx → FPM request before connecting your own application.

Clone the repository and run these commands from its root. The examples use a POSIX shell; Docker Compose commands also work in PowerShell.

git clone https://github.com/shellharbor/php-8.1-cve-2026-docker.git
cd php-8.1-cve-2026-docker

docker compose -p php81-preview -f examples/compose.yml up -d --no-build --wait
curl http://127.0.0.1:8081/

Open http://127.0.0.1:8081/ in your browser. The demo returns JSON with the PHP version, SAPI, upload-progress setting and UNVERIFIED security status.

Useful follow-up commands:

docker compose -p php81-preview -f examples/compose.yml ps
docker compose -p php81-preview -f examples/compose.yml logs --tail 100
docker compose -p php81-preview -f examples/compose.yml down

The Compose file publishes Nginx on loopback port 8081 and keeps FPM on a private backend network. Both services mount examples/app/ read-only at /app. To try your own code, adapt those mounts and the Nginx document root to your application.

This is an isolated demo: its PHP backend network has no external connectivity. Database access, outbound requests and persistent application storage need an explicit network/storage design. The example does not include a database.

What is in the image?

The build starts with the official PHP 8.1.34 source archive. It applies the pinned minimal EOL patch, followed by an ordered 20-step historical backport manifest. Archive and patch hashes are checked; source verification replays the full chain and checks the affected bytes. See source.env and patch provenance for the inputs.

Native libraries are pinned separately in native-sources.json:

Component Selected version or source
OpenSSL 3.5.9
cURL 8.23.0
libxml2 2.15.4
SQLite 3.54.1, with column metadata enabled
OpenLDAP Signed Debian source with two pinned upstream security patches
PCRE2 Signed Debian external PCRE2 10.42-1+deb12u2

The extension set includes mysqli, PDO MySQL/PostgreSQL/SQLite, mbstring, curl, OpenSSL, GD, intl, zip, OPcache, bcmath, sockets, pcntl and exif. Use php -m to inspect the complete list in your image.

The final runtime contains the required PHP binaries, libraries, helpers, CA/timezone data and notices. Compilers, Python and package managers stay out of the runtime image; test tools belong to separate build targets. Build metadata and file hashes are available under /usr/local/share/php-cve/.

Compatibility changes to check in your application

Some security and dependency changes affect observable behavior:

  • Session upload progress is disabled in both PHP source and configuration.
  • A PHP memory-limit failure terminates the worker immediately, without ordinary shutdown callbacks.
  • OpenSSL uses implicit rejection for invalid RSA PKCS#1 padding.
  • Empty cURL certificate-blob setters fail; native cURL RTMP/SMB protocols are unavailable.
  • Modern libxml behavior and SQLite defaults can differ from older installations.
  • The internal mysqlnd C ABI changed. Prebuilt third-party extensions require rebuilding and review.

Keep these differences in mind when comparing this image with an older PHP installation. Passing the repository's tests does not establish compatibility with every application, database or extension.

Configuration and everyday use

The image runs as UID/GID 10001:10001 with /app as its working directory. Make mounted application files readable by that user, and provide narrowly scoped writable storage where the application needs it.

Setting Default
PHP memory limit 128 MiB
Maximum POST body 8 MiB
Maximum uploaded file 4 MiB
FPM maximum workers 4
Logs stderr
Writable temporary area /tmp
Session files /tmp/sessions
Shutdown signal SIGQUIT
Healthcheck A real FastCGI ping to FPM

The CLI and Compose examples allocate a 512 MiB container memory limit and a 128 MiB temporary filesystem. These are starting values for the examples, not workload sizing guarantees.

Sessions and uploads under /tmp are ephemeral. Use appropriate external storage or session backends when data must survive container replacement or be shared across replicas.

Configuration sources are config/php.ini and config/php-fpm.conf. Their image paths are /usr/local/etc/php/php.ini and /usr/local/etc/php-fpm.conf; additional INI files are read from /usr/local/etc/php/conf.d/. Mount application-specific configuration read-only. The FPM pool clears inherited environment variables by default, so applications that need selected variables require deliberate pool configuration.

Keep the existing security protections enabled when adapting the image. Read-only operation, TLS verification, disabled upload progress and the conservative production gate are part of the build's contract. The Kubernetes template documents probes and security settings, but has not been validated as a production deployment.

Build and check it yourself

You need Git, Docker Engine with Buildx, network access to the pinned source/package locations, and enough resources to compile PHP and its native libraries. All commands below run from the repository root.

Create a dedicated builder once:

docker buildx create --name php81-cve-builder --driver docker-container \
  --driver-opt image=moby/buildkit@sha256:cec9f139f45e93c5c69c60f8b07cfad9f43f4ef6b6a6cd917527fea5ff2e3dea

Linux or a POSIX shell

Run each step in order:

sh scripts/verify.sh
sh scripts/build.sh
sh scripts/test.sh
sh scripts/scan.sh

The steps verify the source chain, build the runtime, build/run the focused regression target, and collect raw Trivy plus CycloneDX SBOM evidence. They do not publish an image or grant production approval.

Variable Purpose Default
BUILDER Dedicated Buildx builder php81-cve-builder
IMAGE Local runtime image tag The published preview tag
TEST_IMAGE Local focused-test image tag php81-cve:8.1.34-test
BUILD_JOBS Compile parallelism 2

For example, BUILDER=my-builder sh scripts/build.sh reuses an existing dedicated builder. The scripts record the checked-out Git revision and build timestamp in the resulting image. Building with the default tag changes your local tag only; it does not upload to Docker Hub.

Windows PowerShell

After creating the builder, build the runtime and run focused checks with:

./scripts/build.ps1 -Test

Use -Builder, -Image or -Jobs to select a builder, local image tag or compile parallelism. This wrapper saves build/test logs under reports/. Source-only verification and scanner wrappers above use a POSIX shell.

Reports and deeper checks

Scanning writes reports/trivy.json and reports/sbom.cdx.json. These are local outputs and are ignored by Git. The CI workflow uploads build/test/scanner reports as artifacts with a 14-day retention period.

For a full configured upstream test run, the Dockerfile provides a separate upstream-test target. It needs disposable writable test storage and an appropriate runner invocation; the focused test command above does not run that entire suite. Existing full-suite evidence and its limits are described in docs/HISTORY.md.

What has been checked?

The published image was built from source commit 5b71fcc5e8161618dbdb76e8396b13a8a505eb28. Publication checks on 31 October 2026 recorded:

Check Recorded result
Focused local regressions 68 PASS records
Clean GitHub hosted build Successful build and 68 focused PASS records
Standalone FPM and Compose Passed readiness, non-root/read-only operation and shutdown checks
Public Docker Hub pull Anonymous pull and PHP execution from the published digest passed
Raw Trivy scan 3 CRITICAL, 14 HIGH, 52 MEDIUM, 78 LOW, 1 UNKNOWN
Production release gate Denied, as required for this UNVERIFIED preview

The publication CI run rebuilt the same source on a clean hosted runner. That build has its own identity; the Docker Hub digest above belongs to the locally checked image.

The earlier full configured upstream run recorded 13,980 PASS, 7 FAIL, 3 WARN and 0 BORK, alongside expected failures and skips. Those results belong to the earlier local image recorded in the historical evidence. They are retained as prior evidence, not presented as a fresh full-suite pass for every later build.

What UNVERIFIED means here

There is useful build and test evidence, but the security review is incomplete. Detailed independent mysqlnd review, real database/application interoperability, third-party extension compatibility and production deployment validation remain open.

Raw scanner findings are preserved. Earlier native applicability assessments explain individual findings; they do not erase those findings or waive the production gate. A green CI run establishes that its build and checks completed, not that every historical CVE has been resolved. See SECURITY.md and security-report.json for the release boundary.

Common questions

Can I use this as a production-ready replacement?

The project does not approve that use. This is an UNVERIFIED development preview, with an unfinished source review and a closed production gate.

Why does php -v still say 8.1.34?

The project backports changes without inventing a new upstream PHP release number. Use the image digest, downstream tag and embedded build metadata to identify the build.

Why does my code get permission errors?

The runtime deliberately uses a non-root user and supports a read-only root filesystem. Check file access for UID/GID 10001 and provide the specific writable mounts your application needs.

Why is my environment variable missing in PHP-FPM?

The pool sets clear_env = yes. Review which variables your application needs and expose them explicitly in its pool configuration.

Port 8081 is already in use. What should I change?

Choose another loopback host port in examples/compose.yml. FPM's internal port does not need to be published.

Will this project keep PHP 8.1 supported indefinitely?

No support lifetime or exhaustive CVE coverage is promised. Keep migration work moving toward a supported PHP branch.

Find your way around

Path Purpose
Dockerfile Source, native build, runtime, test and evidence targets
docker/ Archive references, signed package inputs and source locks
patches/ Minimal, historical and native patches with provenance
config/ PHP and FPM defaults
scripts/ Build, verification, scan and evidence helpers
tests/ Focused regressions and upstream test adaptations
examples/ Local Nginx/FPM demo
deploy/k8s/ Development Kubernetes template
docs/HISTORY.md Earlier validation scope and identity
evidence/ Selected historical receipts

If you find a build problem or a compatibility regression, an issue with the image digest, platform, relevant logs and a small reproducer makes it easier to investigate. Remove credentials and private application data before sharing logs. Read SECURITY.md before making security-readiness claims.

PHP and native dependencies retain their upstream notices. See NOTICE.md and the license material included in the image.

About

PHP 8.1.34 CLI/FPM Docker image with pinned backports for CVE-2026-109618 and CVE-2026-109619, plus updated native libraries. Documented builds, source and patch checksums, focused regression tests, Trivy reports, and non-root defaults. Linux amd64. UNVERIFIED development preview; independent mysqlnd review remains incomplete.

Topics

Resources

Security policy

Stars

13 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages