CImg Library: Integer overflow in PNM size check bypasses memory guard (_load_pnm)
Key facts
- Attack vector
- Local
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- —
- Confidentiality · integrity · availability
- None · Low · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA.
Summary
CImg Library is a C++ library for image processing. Prior to commit 4ca26bc, there is an integer overflow vulnerability in the W*H*D size computation inside _load_pnm() that can bypass the memory allocation guard. A crafted PNM/PGM/PPM file with large dimension values causes the overflow to wrap around, allocating an undersized buffer and potentially triggering a heap buffer overflow. Any application using CImg to load untrusted image files is affected. This issue has been patched via commit 4ca26bc.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| GreycLab | CImg | before 4ca26bce4d8c61fcd1507d5f9401b9fb1222c27d | 4ca26bce4d8c61fcd1507d5f9401b9fb1222c27d | Patch available | CNA |
- CImg VendorGreycLab Affected before 4ca26bce4d8c61fcd1507d5f9401b9fb1222c27d Fixed in 4ca26bce4d8c61fcd1507d5f9401b9fb1222c27d Patch available CNA
Remediation
- Fix · CNA CImg (GreycLab) Fixed in 4ca26bce4d8c61fcd1507d5f9401b9fb1222c27d
Vendor assessments
Timeline
- 2026-10-02 Threatist record created from CVE-2026-42144
References
More GreycLab vulnerabilities
- TI-2026-35174 CImg Library: Uncontrolled Memory Allocation and Memory Leak in `_load_analyze()` via Crafted NIfTI/Analyze Header CVSS 3.1HIGH 7.5
- TI-2026-30477 CImg Library: Uncontrolled memory allocation via nb_colors field in _load_bmp CVSS 3.1MEDIUM 5.5
- TI-2026-81159 Heap out-of-bounds read in GreycLab CImg BMP loader CVSS 4.0MEDIUM 6.9
Sources
- CVE-2026-42144 · CVE Program
- CVE-2026-42144 · NVD
- FIRST EPSS
- CVE-2026-42144 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences