Skip to main content

CImg Library EUVDEUVD-2026-46392

| CVE-2026-47667 HIGH
Memory Leak (CWE-401)
2026-07-21 GitHub_M
7.5
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Craft 6-byte file with ~4GB header_size
  2. Delivery
    Submit as .nii/.hdr/.img to service
  3. Exploit
    load_analyze() allocates ~1.3GB unbounded
  4. Install
    Truncated fread throws CImgIOException
  5. C2
    Buffer leaked, never freed
  6. Execute
    Repeat to exhaust memory
  7. Impact
    Out-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).

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.4% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

CImg < 4.0.0

Affected Packages

euvd cimg fix: 4.0.0

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

Vendor (GitHub_M) PRIMARY 7.5 HIGH
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
vuln.today AI 7.5 HIGH

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.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

Lifecycle Timeline

2
Patch available
Jul 21, 2026 - 23:36 EUVD
CVE Published
Jul 21, 2026 - 19:57 cve.org
HIGH 7.5

DescriptionCVE.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

Why It Matters

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.

Business Impact: High
Compensating Controls

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

EPSS Score
0.4%
Top 65% exploitable
Prevalence
Medium
popular header-only C++ imaging library, but Analyze/NIfTI path is niche
Data Quality
5 sources
Confidence: Medium

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.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.4%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact
High

Priority Score

38
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +38
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

More in Cimg

View all
CVE-2023-41484 HIGH POC
8.1 Sep 20

An issue in cimg.eu Cimg Library v2.9.3 allows an attacker to obtain sensitive information via a crafted JPEG file. Rate

CVE-2020-25693 HIGH POC
8.1 Dec 03

A flaw was found in CImg in versions prior to 2.9.3. Rated high severity (CVSS 8.1), this vulnerability is remotely expl

CVE-2024-26540 HIGH POC
7.8 Mar 15

A heap-based buffer overflow in Clmg before 3.3.3 can occur via a crafted file to cimg_library::CImg<unsigned char>::_lo

CVE-2018-7641 HIGH POC
7.8 Mar 02

An issue was discovered in CImg v.220. Rated high severity (CVSS 7.8), this vulnerability is no authentication required,

CVE-2018-7640 HIGH POC
7.8 Mar 02

An issue was discovered in CImg v.220. Rated high severity (CVSS 7.8), this vulnerability is no authentication required,

CVE-2018-7639 HIGH POC
7.8 Mar 02

An issue was discovered in CImg v.220. Rated high severity (CVSS 7.8), this vulnerability is no authentication required,

CVE-2018-7638 HIGH POC
7.8 Mar 02

An issue was discovered in CImg v.220. Rated high severity (CVSS 7.8), this vulnerability is no authentication required,

CVE-2018-7637 HIGH POC
7.8 Mar 02

An issue was discovered in CImg v.220. Rated high severity (CVSS 7.8), this vulnerability is no authentication required,

CVE-2018-7589 HIGH POC
7.8 Mar 01

An issue was discovered in CImg v.220. Rated high severity (CVSS 7.8), this vulnerability is no authentication required,

CVE-2018-7588 HIGH POC
7.8 Mar 01

An issue was discovered in CImg v.220. Rated high severity (CVSS 7.8), this vulnerability is no authentication required,

CVE-2018-7587 HIGH POC
7.8 Mar 01

An issue was discovered in CImg v.220. Rated high severity (CVSS 7.8), this vulnerability is no authentication required,

CVE-2019-1010174 CRITICAL
9.8 Jul 25

CImg The CImg Library v.2.3.3 and earlier is affected by: command injection. Rated critical severity (CVSS 9.8), this vu

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy