CVE-2026-42146 Details
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.
A memory allocation vulnerability has been identified in the CImg Library, a C++ library for image processing. This issue arises in versions prior to commit c3aacf5, where the 'nb_colors' field in the BMP file header is read as a signed integer and used directly to calculate memory allocation size. The vulnerability allows a crafted BMP file with a large 'nb_colors' value to cause an out-of-memory condition, crashing applications that use CImg to process untrusted BMP files.
Users are advised to update to CImg version 3.7.5 or later, where this vulnerability has been fixed.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
Volerion
Assessed May 4, 2026CISA-ADP
Assessed May 6, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/GreycLab/CImg/issues/477 | CISA-ADP | ExploitIssue TrackingTechnical DescriptionVendor |
| https://github.com/GreycLab/CImg/commit/c3aacf5b96ac1e54b7af1957c6737dbf3949f6d3 | [email protected] | Source CodeVendor |
| https://github.com/GreycLab/CImg/issues/477 | [email protected] | ExploitIssue TrackingTechnical DescriptionVendor |
| https://github.com/GreycLab/CImg/releases/tag/v.3.7.5 | [email protected] | Release NotesVendor |
| https://github.com/GreycLab/CImg/security/advisories/GHSA-g54r-qmgx-c6fv | [email protected] | AdvisoryRemedyVendor |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-789 | Memory Allocation with Excessive Size Value | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| GreycLab CImg | < c3aacf5 |
CPE
Remediation
| |
Change History
4 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| May 6, 2026 | CVE Modified | CISA-ADP |
| May 4, 2026 | New CVE Received | [email protected] |
Volerion