{"id":"CVE-2026-42146","aliases":["DEBIAN-CVE-2026-42146","EUVD-2026-27077","GHSA-g54r-qmgx-c6fv","UBUNTU-CVE-2026-42146"],"status":"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.","severity":{"version":"3.1","score":5.5,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-12","score":0.00182,"percentile":0.07848,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-789"],"published":"2026-05-04T17:53:23Z","modified":"2026-10-28T11:13:25Z","fixes":[{"ecosystem":"Debian:13","package":"cimg","fixed_in":["3.5.2+dfsg-1+deb13u1"],"sources":["osv"]},{"ecosystem":"Debian:14","package":"cimg","fixed_in":["3.5.2+dfsg-2"],"sources":["osv"]}],"affected":[{"source":"osv","ecosystem":"Debian:12","package":"cimg","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["3.2.1+dfsg-1","3.2.1+dfsg-2","3.5.0+dfsg-1","3.5.2+dfsg-1","3.5.2+dfsg-2","4.0.4+dfsg-1"]},{"source":"osv","ecosystem":"Debian:13","package":"cimg","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.5.2+dfsg-1+deb13u1"}]}],"versions":["3.5.2+dfsg-1"]},{"source":"osv","ecosystem":"Debian:14","package":"cimg","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.5.2+dfsg-2"}]}],"versions":["3.5.2+dfsg-1"]},{"source":"osv","ecosystem":"Ubuntu:16.04:LTS","package":"cimg","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.6.4+dfsg-1build1","1.6.5+dfsg-1"]},{"source":"osv","ecosystem":"Ubuntu:Pro:18.04:LTS","package":"cimg","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.7.9+dfsg-2","1.7.9+dfsg-2build1","1.7.9+dfsg-2ubuntu0.18.04.1","1.7.9+dfsg-2ubuntu0.18.04.2","1.7.9+dfsg-2ubuntu0.18.04.2+esm1"]},{"source":"osv","ecosystem":"Ubuntu:20.04:LTS","package":"cimg","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.4.5+dfsg-1"]},{"source":"osv","ecosystem":"Ubuntu:Pro:22.04:LTS","package":"cimg","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.9.4+dfsg-2","2.9.4+dfsg-3","2.9.4+dfsg-3ubuntu0.1~esm1"]},{"source":"osv","ecosystem":"Ubuntu:Pro:24.04:LTS","package":"cimg","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["3.2.1+dfsg-1","3.2.1+dfsg-1ubuntu0.24.04.1~esm1"]},{"source":"osv","ecosystem":"Ubuntu:25.10","package":"cimg","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["3.5.2+dfsg-1"]},{"source":"osv","ecosystem":"Ubuntu:26.10","package":"cimg","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["3.5.2+dfsg-1build1","3.5.2+dfsg-2"]},{"source":"osv","ecosystem":"Ubuntu:26.04:LTS","package":"cimg","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["3.5.2+dfsg-1","3.5.2+dfsg-1build1"]}],"products":[{"vendor":"greyclab","product":"cimg"}],"references":[{"url":"https://github.com/GreycLab/CImg/security/advisories/GHSA-g54r-qmgx-c6fv","tags":["x_refsource_CONFIRM","advisory","report"]},{"url":"https://github.com/GreycLab/CImg/issues/477","tags":["x_refsource_MISC","exploit","report"]},{"url":"https://github.com/GreycLab/CImg/commit/c3aacf5b96ac1e54b7af1957c6737dbf3949f6d3","tags":["x_refsource_MISC","fix"]},{"url":"https://github.com/GreycLab/CImg/releases/tag/v.3.7.5","tags":["x_refsource_MISC","web"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/42xxx/CVE-2026-42146.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-42146","tags":["advisory"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2026-42146","tags":["advisory"]},{"url":"https://ubuntu.com/security/CVE-2026-42146","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-42146","tags":["report"]}],"sources":{"cve":[{"id":"CVE-2026-42146","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.","status":"published","published":"2026-05-04T17:53:23.83Z","modified":"2026-05-06T13:44:14.581Z","cvss":[{"version":"3.1","score":5.5,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H","level":"medium","assessor":"cna"}],"cwes":["CWE-789"],"updated_at":"2026-11-02T13:40:23.731501Z"}],"euvd":[{"id":"EUVD-2026-27077","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.","status":"published","published":"2026-05-04T17:53:23Z","modified":"2026-05-06T13:44:14Z","cvss":[{"version":"3.1","score":5.5,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H","level":"medium"}],"updated_at":"2026-11-02T19:05:16.683147Z"}],"nvd":[{"id":"CVE-2026-42146","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.","status":"published","published":"2026-05-04T18:16:31.977Z","modified":"2026-10-26T19:10:00.163Z","cvss":[{"version":"3.1","score":5.5,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H","level":"medium","assessor":"secondary"}],"cwes":["CWE-789"],"updated_at":"2026-11-02T14:12:17.022502Z"}],"osv":[{"id":"CVE-2026-42146","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.","status":"published","published":"2026-05-04T17:53:23.83Z","modified":"2026-10-28T11:13:25.900854634Z","cvss":[{"version":"3.1","score":5.5,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H","level":"medium"}],"cwes":["CWE-789"],"updated_at":"2026-11-02T15:45:04.117819Z"},{"id":"DEBIAN-CVE-2026-42146","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.","status":"published","published":"2026-05-04T18:16:31.977Z","modified":"2026-10-27T09:47:35.218225662Z","cvss":[{"version":"3.1","score":5.5,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H","level":"medium"}],"updated_at":"2026-11-02T15:45:54.892385Z"},{"id":"UBUNTU-CVE-2026-42146","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.","status":"published","published":"2026-05-04T18:16:00Z","modified":"2026-10-17T12:58:54.149194195Z","cvss":[{"version":"3.1","score":5.5,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H","level":"medium"}],"updated_at":"2026-11-02T16:56:18.393417Z"}]}}
