# CVE-2026-70654: libvips heap buffer overflow in PPM source processing

Source: https://junglewise.ai/threats/cve-2026-70654-libvips-heap-buffer-overflow-in-ppm-source-processing  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-08-20. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2026-70654 · Severity: info · CVSS 8.6 · Published 2026-08-20

libvips is a widely-used image processing library. When applications using libvips process untrusted PPM image files with custom source handlers, a buffer overflow can occur, potentially causing a crash or memory corruption that could lead to code execution.

Technologies: [Libvips](https://junglewise.ai/threats/technologies/libvips). Vendors: [Libvips](https://junglewise.ai/threats/vendors/libvips).

## Quick answers

**Is CVE-2026-70654 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-70654 being exploited in the wild.

**How severe is CVE-2026-70654?** Informational severity, with a CVSS score of 8.6, published 20 August 2026.

**Which products and versions are affected?** Libvips prior to 8.18.3.

**Is there a fix for CVE-2026-70654?** A patch was published on 2026-05-13: Fixed in version 8.18.3 Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-70654 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-70654?** Check whether you run Libvips at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

A copy-paste error in the vips_source_read_to_memory function in libvips/iofuncs/source.c uses VIPS_MAX instead of VIPS_MIN when calculating the remaining read size for heap-allocated buffers. When processing uncompressed PPM images with custom source definitions, this allows up to 4032 bytes to be written beyond the allocated buffer boundary. The vulnerability requires both custom source definitions and untrusted PPM input. The issue is fixed in libvips 8.18.3 (patched May 13, 2026).

## Affected products

- libvips libvips prior to 8.18.3

## Timeline

- 2026-08-20: disclosed
- 2026-05-13: patched: Fixed in version 8.18.3

## References

- [https://github.com/libvips/libvips/commit/80e021c6cdda0f80b756c2109d99839c94c03258](https://github.com/libvips/libvips/commit/80e021c6cdda0f80b756c2109d99839c94c03258)
- [https://github.com/libvips/libvips/pull/5038](https://github.com/libvips/libvips/pull/5038)

## Related threats

- [libvips misaligned float load in PFM image processing](https://junglewise.ai/threats/cve-2026-88360-libvips-8-19-0-contains-a-memory-access-vulnerability-when)
- [libvips Radiance RLE decoder heap disclosure](https://junglewise.ai/threats/cve-2026-70653-libvips-radiance-rle-decoder-heap-disclosure)
- [libvips heap buffer over-read in UHDR save](https://junglewise.ai/threats/cve-2026-70652-libvips-heap-buffer-over-read-in-uhdr-save)
- [libvips heap buffer over-read in ImageMagick fallback path](https://junglewise.ai/threats/cve-2026-70651-libvips-heap-buffer-over-read-in-imagemagick-fallback-path)
- [libvips integer overflow in TIFF scanline processing](https://junglewise.ai/threats/cve-2026-69242-libvips-integer-overflow-in-tiff-scanline-processing)
