CImg Library is a C++ library for image processing. Prior to commit c3aacf5, the nb_colors field read from the BMP file header is used directly to compute an allocation size without validating it against the remaining file size. A crafted BMP file with a large nb_colors value triggers an out-of-memory condition, crashing any application that uses CImg to load untrusted BMP files. This issue has been patched via commit c3aacf5.
{
"cna_assigner": "GitHub_M",
"cwe_ids": [
"CWE-789"
],
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/42xxx/CVE-2026-42146.json",
"unresolved_ranges": [
{
"extracted_events": [
{
"fixed": "c3aacf5b96ac1e54b7af1957c6737dbf3949f6d3"
}
],
"source": "AFFECTED_FIELD"
}
]
}"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-42146.json"
[
{
"deprecated": false,
"digest": {
"line_hashes": [
"318172894725783406681287929515958403779",
"150621348207869847369843225262995890926",
"131616633530240992493435991106862578432",
"210207947198146663960019255917778880673"
],
"threshold": 0.9
},
"id": "CVE-2026-42146-f25f270d",
"signature_type": "Line",
"signature_version": "v1",
"source": "https://github.com/greyclab/cimg/commit/c3aacf5b96ac1e54b7af1957c6737dbf3949f6d3",
"target": {
"file": "CImg.h"
}
}
]
"2026-08-12T16:24:17Z"