Skip to content

CVE-2026-42144 CImg Library: Integer overflow in PNM size check bypasses memory guard (_load_pnm)

MediumCVSS 6.1 EPSS 0.14%
Published
Updated
Exploit status
No public exploit known
CISA SSVC
No known exploitation · automatable: no · technical impact: partial
Technology
UbuntuDebian

Description

CImg Library is a C++ library for image processing. Prior to commit 4ca26bc, there is an integer overflow vulnerability in the WHD 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.

Upgrade path

8 packages: 2 fixed, 5 with no fix yet.

PackageAffectedFixed inStatus
debian/cimg(Debian 12) = 3.2.1+dfsg-1; = 3.2.1+dfsg-2; = 3.5.0+dfsg-1; = 3.5.2+dfsg-1 +3 more No fix listed No fix yet
ubuntu/cimg(Ubuntu 22.04) All versions No fix listed No fix yet
ubuntu/cimg(Ubuntu 24.04) All versions No fix listed No fix yet
ubuntu/cimg(Ubuntu 26.04) All versions No fix listed No fix yet
ubuntu/cimg(Ubuntu 26.10) All versions No fix listed No fix yet
debian/cimg(Debian 13) < 3.5.2+dfsg-1+deb13u1; = 3.5.2+dfsg-1 3.5.2+dfsg-1+deb13u1 Fixed
debian/cimg(Debian 14) < 3.5.2+dfsg-2; = 3.5.2+dfsg-1 3.5.2+dfsg-2 Fixed
GreycLab CImg = < 4ca26bce4d8c61fcd1507d5f9401b9fb1222c27d No fix listed Versions listed

Affected products

ProductAffected versionsFixed in
GreycLab CImg = < 4ca26bce4d8c61fcd1507d5f9401b9fb1222c27d No fix listed
debian/cimg(Debian:12) All versions No fix listed
debian/cimg(Debian:12) = 3.2.1+dfsg-1 No fix listed
debian/cimg(Debian:12) = 3.2.1+dfsg-2 No fix listed
debian/cimg(Debian:12) = 3.5.0+dfsg-1 No fix listed
debian/cimg(Debian:12) = 3.5.2+dfsg-1 No fix listed
debian/cimg(Debian:12) = 3.5.2+dfsg-2 No fix listed
debian/cimg(Debian:12) = 4.0.4+dfsg-1 No fix listed
debian/cimg(Debian:13) < 3.5.2+dfsg-1+deb13u1 3.5.2+dfsg-1+deb13u1
debian/cimg(Debian:13) = 3.5.2+dfsg-1 No fix listed
debian/cimg(Debian:14) < 3.5.2+dfsg-2 3.5.2+dfsg-2
debian/cimg(Debian:14) = 3.5.2+dfsg-1 No fix listed
ubuntu/cimg(Ubuntu:22.04) All versions No fix listed
ubuntu/cimg(Ubuntu:24.04) All versions No fix listed
ubuntu/cimg(Ubuntu:26.04) All versions No fix listed
ubuntu/cimg(Ubuntu:26.10) All versions No fix listed

References