
Proof-of-concept and lab for CVE-2026-103025: unbounded zlib inflation in bep/imagemeta PNG zTXt iptc decoding causes memory-exhaustion DoS, with differential vuln/fixed harness.
zTXt iptc profiles (decompression bomb DoS)| CVE | CVE-2026-103025 |
| Component | bep/imagemeta — PNG zTXt "Raw profile type iptc" path (imagedecoder_png.go) |
| Affected | < 0.17.3 |
| Fixed in | 0.17.3 — genuine vendor fix, commit 2289fdf8 |
| CWE | CWE-770 (Allocation of Resources Without Limits), CWE-409 (Improper Handling of Highly Compressed Data) |
| Impact | Memory-exhaustion denial of service against any application decoding untrusted PNGs: a 65 KB file allocates ~471 MB; larger bombs scale linearly |
| Vector | File format — a crafted PNG supplied to imagemeta.Decode |
| Trigger | a zTXt chunk named Raw profile type iptc whose zlib stream expands far beyond the input size |
Two paths were unbounded: the declared chunk length drove a make via
readBytesVolatile (bypassing the maxBufSize guard that only covered
bufferedReader), and the embedded zlib stream was inflated with an
unbounded io.ReadAll. The fix moves the bound into every size-bearing
read and caps the inflated output:
// v0.17.3, decompressZTXt()
p, err := io.ReadAll(io.LimitReader(z, maxBufSize+1))
if len(p) > maxBufSize {
return nil, fmt.Errorf("uncompressed zTXt size exceeds max %d", maxBufSize)
}
maxBufSize (10 MiB) protected only the buffered reader, not the volatile
allocation driven by the attacker-declared chunk length, and not the zlib
inflation. A small compressed stream can therefore expand to hundreds of
megabytes of genuinely resident memory before any later validation runs.
The fix applies the bound at the read layer and caps inflation, so both
paths inherit the limit.
| service | image | role |
|---|---|---|
img-vuln | cve-2026-103025:vuln | imagemeta v0.17.2 |
img-fixed | cve-2026-103025:fixed | imagemeta v0.17.3 (vendor fix) |
poc | cve-2026-103025-poc:local | stdlib-only Python driver |
A Go harness crafts a minimal PNG (IHDR + zTXt iptc bomb + IEND), calls the
real imagemeta.Decode, and reports the runtime.MemStats.TotalAlloc
delta. A Python service runs that harness as a child and exposes the
measured allocation and error.
./run-lab.sh build # builds both tags with Go 1.25
./run-lab.sh up # cve103025lab network: img-vuln / img-fixed
./run-lab.sh sweep # check / exploit / probe / mitigation on both sides
./run-lab.sh down
poc/poc.py (stdlib only):
2289fdf8.A standalone full-chain exploit ships at exploit/exploit.py:
python3 exploit/exploit.py --host=img-vuln
# exit 1 on confirmed unbounded allocation, 0 on a safe target
| bomb size | img-vuln (0.17.2) | img-fixed (0.17.3) |
|---|---|---|
| 16 MB | ~122 MB allocated | ~50 MB, "exceeds max 10485760" |
| 64 MB | ~471 MB allocated | ~50 MB, bounded error |
| 128 MB | ~926 MB allocated | ~50 MB, bounded error |
Captured runs: evidence/check-*-run.txt, evidence/exploit-*-run.txt,
evidence/probe-*-run.txt, evidence/mitigation-*-run.txt,
evidence/exploit-standalone-run.txt, evidence/versions.txt,
evidence/0day-sweep.txt.
cve103025lab
network (2 GB per target so the vulnerable allocation is observable).The probe matrix on 0.17.3 caps allocation near maxBufSize for every bomb
size and returns a bounded-size error; the vulnerable line scales with the
inflated size. No second unbounded path was found in the zTXt iptc branch
after the fix.
README.md this write-up
run-lab.sh environment driver (build / up / sweep / down)
Makefile convenience targets
poc/poc.py the PoC (check / exploit / probe / mitigation)
exploit/exploit.py standalone full-chain exploit
lab/lab.Dockerfile builds both upstream tags
lab/harness/main.go Go driver crafting the bomb + measuring allocation
lab/service.py HTTP wrapper (POST /decode)
evidence/ captured runs of every mode on both sides
TRACKING.md excluded (working record)