Skip to content

Instantly share code, notes, and snippets.

@MrErikCodes
MrErikCodes / Dockerfile
Last active October 22, 2026 18:25
PHP2Shell (CVE-2026-109618, CVE-2026-109619): patch the PHP inside a container image before upstream rebuilds it
# Rebuilds an image's PHP from a newer upstream patch release, in place, for a PHP security release
# that lands before the image's maintainers rebuild (PHP2Shell, CVE-2026-109618 and CVE-2026-109619).
# Works on any docker-library based image (php, phpmyadmin, roundcube/roundcubemail, shinsenter/php):
# the image's own configure flags (`php-config --configure-options`), the source checked against
# php.net's SHA-256 and the release managers' GPG keys ($GPG_KEYS, set by the base image). A patch
# release keeps the extension API, so the image's own shared extensions and config load unchanged.
#
# podman build --build-arg BASE=<image> --build-arg PHP_NEW=<version> \
# --build-arg PHP_NEW_SHA256=<sha256 of php-<version>.tar.xz> -t <tag> .
#