CVE-2026-42146

CImg Library: Uncontrolled memory allocation via nb_colors field in _load_bmp

MEDIUM
5.5
CVSS Score
Published: May 4, 2026 at 05:53 PM UTC
Updated: October 26, 2026 at 07:10 PM UTC
1 product affected across 1 vendorCImg

Using CImg by GreycLab?

Get instant alerts when new vulnerabilities affect CImg - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
MEDIUM5.5
Exploit prediction
EPSS 0.2%
SSVC
PoC

Description

CImg Library is a C++ library for image processing. Prior to commit c3aacf5, the nb_colors field read from the BMP file header is used directly to compute an allocation size without validating it against the remaining file size. A crafted BMP file with a large nb_colors value triggers an out-of-memory condition, crashing any application that uses CImg to load untrusted BMP files. This issue has been patched via commit c3aacf5.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

< c3aacf5b96ac1e54b7af1957c6737dbf3949f6d3

Remediation

No guide yet

No remediation guidance has been written for this CVE yet, and no fixed version or vendor advisory is recorded against it.

SSVC — Action Prioritization

SSVCPoCNot automatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

5.5MEDIUMGitHub_M
Attack Vector
LOCAL
Complexity
LOW
Privileges
NONE
User Interaction
REQUIRED
Scope
UNCHANGED
Confidentiality
NONE
Integrity
NONE
Availability
HIGH
Vector?

Quick Info

StatusDEFERRED
CWE
CWE-789

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card