CVE-2026-42146
published medium CVSS 3.1 · 5.5CImg Library: Uncontrolled memory allocation via nb_colors field in _load_bmp
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| GreycLab | — | CImg< c3aacf5b96ac1e54b7af1957c6737dbf3949f6d3 | Affected | Not stated | GitHub_M |
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 5.5 / 10
- Severity
- medium
- Provider
- GitHub_M · cna
- Vector string
- CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| GreycLab | CImg | < c3aacf5b96ac1e54b7af1957c6737dbf3949f6d3 (affected) | GitHub_M · cna |
Weaknesses
1- CWE-789 CWE-789: Memory Allocation with Excessive Size Value
References
4Provider assertions
2GitHub_M · cna
CImg Library: Uncontrolled memory allocation via nb_colors field in _load_bmp
CISA-ADP · adp
CISA ADP Vulnrichment
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- baddd37f12c7c3fd842a2c85e291c87ca61ea7eb973fab68e94a7f452712fc32
- Ingested
- 23 Sep 2026, 09:14:00 UTC
- Source record
- Official CVE record