Description
CImg Library is a C++ library for image processing. Prior to commit 4ca26bc, there is an integer overflow vulnerability in the W*H*D size computation inside _load_pnm() that can bypass the memory allocation guard. A crafted PNM/PGM/PPM file with large dimension values causes the overflow to wrap around, allocating an undersized buffer and potentially triggering a heap buffer overflow. Any application using CImg to load untrusted image files is affected. This issue has been patched via commit 4ca26bc.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| GreycLab | CImg | < 4ca26bce4d8c61fcd1507d5f9401b9fb1222c27d | — |
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 | — |