Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconCraft 6-byte file with ~4GB header_size
-
DeliverySubmit as .nii/.hdr/.img to service
-
Exploitload_analyze() allocates ~1.3GB unbounded
-
InstallTruncated fread throws CImgIOException
-
C2Buffer leaked, never freed
-
ExecuteRepeat to exhaust memory
-
ImpactOut-of-memory denial of service
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Resource cleanup, leak prevention
|
| Exploitation Conditions | Exploitation requires that the target application pass attacker-supplied data to CImg's Analyze/NIfTI loader - either an explicit load_analyze() call or the generic load() with a filename ending in .hdr, .img, or .nii - using a CImg build prior to 4.0.0. The malicious file only needs a crafted 4-byte header_size (up to ~4 GB) and to be truncated/malformed so the subsequent fread short-reads and throws. Limiting factors: the attack surface exists only where untrusted files reach the Analyze/NIfTI path, so the AV:N/PR:N/UI:N profile holds fully only for automated, unauthenticated file-ingestion services; interactive desktop use effectively requires the victim to open the file (user interaction), and applications that never call the Analyze loader are not exposed regardless of CImg version. |
| Impact | The provided CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H, base 7.5) correctly scopes this as an availability-only issue - no confidentiality or integrity impact - despite the source Tags labeling it 'Information Disclosure', which is inconsistent with the memory-leak root cause and the C:N/I:N metrics and should be disregarded. No EPSS score and no KEV status were supplied; treat exploitation probability as unquantified but note there is no evidence of active exploitation. The real-world severity is highly deployment-dependent: AV:N and PR:N/UI:N are only realistic where an internet-facing service auto-processes untrusted uploads through CImg's Analyze/NIfTI path; in a desktop tool requiring a user to open a file, effective exploitability drops (user interaction in practice). The impact is also a slow-burn resource-exhaustion DoS (leak accumulates over repeated calls) rather than an instant crash or code execution, so it is a genuine but moderate priority - patch on normal cadence unless CImg sits behind an unauthenticated file-processing endpoint. |
| Exploit ScenarioDerived | An attacker uploads a tiny (as small as 6-byte) file with a .nii, .hdr, or .img extension whose first 4 bytes encode a near-maximal header_size to a service that processes images through CImg; the loader allocates ~1.3 GB, the truncated read throws, and the buffer is leaked. Repeating the upload a handful of times exhausts server RAM and causes an out-of-memory denial of service. No public exploit is identified at time of analysis, but the trigger is trivial to reproduce given the low attack complexity (AC:L). |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jul 21, 2026
Denial-of-service via unbounded memory allocation and leak in the CImg C++ image-processing library affects all versions prior to 4.0.0. In _load_analyze(), a 4-byte attacker-controlled header_size field from an Analyze/NIfTI (.hdr/.img/.nii) file is passed straight to a heap allocation of up to ~4 GB with no check against real file size; when the subsequent short read throws a CImgIOException the buffer is never freed, leaking the full allocation on every call. No public exploit identified at time of analysis and no KEV/EPSS signals were provided, but a 6-byte crafted file reliably leaks ~1.3 GB per invocation, enabling memory-exhaustion DoS against any service that feeds untrusted files to CImg.
RemediationAI
Vendor-released patch: upgrade to CImg 4.0.0 or later, which bounds header_size against the actual file size and converts the loader's manual allocations to RAII-managed CImg<T> buffers so nothing leaks on error paths; because CImg is header-only, rebuild and redeploy every application that embeds it after updating CImg.h (per commit 6a69bf725ffd111a4c7dc61cc15e3661abd158ee and advisory GHSA-rmfc-grgj-qwhv). If you cannot upgrade immediately, apply specific compensating controls: refuse or gate files with .hdr, .img, and .nii extensions before they reach load()/load_analyze() (side effect: legitimate Analyze/NIfTI users lose that format); enforce an upstream file-size and upload-rate limit so a 6-byte file cannot request a multi-gigabyte allocation and repeated calls cannot accumulate leaked memory (side effect: caps large legitimate volumes); and run the image-processing worker under a strict memory cgroup/ulimit with automatic restart so a leak is contained and self-healing rather than fatal to the host (side effect: dropped in-flight jobs on restart).
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
CImg (greyclab:cimg) is a widely used single-header, open-source C++ library for image processing embedded in desktop, scientific, and medical-imaging applications. The flaw is in the Analyze 7.5 / NIfTI-1 loader (_load_analyze), reachable through load_analyze() and the generic load() dispatcher when a file carries the .hdr, .img, or .nii extension. The Analyze/NIfTI header begins with a 4-byte little-endian integer giving the header length; the code reads this as an unsigned int and calls new unsigned char[header_size] before validating it against the actual file size, so a value up to ~4 GB is honored. This maps to CWE-401 (Missing Release of Memory after Effective Lifetime): the exception thrown by the failed fread exits the function on a path that predates the delete[] header, so the large allocation is orphaned. The 4.0.0 fix (commit 6a69bf725ffd) both bounds header_size against the file size (fsiz) and switches every raw new[]/delete[] buffer in the loader to RAII-managed CImg<T> objects, so allocations are released automatically even on exception paths.
Know when Cimg gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Trivial crafted file (AC:L) processed by an unauthenticated network file service (AV:N/PR:N/UI:N) causes memory-exhaustion DoS only, so A:H with C:N/I:N.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
2DescriptionCVE.org
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.
Executive ViewAI
CImg, a widely-used C++ image-processing library, contains a denial-of-service vulnerability in all versions prior to 4.0.0 that allows attackers to exhaust server memory through specially crafted medical imaging files. Any application accepting user-supplied .hdr, .img, or .nii files (including medical, scientific, or design software) is vulnerable; a 6-byte malicious file can leak over 1 GB of memory per invocation, enabling complete service disruption with minimal attacker resources.
No vendor-released patch identified at time of analysis. Interim mitigations: (1) Disable Analyze/NIfTI file format parsing if not operationally required; (2) Enforce strict file size and header validation before passing data to CImg; (3) Run CImg file operations in isolated containers with enforced per-process memory limits; (4) Rate-limit and authenticate all file upload endpoints; (5) Monitor CImg project releases and vendor advisories for patch availability.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
An issue in cimg.eu Cimg Library v2.9.3 allows an attacker to obtain sensitive information via a crafted JPEG file. Rate
A flaw was found in CImg in versions prior to 2.9.3. Rated high severity (CVSS 8.1), this vulnerability is remotely expl
A heap-based buffer overflow in Clmg before 3.3.3 can occur via a crafted file to cimg_library::CImg<unsigned char>::_lo
An issue was discovered in CImg v.220. Rated high severity (CVSS 7.8), this vulnerability is no authentication required,
An issue was discovered in CImg v.220. Rated high severity (CVSS 7.8), this vulnerability is no authentication required,
An issue was discovered in CImg v.220. Rated high severity (CVSS 7.8), this vulnerability is no authentication required,
An issue was discovered in CImg v.220. Rated high severity (CVSS 7.8), this vulnerability is no authentication required,
An issue was discovered in CImg v.220. Rated high severity (CVSS 7.8), this vulnerability is no authentication required,
An issue was discovered in CImg v.220. Rated high severity (CVSS 7.8), this vulnerability is no authentication required,
An issue was discovered in CImg v.220. Rated high severity (CVSS 7.8), this vulnerability is no authentication required,
An issue was discovered in CImg v.220. Rated high severity (CVSS 7.8), this vulnerability is no authentication required,
CImg The CImg Library v.2.3.3 and earlier is affected by: command injection. Rated critical severity (CVSS 9.8), this vu
EUVD-2026-46392
NVD
CVE.org
EPSS
GitHub
Exploit-DB