Junglewise Threat Intelligence

CVE-2026-85091: zlib heap buffer overflow in gz_vacate function

CVE-2026-85091 · Severity: high · CVSS 7.4 · Published 2026-09-03

Technologies: Zlib.

Executive brief

zlib is a widely-used compression library found in countless server and client applications. This vulnerability allows an attacker to trigger a heap buffer overflow by exploiting non-blocking write operations, potentially leading to application crashes or code execution. Affected versions are used in infrastructure ranging from web servers to CDNs to system utilities.

Technical details

A heap buffer overflow exists in the gz_vacate() function (introduced in zlib 1.3.1.2) when processing non-blocking gzwrite() operations. The root cause is that gz_write() can leave a stale external buffer pointer (strm->next_in) pointing outside the internal input buffer after a write stalls (EAGAIN), but avail_in remains unbounded. When gzprintf() or gzvprintf() subsequently calls gz_vacate(), an unchecked memmove() copies avail_in bytes (potentially hundreds of KB) into a 16384-byte allocation, overflowing the heap. Zlib 1.3.1.2 through 1.3.2 are affected; 1.3.1 suffers lower-severity single-byte null writes. The attack requires the application to perform non-blocking gz operations followed by gzprintf/gzvprintf without intervening error clearing that resets pointers. No patch is mentioned in the advisory text.

Affected products

  • zlib zlib 1.3.1.2 through 1.3.2

Timeline

  • 2026-09-03: disclosed: Public advisory published; GitHub gist and NVD disclosure
  • 2026-09-16: other: GitHub gist last updated

References