CVE-2026-42146
CVE-2026-42146 · CImg Library: Uncontrolled memory allocation via nb_colors field in _load_bmp
This page contains facts from public vulnerability sources. Check the original advisory before updating.
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.
CVSS 5.5 · Medium · EPSS 0.2% · Fix available
- Published
- Updated
Stack: system
Affected products and versions
cimg
- Versions
- < c3aacf5b96ac1e54b7af1957c6737dbf3949f6d3: Affected
No fix published
cimg Debian:12
- 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
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
cimg Debian:13
- Versions
- 3.5.2+dfsg-1
- Affected ranges
- ECOSYSTEM: < 3.5.2+dfsg-1+deb13u1
Update to 3.5.2+dfsg-1+deb13u1
cimg Debian:14
- Versions
- 3.5.2+dfsg-1
- Affected ranges
- ECOSYSTEM: < 3.5.2+dfsg-2
Update to 3.5.2+dfsg-2
cimg Ubuntu:16.04:LTS
- Versions
- 1.6.4+dfsg-1build1
- 1.6.5+dfsg-1
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
cimg Ubuntu:Pro:18.04:LTS
- 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
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
cimg Ubuntu:20.04:LTS
- Versions
- 2.4.5+dfsg-1
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
cimg Ubuntu:Pro:22.04:LTS
- Versions
- 2.9.4+dfsg-2
- 2.9.4+dfsg-3
- 2.9.4+dfsg-3ubuntu0.1~esm1
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
cimg Ubuntu:Pro:24.04:LTS
- Versions
- 3.2.1+dfsg-1
- 3.2.1+dfsg-1ubuntu0.24.04.1~esm1
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
cimg Ubuntu:25.10
- Versions
- 3.5.2+dfsg-1
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
cimg Ubuntu:26.10
- Versions
- 3.5.2+dfsg-1build1
- 3.5.2+dfsg-2
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
cimg Ubuntu:26.04:LTS
- Versions
- 3.5.2+dfsg-1
- 3.5.2+dfsg-1build1
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published