CVE-2026-42146

Source
https://cve.org/CVERecord?id=CVE-2026-42146
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-42146.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2026-42146
Aliases
  • GHSA-g54r-qmgx-c6fv
Downstream
Published
2026-05-04T17:53:23Z
Modified
2026-08-12T16:24:17Z
Severity
  • 5.5 (Medium) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H CVSS Calculator
Summary
CImg Library: Uncontrolled memory allocation via nb_colors field in _load_bmp
Details

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.

Database specific
{
    "cna_assigner": "GitHub_M",
    "cwe_ids": [
        "CWE-789"
    ],
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/42xxx/CVE-2026-42146.json",
    "unresolved_ranges": [
        {
            "extracted_events": [
                {
                    "fixed": "c3aacf5b96ac1e54b7af1957c6737dbf3949f6d3"
                }
            ],
            "source": "AFFECTED_FIELD"
        }
    ]
}
References

Affected packages

Git / github.com/greyclab/cimg

Affected ranges

Type
GIT
Repo
https://github.com/greyclab/cimg
Events
Introduced
0 Unknown introduced commit / All previous commits are affected
Fixed
Fixed
Database specific
Show details
{
    "source": "REFERENCES"
}

Affected versions

v.*
v.2.3.0
v.2.3.1
v.2.3.2
v.2.3.3
v.2.3.4
v.2.3.5
v.2.3.6
v.2.4.0
v.2.4.1
v.2.4.2
v.2.4.3
v.2.4.4
v.2.4.5
v.2.5.0
v.2.5.1
v.2.5.2
v.2.5.3
v.2.5.4
v.2.5.5
v.2.5.6
v.2.5.7
v.2.6.0
v.2.6.1
v.2.6.2
v.2.6.3
v.2.6.4
v.2.6.5
v.2.6.6
v.2.6.7
v.2.7.0
v.2.7.1
v.2.7.2
v.2.7.3
v.2.7.4
v.2.7.5
v.2.8.0
v.2.8.1
v.2.8.2
v.2.8.3
v.2.8.4
v.2.9.0
v.3.1.0
v.3.1.1
v.3.1.2
v.3.1.3
v.3.1.4
v.3.1.6
v.3.2.0
v.3.2.1
v.3.2.2
v.3.2.3
v.3.2.4
v.3.2.5
v.3.2.6
v.3.3.0
v.3.3.1
v.3.3.2
v.3.3.3
v.3.3.4
v.3.3.5
v.3.3.6
v.3.4.0
v.3.4.1
v.3.4.2
v.3.4.3
v.3.5.0
v.3.5.1
v.3.5.2
v.3.5.3
v.3.5.4
v.3.5.5
v.3.6.0
v.3.6.1
v.3.6.2
v.3.6.3
v.3.6.4
v.3.6.5
v.3.6.6
v.3.7.0
v.3.7.1
v.3.7.2
v.3.7.3
v.3.7.4

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-42146.json"
vanir_signatures
[
    {
        "deprecated": false,
        "digest": {
            "line_hashes": [
                "318172894725783406681287929515958403779",
                "150621348207869847369843225262995890926",
                "131616633530240992493435991106862578432",
                "210207947198146663960019255917778880673"
            ],
            "threshold": 0.9
        },
        "id": "CVE-2026-42146-f25f270d",
        "signature_type": "Line",
        "signature_version": "v1",
        "source": "https://github.com/greyclab/cimg/commit/c3aacf5b96ac1e54b7af1957c6737dbf3949f6d3",
        "target": {
            "file": "CImg.h"
        }
    }
]
vanir_signatures_modified
"2026-08-12T16:24:17Z"