{"id":"CVE-2026-42146","published":"2026-05-04T17:53:23Z","modified":"2026-05-06T13:44:14Z","title":"CImg Library: Uncontrolled memory allocation via nb_colors field in _load_bmp","vendor":"GreycLab","product":"CImg","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":5.5,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00172,"percentile":0.03867,"provenance":"source"},"cwes":[{"id":"CWE-789","name":"Memory Allocation with Excessive Size Value"}],"references":[{"url":"https://github.com/GreycLab/CImg/security/advisories/GHSA-g54r-qmgx-c6fv","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/GreycLab/CImg/issues/477","tags":["x_refsource_MISC"]},{"url":"https://github.com/GreycLab/CImg/commit/c3aacf5b96ac1e54b7af1957c6737dbf3949f6d3","tags":["x_refsource_MISC"]},{"url":"https://github.com/GreycLab/CImg/releases/tag/v.3.7.5","tags":["x_refsource_MISC"]}],"priority":{"score":4.6,"factors":[{"name":"EPSS percentile","points":0.77},{"name":"CVSS severity","points":3.85}]},"vendorSlug":"greyclab","affectedVersions":[{"vendor":"GreycLab","product":"CImg","versions":["< c3aacf5b96ac1e54b7af1957c6737dbf3949f6d3"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial","timestamp":"2026-05-06T13:43:28.189688Z","from":"CISA ADP","provenance":"source"},"euvd":{"id":"EUVD-2026-27077","exploited":false,"provenance":"source"}}