
Differential ASan lab reproducing CVE-2025-15467: a stale FrankenPHP base image ships libcrypto 3.3.5 and crashes on a crafted CMS blob, while the refreshed base rejects it.
| Advisory | GHSA-x9p2-77v6-6vhf (FrankenPHP, Critical 9.8) |
| Component | FrankenPHP Docker images — delayed propagation of security fixes in upstream base images (Alpine / PHP / Go) |
| Affected | Images built before 2026-02-04 ( FrankenPHP < 1.1.11 CI) |
| Fixed in | 1.1.11 / re-pulled tags after the CI fix (daily base-digest check + auto-rebuild) |
| Exposure demonstrated | CVE-2025-15467 — stack buffer overflow in CMS (Auth)EnvelopedData parsing, OpenSSL 3.0/3.3/3.4/3.5/3.6, fixed in 3.0.19/3.3.6/3.4.4/3.5.5/3.6.1 |
| CWE | CWE-1395 (Dependency on Vulnerable Third-Party Component), CWE-121 (Stack-based Buffer Overflow) |
| Impact | A stale image ships libcrypto3 3.3.5; parsing an unauthenticated CMS blob writes attacker-controlled data past a 16-byte stack buffer (iv) before any authentication. The refreshed image ships 3.3.6 and rejects the same blob. |
| Vector | Any code path in the container that parses CMS/PKCS#7 content from attacker-supplied bytes (S/MIME handling, certificate/MAC verification pipelines) |
| Credit | Tim Nelles (advisory reporter); Stanislav Fort, Aisle Research (CVE-2025-15467) |
FrankenPHP built its container images only when a base-image tag changed, but Alpine, PHP and Go overwrite existing tags to ship security fixes. An image baked before 2026-02-04 therefore keeps a stale base snapshot under a constant FrankenPHP tag: latest of that tag can still run on a base that the OpenSSL January 27, 2026 advisory patched weeks earlier. This lab reproduces the failure mode deterministically — one image from the stale alpine:3.21.5 snapshot, one from the advisory release alpine:3.21.6, identical in every other respect — and proves the exposure end to end: the stale side ships libcrypto3-3.3.5-r0 and a crafted CMS EnvelopedData blob with an oversized AES-GCM nonce produces an AddressSanitizer stack-buffer-overflow (4096-byte WRITE over the 16-byte iv stack buffer) before any authentication; the refreshed side ships 3.3.6-r0 and rejects the same blob with a cipher-parameter error.
The propagation failure. FrankenPHP's build server triggered image builds only on new base-image tags. Alpine's security releases (3.20.9 / 3.21.6 / 3.22.3 / 3.23.3, Jan 27 2026) were published by overwriting the existing alpine:3.20, alpine:3.21, … tags, so no build was triggered. An image whose FROM alpine:3.21 resolved to the pre-advisory digest bakes libcrypto3-3.3.5-r0 into every layer built on top of it, for as long as that image is pulled. The registry still serves the old digest by digest — a pinned stale build never heals:
alpine:3.21 (moving tag, today) -> sha256:bc214871… (overwritten upstream)
alpine:3.21.5 (stale snapshot) -> sha256:5405e8f3… (what an old build baked)
alpine:3.21.6 (advisory release) -> sha256:c3f8e73f… (Jan 27 2026 OpenSSL fixes)
The exposure. The stale snapshot ships OpenSSL 3.3.5. CVE-2025-15467: when OpenSSL parses CMS EnvelopedData AEAD parameters, the ASN.1 GCMParameters.aes-nonce octet string is copied into a fixed 16-byte stack buffer with no length check. In crypto/evp/evp_lib.c (3.3.5, evp_cipher_get_asn1_aead_params):
unsigned char iv[EVP_MAX_IV_LENGTH]; /* line 256 — 16 bytes */
...
ret = ossl_asn1_type_get_octetstring_int(...); /* line 264 — copies
attacker-controlled
gcm_param->iv length */
with the copy performed by asn1_type_get_int_oct (crypto/asn1/evp_asn1.c, line 77): memcpy(iv, cont, cnt) where cnt is the attacker-supplied nonce length. The call is reached from CMS_decrypt → CMS_dataInit → ossl_cms_EnvelopedData_init_bio → ossl_cms_EncryptedContent_init_bio → evp_cipher_asn1_to_param_ex — i.e. during parameter application, before any key material is used or any authentication tag is verified. 3.3.6 rejects the same parameters at evp_lib.c line 245 with cipher parameter error.
One target image, two base snapshots, identical otherwise:
alpine:3.21.5 snapshot, port 8091. Ships libcrypto3-3.3.5-r0 (embedded OpenSSL 3.3.5, md5 d603235d…).alpine:3.21.6 (the Jan-2026 advisory release), port 8092. Ships libcrypto3-3.3.6-r0 (md5 8c7a9bbb…).GET /audit.json — the shipped crypto stack read from the image itself (base apk database + the version string embedded in the shipped /usr/lib/libcrypto.so.3). Nothing is installed at build time and the live (already-patched) v3.21 repository is never consulted, so the snapshot is audited exactly as shipped.The crafted blob (poc/poc.py:craft_cms) is a minimal DER ContentInfo → EnvelopedData with an empty recipientInfos, an EncryptedContentInfo whose contentEncryptionAlgorithm is id-aes128-GCM with GCMParameters { aes-nonce: OCTET STRING (4096 bytes), aes-ICVlen: 12 } and a stub encryptedContent. Deterministic, 4183 bytes.
./run-lab.sh build # both targets + the PoC runner (probes are compiled in it)
./run-lab.sh up # vuln (8091) + fixed (8092) on network cve128027lab
./run-lab.sh sweep # check / exploit / probe / mitigation
./run-lab.sh down
Single modes:
podman run --rm --network=cve128027lab cve-2026-128027-poc:local \
exploit --vuln http://vuln:8080 --fixed http://fixed:8080
probe and mitigation additionally query the Docker Hub registry from the PoC container to measure the tag overwrite against the live manifests.
poc/poc.py — stdlib-only, four modes:
| mode | purpose |
|---|---|
check | audit one target over HTTP; classify the shipped base snapshot against the advisory's fixed set (Alpine branch fixed releases; OpenSSL per-branch levels). Exit 1 = stale/vulnerable. |
exploit | full differential: audit both sides, then drive the crafted blob through the ASan 3.3.5 and 3.3.6 probes — stack-buffer-overflow on the release the stale image ships, clean cipher parameter error on the fixed release. |
probe | the GHSA mechanism, measured against the live registry: the moving alpine:3.21 tag no longer resolves to the stale digest — an image baked on the stale digest never sees the overwrite. |
mitigation | the published workaround ("pull the latest of your tag" / docker build --pull): re-pulling the moving tag resolves to patched content, while a digest-pinned stale manifest never self-heals. |
Exit codes: 0 safe / workaround validated, 1 vulnerable, 2 target unreachable, 3 primitive confirmed but inconclusive, 4 internal error.