NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · Go

CVE-2026-103025: bep/imagemeta: Unbounded memory allocation decoding PNG `zTXt` "Raw profile type iptc" chunks

highCVSS 4.0 8.7GHSA-7hvw-3c2q-45qg

The Go library github.com/bep/imagemeta before 0.17.3 lets a crafted PNG exhaust memory in `imagemeta.Decode`. Any service that decodes untrusted PNGs with it can be knocked over by a tiny file. Upgrade to 0.17.3.

Published Nov 20, 2026 · Analysis Nov 20, 2026

What an attacker can do

Two paths in the zTXt "Raw profile type iptc" branch are unbounded. First, the declared chunk length drives an allocation directly. Second, the embedded zlib stream is decompressed with no output limit. The advisory measured a 42-byte file allocating 256 MB and a 127 KB file allocating 460 MB.

The decompression bomb is the more reliable vector because it produces resident memory. The effect of the oversized make depends on the platform's overcommit behavior and on any GOMEMLIMIT or cgroup limit. An attacker needs only to submit a PNG to an application that reads its metadata, such as an upload endpoint or an image pipeline. The result is a denial of service (CWE-409, CWE-789). There is no confidentiality or integrity impact.

Who is affected

All versions of github.com/bep/imagemeta below 0.17.3. Only PNG decoding with IPTC as a metadata source is affected. Check which version your module uses:

go list -m github.com/bep/imagemeta

The library is often pulled in indirectly, so run it from the root of each project that builds image-handling code.

github.com/bep/imagemeta

Ecosystem
Go
Affected
< 0.17.3
Fixed in
0.17.3
Check
go list -m github.com/bep/imagemeta

How to fix it

Upgrade to 0.17.3:

go get github.com/bep/[email protected]

The release note says it bounds allocations in the zTXt Raw profile type iptc path. Workarounds from the advisory: reject or bound PNG input size before calling Decode, or remove IPTC from Options.Sources if you do not need IPTC metadata.

How to tell if you were hit

Look for out-of-memory kills, container restarts or memory spikes in services that process uploaded images. Check recent uploaded PNGs for small files that trigger large allocations. Inspect PNG files for a zTXt chunk with the keyword "Raw profile type iptc" and an unusually large declared length.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

A crafted PNG can make imagemeta.Decode allocate memory far in excess of the input file's size, leading to memory exhaustion. Two separate paths in the zTXt "Raw profile type iptc" branch are affected: the declared chunk length drives an allocation directly, and the embedded zlib stream is decompressed without an output bound. A 42-byte file allocated 256 MB, and a 127 KB file allocated 460 MB.

Impact

Denial of service by memory exhaustion against any application that decodes untrusted PNG images with this library. The decompression bomb is the more reliable vector, since it produces genuinely resident memory; the effect of the oversized make depends on the platform's overcommit behavior and any configured GOMEMLIMIT or cgroup limit.

Patches

Fixed in v0.17.3.

Workarounds

Reject or bound PNG input size before calling Decode, or clear IPTC from Options.Sources if IPTC metadata is not required.

Credits

Reported by Arpit Jain (@arpitjain099).

Credited to arpitjain099.

Questions

Can a small file really cause this?

Yes. The advisory reports a 42-byte PNG that allocated 256 MB and a 127 KB PNG that allocated 460 MB.

Am I affected if I never read IPTC metadata?

The advisory lists removing IPTC from Options.Sources as a workaround, so skipping IPTC avoids the vulnerable branch. Upgrading to 0.17.3 is still the proper fix.

Does it allow code execution or data theft?

No. The impact is denial of service by memory exhaustion only. The CVSS 4.0 vector rates availability impact as high and confidentiality and integrity as none.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More Go vulnerabilities

All Go entries