CVE-2026-42144

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

Published May 4, 2026 CVSS 3.1 · 6.1 Medium EPSS < 1% KEV · Not listed
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.

Remediation

No solution or workaround provided in the CVE record

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Greyclab
Greyclab cimg
Vendors & Products Greyclab
Greyclab cimg
Type Values Removed Values Added
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.
Title CImg Library: Integer overflow in PNM size check bypasses memory guard (_load_pnm)
Weaknesses CWE-190
References
Metrics cvssV3_1

{'score': 6.1, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:H'}

Weaknesses

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
May 5, 2026, 2:14 PM
Reserved
Apr 24, 2026, 5:15 PM
Status
Deferred
Published
May 4, 2026, 6:16 PM
Modified
Oct 26, 2026, 7:10 PM