Read the docs
TI-2026-35174 Aliases CVE-2026-47667

CImg Library: Uncontrolled Memory Allocation and Memory Leak in `_load_analyze()` via Crafted NIfTI/Analyze Header

Priority HIGH 72CWE-1284Published · Updated

Key facts

Attack vector
Network
Privileges required
None
User interaction
None
Attack complexity
Low
Impact type
Denial of service
Confidentiality · integrity · availability
None · None · High
Fix status
Fixed

Attack profile from CVSS 3.1 · CNA. Fix status from CNA. Impact type from CWE-401.

Summary

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.

Why it matters now

Exploitation Proof of concept CISA SSVC · not in CISA KEV
EPSS 0.00517 44th percentileScored 2026-11-07
Fix Fixed CImg (GreycLab): 4.0.0

SSVC decision points

CISA ADP · SSVC 2.0.3

Exploitation
Poc
Automatable
Yes
Technical impact
Partial

The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.

Affected products

VendorProductAffected versionsFixed inStatusSource
GreycLabCImgbefore 4.0.04.0.0Patch availableCNA
  • CImg VendorGreycLab Affected before 4.0.0 Fixed in 4.0.0 Patch available CNA

Remediation

  • Fix · CNA CImg (GreycLab) Fixed in 4.0.0

Vendor assessments

Red Hat

Red Hat's page for this CVE →

Not affected: 1 product
  • Red Hat

Timeline

  1. 2026-10-02 Threatist record created from CVE-2026-47667

References

  • TI-2026-30477 CImg Library: Uncontrolled memory allocation via nb_colors field in _load_bmp CVSS 3.1MEDIUM 5.5
  • TI-2026-81159 Heap out-of-bounds read in GreycLab CImg BMP loader CVSS 4.0MEDIUM 6.9
  • TI-2026-30475 CImg Library: Integer overflow in PNM size check bypasses memory guard (_load_pnm) CVSS 3.1MEDIUM 6.1

Sources