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

Mon, 04 May 2026 18:15:00 +0000

Type Values Removed Values Added
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.
Title CImg Library: Uncontrolled memory allocation via nb_colors field in _load_bmp
Weaknesses CWE-789
References
Metrics cvssV3_1

{'score': 5.5, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H'}


cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-05-04T17:53:23.830Z

Reserved: 2026-04-24T17:15:21.834Z

Link: CVE-2026-42146

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-05-04T18:16:31.977

Modified: 2026-05-04T18:16:31.977

Link: CVE-2026-42146

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

No data.