Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…
EPSS 0.1%top 98%

CVE-2026-42146: CWE-789: Memory Allocation with Excessive Size Value in GreycLab CImg

0
Medium
VulnerabilityCVE-2026-42146cvecve-2026-42146cwe-789
Published: Mon May 04 2026 (05/04/2026, 17:53:23 UTC)
Source: CVE Database V5
Vendor/Project: GreycLab
Product: CImg

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.

CVSS v3.1

Score 5.5medium

Attack Vector
Local
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 05/12/2026, 06:18:25 UTC

Technical Analysis

The vulnerability CVE-2026-42146 in GreycLab's CImg library involves a lack of validation on the nb_colors field read from BMP file headers. This field is used to compute memory allocation size without checking if it exceeds the remaining file size, leading to excessive memory allocation attempts. When a malicious BMP file specifies a large nb_colors value, it can trigger an out-of-memory condition causing the application to crash. This is classified under CWE-789 (Memory Allocation with Excessive Size Value). The vulnerability affects all versions before commit c3aacf5 and has been fixed by adding proper validation in that commit.

Potential Impact

Exploitation of this vulnerability results in an out-of-memory condition that crashes applications using vulnerable versions of CImg to load crafted BMP files. There is no indication of confidentiality or integrity impact, only availability is affected due to application crashes. No known exploits have been reported in the wild.

Mitigation Recommendations

This vulnerability has been patched in commit c3aacf5b96ac1e54b7af1957c6737dbf3949f6d3 of the CImg library. Users should upgrade to this version or later to remediate the issue. Since this is not a cloud service, remediation requires updating the library in affected applications. Patch status is confirmed by the referenced commit. No additional mitigation steps are indicated by the vendor.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2026-04-24T17:15:21.834Z
Cvss Version
3.1
State
PUBLISHED
Remediation Level
null

Threat ID: 69f8e3e0cbff5d86103e4669

Added to database: 5/4/2026, 6:22:24 PM

Last enriched: 5/12/2026, 6:18:25 AM

Last updated: 6/18/2026, 11:40:45 AM

Views: 66

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses