Every CVE Search/ Get API key

CVE-2026-42146

CImg Library: Uncontrolled memory allocation via nb_colors field in _load_bmp

5.5 MediumFix available

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.

Attack profile

How easy it is to exploit

Attack vector
Local
Complexity
Low
Privileges needed
None
User interaction
Required

What an attacker can affect

Confidentiality
None
Integrity
None
Availability
High

Exploit likelihood

0.18%Up 0.2 points since May 5, 2026
90%50%10%1%

What each source reports

CVE List Score used 5.5

CImg Library: Uncontrolled memory allocation via nb_colors field in _load_bmp

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.

Record
CVE-2026-42146
CVSS 3.1
5.5 MediumCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
Weakness
CWE-789
Updated
2026-11-02
EUVDEUVD-2026-27077 5.5

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.

Record
EUVD-2026-27077
CVSS 3.1
5.5 MediumCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
Updated
2026-11-02
NVD 5.5

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.

Record
CVE-2026-42146
CVSS 3.1
5.5 MediumCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
Weakness
CWE-789
Updated
2026-11-02
OSV 5.5

CImg Library: Uncontrolled memory allocation via nb_colors field in _load_bmp

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.

Record
CVE-2026-42146
CVSS 3.1
5.5 MediumCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
Weakness
CWE-789
Updated
2026-11-02
OSVDEBIAN-CVE-2026-42146 5.5

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.

Record
DEBIAN-CVE-2026-42146
CVSS 3.1
5.5 MediumCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVUBUNTU-CVE-2026-42146 5.5

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.

Record
UBUNTU-CVE-2026-42146
CVSS 3.1
5.5 MediumCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
cimg
Debian:12
All versions, plus listed versions
3.2.1+dfsg-13.2.1+dfsg-23.5.0+dfsg-13.5.2+dfsg-13.5.2+dfsg-24.0.4+dfsg-1
None known
cimg
Debian:13
before 3.5.2+dfsg-1+deb13u1, plus listed versions
3.5.2+dfsg-1
3.5.2+dfsg-1+deb13u1
cimg
Debian:14
before 3.5.2+dfsg-2, plus listed versions
3.5.2+dfsg-1
3.5.2+dfsg-2
cimg
Ubuntu:16.04:LTS
All versions, plus listed versions
1.6.4+dfsg-1build11.6.5+dfsg-1
None known
cimg
Ubuntu:Pro:18.04:LTS
All versions, plus listed versions
1.7.9+dfsg-21.7.9+dfsg-2build11.7.9+dfsg-2ubuntu0.18.04.11.7.9+dfsg-2ubuntu0.18.04.21.7.9+dfsg-2ubuntu0.18.04.2+esm1
None known
cimg
Ubuntu:20.04:LTS
All versions, plus listed versions
2.4.5+dfsg-1
None known
cimg
Ubuntu:Pro:22.04:LTS
All versions, plus listed versions
2.9.4+dfsg-22.9.4+dfsg-32.9.4+dfsg-3ubuntu0.1~esm1
None known
cimg
Ubuntu:Pro:24.04:LTS
All versions, plus listed versions
3.2.1+dfsg-13.2.1+dfsg-1ubuntu0.24.04.1~esm1
None known
cimg
Ubuntu:25.10
All versions, plus listed versions
3.5.2+dfsg-1
None known
cimg
Ubuntu:26.10
All versions, plus listed versions
3.5.2+dfsg-1build13.5.2+dfsg-2
None known
cimg
Ubuntu:26.04:LTS
All versions, plus listed versions
3.5.2+dfsg-13.5.2+dfsg-1build1
None known

History

History
RecordedChangedSources
first indexedCVE List, EUVD, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2026-42146 is a medium vulnerability (CVSS 5.5) in Greyclab Cimg, published May 4, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.18%, the 7th percentile. Fixed in cimg 3.5.2+dfsg-1+deb13u1.

References

MoveEnter Open