CVE-2026-42144
JSON

6.1medium

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

Severity
6.1medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.15% (higher than 4% of CVEs; EPSS, by FIRST)
Published
Last changed
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

Product or packageVersionsReported by
GreycLab CImg< 4ca26bce4d8c61fcd1507d5f9401b9fb1222c27dCVE List

Classification

CWE-190

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

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.

NVD (es)

Biblioteca CImg es una biblioteca de C++ para procesamiento de imágenes. Antes del commit 4ca26bc, existe una vulnerabilidad de desbordamiento de entero en el cálculo del tamaño WHD dentro de _load_pnm() que puede eludir la protección de asignación de memoria. Un archivo PNM/PGM/PPM manipulado con valores de dimensión grandes provoca que el desbordamiento se ajuste, asignando un búfer de tamaño insuficiente y potencialmente desencadenando un desbordamiento de búfer en el heap. Cualquier aplicación que utilice CImg para cargar archivos de imagen no confiables se ve afectada. Este problema ha sido parcheado mediante el commit 4ca26bc.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-42144 changed 2026-05-05CVE Terms of Use
NVDCVE-2026-42144 changed 2026-10-26Public domain