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 loadpnm() 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.
{
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/42xxx/CVE-2026-42144.json",
"unresolved_ranges": [
{
"source": "AFFECTED_FIELD",
"extracted_events": [
{
"fixed": "4ca26bce4d8c61fcd1507d5f9401b9fb1222c27d"
}
]
}
],
"cwe_ids": [
"CWE-190"
],
"cna_assigner": "GitHub_M"
}[
{
"id": "CVE-2026-42144-8a6b8b38",
"target": {
"file": "CImg.h"
},
"deprecated": false,
"digest": {
"threshold": 0.9,
"line_hashes": [
"249642404748551601227349605092831156070",
"208368624136566835070189514910943652454",
"119132674456202809250499974064139081974",
"327203091358891169173241453447851621014"
]
},
"signature_version": "v1",
"source": "https://github.com/greyclab/cimg/commit/4ca26bce4d8c61fcd1507d5f9401b9fb1222c27d",
"signature_type": "Line"
}
]
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-42144.json"
"2026-08-12T16:25:14Z"