zlib 1.2.11 through 1.3.2 contains a heap buffer overflow: after an underlying write() fails, gz_write() returns without resetting strm.next_in, leaving it pointed at the caller's buffer. A later gz* write call then derives a position from the stale pointer and writes past a heap allocation; any write() failure reaches it, including EPIPE on a blocking descriptor, and in versions before 1.3.1.2 the failed write must be followed by a gzclearerr() call.
https://www.vulncheck.com/advisories/zlib-1.3.1.2-through-1.3.2-heap-buffer-overflow-via-gz-vacate
https://github.com/madler/zlib/commit/df84af25dc1942490e1d1c899a07619152a46148
https://github.com/madler/zlib/blob/v1.3.2/gzwrite.c#L393
https://github.com/madler/zlib
https://gist.github.com/thesmartshadow/e0b9481792afb7c31e86fee1ff084490
Published: 2026-08-24
Updated: 2026-10-01
Named Vulnerability: GHSA-p3f5-w63m-mxphNamed Vulnerability: GHSA-g84c-rxfj-3j2c
Base Score: 7.1
Vector: CVSS2#AV:N/AC:H/Au:N/C:N/I:C/A:C
Severity: High
Base Score: 7.4
Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:H
Severity: High
Base Score: 8.3
Vector: CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N
Severity: High
EPSS: 0.00592