Track vulnerabilities like this one.
Sign up free to get alerted when software you use is affected.
7.5
CVE-2026-47667: CImg Library: Memory Leak in Image File Loading
CVE-2026-47667 · published 3 months ago
Summary
The CImg Library can leak large amounts of memory when loading certain types of image files. This can happen when the library tries to load a file that is malformed or corrupted. To fix this issue, update the CImg Library to version 4.0.0 or later.
What to do
The CVE record does not list a fixed version. Check the vendor's site or the advisory links below - a fix may already be released.
Affected software
| Ecosystem | Vendor | Product | Affected versions |
|---|---|---|---|
| Debian:11 | debian | cimg | All versions |
| Debian:12 | debian | cimg | All versions |
| Debian:13 | debian | cimg | All versions |
| Debian:14 | debian | cimg | All versions |
| – | greyclab | cimg | < 4.0.0 |
| Ubuntu:16.04:LTS | canonical | cimg | All versions |
| Ubuntu:Pro:18.04:LTS | canonical | cimg | All versions |
| Ubuntu:20.04:LTS | canonical | cimg | All versions |
| Ubuntu:Pro:22.04:LTS | canonical | cimg | All versions |
| Ubuntu:Pro:24.04:LTS | canonical | cimg | All versions |
| Ubuntu:26.04:LTS | canonical | cimg | All versions |
Original advisory text
CImg Library: Uncontrolled Memory Allocation and Memory Leak in `_load_analyze()` via Crafted NIfTI/Analyze Header
CImg Library is a C++ library for image processing. Prior to version 4.0.0 in `_load_analyze()`, the header_size field is read as an `unsigned int` from the first 4 bytes of an Analyze/NIfTI file and passed directly to `new unsigned char[header_size]` without being bounded against the actual file size. A value up to ~4 GB is accepted. If the subsequent `fread` returns `short` as it will for any malformed file), the function throws a `CImgIOException` and the allocated buffer is never freed. A 6-byte crafted file is sufficient to trigger an allocation of ~1.3 GB per call, with the full allocation leaked on every error path. The issue is reachable via `load_analyze()` and the generic `load()` when the file extension is .hdr, .img, or .nii. Version 4.0.0 fixes the issue.
References
- https://github.com/GreycLab/CImg/security/advisories/GHSA-rmfc-grgj-qwhv Vendor Advisory
- https://github.com/GreycLab/CImg/commit/6a69bf725ffd111a4c7dc61cc15e3661abd158ee Patch
- https://security-tracker.debian.org/tracker/CVE-2026-47667 Vendor Advisory
- https://ubuntu.com/security/CVE-2026-47667 Third Party Advisory
- https://github.com/GreycLab/CImg/issues/480 Third Party Advisory
- https://www.cve.org/CVERecord?id=CVE-2026-47667 Third Party Advisory
- https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/47xxx/CVE-2026-47667... Vendor Advisory
- https://nvd.nist.gov/vuln/detail/CVE-2026-47667 Vendor Advisory
Internet-facing
14 days
Internal
60 days
- Not known to be exploited
- Can be exploited automatically
- Gives an attacker partial control
Type
CWE-401Memory Leak
CWE-789Memory Allocation with Excessive Size Value
CWE-1284Improper Validation of Specified Quantity in Input
Timeline
Published21 Jul 2026
Updated4 Nov 2026
First seen21 Jul 2026
Sources
CVE-2026-47667 · NVD
CVE-2026-47667 · MITRE
UBUNTU-CVE-2026-47667 · OSV
DEBIAN-CVE-2026-47667 · OSV
CVE-2026-47667 · OSV
GHSA-rmfc-grgj-qwhv · GHSA
Track software like this
Free during beta