CVE-2026-47667: CWE-401: Missing Release of Memory after Effective Lifetime in GreycLab CImg
CImg Library versions prior to 4.0.0 contain a memory leak vulnerability in the _load_analyze() function when processing Analyze/NIfTI files. The vulnerability arises because the header_size field is read without bounds checking and used to allocate memory, which is not freed if a file read error occurs. This can lead to large memory allocations being leaked on error paths, causing denial of service due to resource exhaustion. The issue affects files with extensions .hdr, .img, or .nii. Version 4.0.0 addresses this vulnerability.
AI Analysis
Technical Summary
The CImg Library before version 4.0.0 has a vulnerability (CVE-2026-47667) in the _load_analyze() function where the header_size field from an Analyze/NIfTI file is read as an unsigned int and used directly to allocate memory without validating it against the actual file size. If fread returns fewer bytes than expected due to a malformed file, the function throws an exception but does not free the allocated buffer, causing a memory leak. A crafted 6-byte file can trigger an allocation of approximately 1.3 GB per call, leaking memory on every error path. This affects the load_analyze() and generic load() functions for files with .hdr, .img, or .nii extensions. The vulnerability is fixed in version 4.0.0.
Potential Impact
This vulnerability can cause a denial of service by exhausting system memory through repeated memory leaks triggered by malformed input files. There is no impact on confidentiality or integrity reported. The CVSS score is 7.5 (high severity) with network attack vector, low attack complexity, no privileges required, no user interaction, and impact limited to availability.
Mitigation Recommendations
Upgrade to CImg version 4.0.0 or later, where this issue is fixed. There is no official patch advisory beyond this version update. Until upgraded, avoid processing untrusted Analyze/NIfTI files with extensions .hdr, .img, or .nii to prevent triggering the memory leak.
CVE-2026-47667: CWE-401: Missing Release of Memory after Effective Lifetime in GreycLab CImg
Description
CImg Library versions prior to 4.0.0 contain a memory leak vulnerability in the _load_analyze() function when processing Analyze/NIfTI files. The vulnerability arises because the header_size field is read without bounds checking and used to allocate memory, which is not freed if a file read error occurs. This can lead to large memory allocations being leaked on error paths, causing denial of service due to resource exhaustion. The issue affects files with extensions .hdr, .img, or .nii. Version 4.0.0 addresses this vulnerability.
CVSS v3.1
Score 7.5high
Affected software
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The CImg Library before version 4.0.0 has a vulnerability (CVE-2026-47667) in the _load_analyze() function where the header_size field from an Analyze/NIfTI file is read as an unsigned int and used directly to allocate memory without validating it against the actual file size. If fread returns fewer bytes than expected due to a malformed file, the function throws an exception but does not free the allocated buffer, causing a memory leak. A crafted 6-byte file can trigger an allocation of approximately 1.3 GB per call, leaking memory on every error path. This affects the load_analyze() and generic load() functions for files with .hdr, .img, or .nii extensions. The vulnerability is fixed in version 4.0.0.
Potential Impact
This vulnerability can cause a denial of service by exhausting system memory through repeated memory leaks triggered by malformed input files. There is no impact on confidentiality or integrity reported. The CVSS score is 7.5 (high severity) with network attack vector, low attack complexity, no privileges required, no user interaction, and impact limited to availability.
Mitigation Recommendations
Upgrade to CImg version 4.0.0 or later, where this issue is fixed. There is no official patch advisory beyond this version update. Until upgraded, avoid processing untrusted Analyze/NIfTI files with extensions .hdr, .img, or .nii to prevent triggering the memory leak.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-05-19T21:10:38.797Z
- Cvss Version
- 3.1
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a5fd4a41010f89cc224946f
Added to database: 07/21/2026, 20:20:52 UTC
Last enriched: 07/30/2026, 05:17:21 UTC
Last updated: 09/03/2026, 22:52:12 UTC
Views: 88
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.