Impact
CImg Library contains an integer overflow in the size calculation for PNM files. The overflow walks around the bounds check in _load_pnm, causing an undersized allocation and a subsequent heap buffer overflow. The overflow can corrupt heap structures and may lead to program crashes or potential code execution if the attacker controls the image data.
Affected Systems
The vulnerability exists in all versions of the GreycLab CImg library preceding commit 4ca26bc, which was fixed in release v3.7.5. Any application that loads untrusted PNM, PGM, or PPM files through CImg is affected.
Risk and Exploitability
The CVSS score of 6.1 indicates a moderate severity. The EPSS score is not available, but the vulnerability was not listed in the CISA KEV catalog. An attacker can exploit the flaw by supplying a crafted image with very large dimensions to a vulnerable program. Successful exploitation requires the ability to supply that image, so the attack vector is typically local or remote through any file‑loading capability that accepts PNM format images.
OpenCVE Enrichment