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.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| GreycLab | CImg | < c3aacf5b96ac1e54b7af1957c6737dbf3949f6d3 | — |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | cimg | 3.5.2+dfsg-2 | — |
| Debian 13 | cimg | 3.5.2+dfsg-1+deb13u1 | — |
| Debian 12 | cimg | No fix yet | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 26.10 | cimg | No fix yet | — |
| Ubuntu 26.04 LTS | cimg | No fix yet | — |
| Ubuntu 25.10 | cimg | No fix yet | — |
| Ubuntu 20.04 LTS | cimg | No fix yet | — |
| Ubuntu 16.04 LTS | cimg | No fix yet | — |
Show 3 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu Pro 24.04 LTS | cimg | No fix yet | — |
| Ubuntu Pro 22.04 LTS | cimg | No fix yet | — |
| Ubuntu Pro 18.04 LTS | cimg | No fix yet | — |