Skip to content
OpenAdvisories
Medium · 6.1 CVE-2026-42144 EUVD-2026-27075

CImg Library: Integer overflow in PNM size check bypasses memory guard (_load_pnm)

Published May 4, 2026 · Updated May 5, 2026 · Assigned by GitHub_M

Description

CImg Library is a C++ library for image processing. Prior to commit 4ca26bc, there is an integer overflow vulnerability in the W*H*D size computation inside _load_pnm() that can bypass the memory allocation guard. A crafted PNM/PGM/PPM file with large dimension values causes the overflow to wrap around, allocating an undersized buffer and potentially triggering a heap buffer overflow. Any application using CImg to load untrusted image files is affected. This issue has been patched via commit 4ca26bc.

Affected products

VendorProductAffectedFixed
GreycLab CImg < 4ca26bce4d8c61fcd1507d5f9401b9fb1222c27d —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 cimg 3.5.2+dfsg-2 —
Debian 13 cimg 3.5.2+dfsg-1+deb13u1 —
Debian 12 cimg No fix yet —
ReleasePackageFixed inAdvisory
Ubuntu 26.10 cimg No fix yet —
Ubuntu 26.04 LTS cimg No fix yet —
Ubuntu 25.10 cimg No fix yet —
Ubuntu 20.04 LTS cimg No fix yet —
Ubuntu 16.04 LTS cimg No fix yet —
Show 3 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Ubuntu Pro 24.04 LTS cimg No fix yet —
Ubuntu Pro 22.04 LTS cimg No fix yet —
Ubuntu Pro 18.04 LTS cimg No fix yet —

References