{"id":"CVE-2026-42146","state":"PUBLISHED","title":"CImg Library: Uncontrolled memory allocation via nb_colors field in _load_bmp","description":"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.","publishedAt":"2026-05-04T17:53:23.830Z","updatedAt":"2026-05-06T13:44:14.581Z","severity":{"score":5.5,"label":"Medium","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H","source":"GitHub_M"},"assigner":"GitHub_M","products":["GreycLab CImg"],"affected":[{"vendor":"GreycLab","product":"CImg","versions":[{"version":"< c3aacf5b96ac1e54b7af1957c6737dbf3949f6d3","status":"affected"}]}],"references":["https://github.com/GreycLab/CImg/security/advisories/GHSA-g54r-qmgx-c6fv","https://github.com/GreycLab/CImg/issues/477","https://github.com/GreycLab/CImg/commit/c3aacf5b96ac1e54b7af1957c6737dbf3949f6d3","https://github.com/GreycLab/CImg/releases/tag/v.3.7.5"],"weaknesses":["CWE-789"],"ingestedAt":"2026-10-29T20:11:57.932Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/42xxx/CVE-2026-42146.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-42146","state":"PUBLISHED","datePublished":"2026-05-04T17:53:23.830Z","dateUpdated":"2026-05-06T13:44:14.581Z","assignerShortName":"GitHub_M","assignerOrgId":"a0819718-46f1-4df5-94e2-005712e83aaa","dateReserved":"2026-04-24T17:15:21.834Z"},"containers":{"cna":{"title":"CImg Library: Uncontrolled memory allocation via nb_colors field in _load_bmp","descriptions":[{"lang":"en","value":"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."}],"affected":[{"vendor":"GreycLab","product":"CImg","versions":[{"version":"< c3aacf5b96ac1e54b7af1957c6737dbf3949f6d3","status":"affected"}]}],"references":[{"url":"https://github.com/GreycLab/CImg/security/advisories/GHSA-g54r-qmgx-c6fv","name":"https://github.com/GreycLab/CImg/security/advisories/GHSA-g54r-qmgx-c6fv","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/GreycLab/CImg/issues/477","name":"https://github.com/GreycLab/CImg/issues/477","tags":["x_refsource_MISC"]},{"url":"https://github.com/GreycLab/CImg/commit/c3aacf5b96ac1e54b7af1957c6737dbf3949f6d3","name":"https://github.com/GreycLab/CImg/commit/c3aacf5b96ac1e54b7af1957c6737dbf3949f6d3","tags":["x_refsource_MISC"]},{"url":"https://github.com/GreycLab/CImg/releases/tag/v.3.7.5","name":"https://github.com/GreycLab/CImg/releases/tag/v.3.7.5","tags":["x_refsource_MISC"]}],"metrics":[{"cvssV3_1":{"attackComplexity":"LOW","attackVector":"LOCAL","availabilityImpact":"HIGH","baseScore":5.5,"baseSeverity":"MEDIUM","confidentialityImpact":"NONE","integrityImpact":"NONE","privilegesRequired":"NONE","scope":"UNCHANGED","userInteraction":"REQUIRED","vectorString":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H","version":"3.1"}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-789","lang":"en","description":"CWE-789: Memory Allocation with Excessive Size Value","type":"CWE"}]}],"providerMetadata":{"shortName":"GitHub_M","orgId":"a0819718-46f1-4df5-94e2-005712e83aaa","dateUpdated":"2026-05-04T17:53:23.830Z"},"source":{"advisory":"GHSA-g54r-qmgx-c6fv","discovery":"UNKNOWN"}},"adp":[{"title":"CISA ADP Vulnrichment","references":[{"url":"https://github.com/GreycLab/CImg/issues/477","tags":["exploit"]}],"metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2026-05-06T13:43:28.189688Z","id":"CVE-2026-42146","options":[{"Exploitation":"poc"},{"Automatable":"no"},{"Technical Impact":"partial"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-05-06T13:44:14.581Z"}}]}}}