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

High

OSV id
GHSA-7hvw-3c2q-45qg
Also known as
CVE-2026-103025
Published
Last modified

Affected packages

PackageAffected versionsFixed in
github.com/bep/imagemeta
Go
< 0.17.3 0.17.3

How to fix it

Upgrade github.com/bep/imagemeta to 0.17.3 or later.

go get github.com/bep/imagemeta@v0.17.3
go mod tidy
  • Indirect Go modules are upgraded the same way (`go get module@version`).
  • Check the changelog for breaking changes (especially across major versions), update the lockfile with the package manager, and run your tests.

Not sure whether your project uses an affected version? Check your lockfile below for free.

Details

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).

References

Am I affected?

Upload or paste your lockfile. We check every package version in it against OSV.dev, this advisory included, and email you the vulnerable ones with the version that fixes them. Free, and no account needed.

or paste its content

Needed when you paste. package.json and pyproject.toml only have version ranges: use the lockfile next to them.

Only package names and versions are checked; the file itself is not kept. We use your email to send this report and nothing else unless you tick the box above. Privacy policy.

About this data

Source: GitHub Advisory Database via OSV.dev (CC-BY 4.0). Severity comes from the advisory's own rating when it has one, else from its CVSS score.