#1146895 zlib: CVE-2026-85091

Package:
src:zlib
Source:
src:zlib
Submitter:
Salvatore Bonaccorso
Date:
2026-11-07 12:49:02 UTC
Severity:
normal
Tags:
#1146895#5
Date:
2026-09-06 19:02:48 UTC
From:
To:
Hi,

The following vulnerability was published for zlib.

CVE-2026-85091[0]:
| zlib versions 1.3.1.2 through 1.3.2 contain a heap buffer overflow
| vulnerability in the gz_vacate() function when processing non-
| blocking gzwrite() operations with stale external buffer pointers.
| Attackers can trigger the overflow by calling gzprintf() or
| gzvprintf() after a write stall, causing an unchecked memmove() to
| write beyond the internal input buffer boundary.


If you fix the vulnerability please also make sure to include the
CVE (Common Vulnerabilities & Exposures) id in your changelog entry.

For further information see:

[0] https://security-tracker.debian.org/tracker/CVE-2026-85091
https://www.cve.org/CVERecord?id=CVE-2026-85091
[1] https://gist.github.com/thesmartshadow/e0b9481792afb7c31e86fee1ff084490
[2] https://github.com/madler/zlib/commit/e3dc0a85b7032e98380dec011bc8f2c2ee0d8fca

Regards,
Salvatore

#1146895#10
Date:
2026-09-06 19:21:59 UTC
From:
To:
Hi,

FWIW, [2] might not be correct, can you check with upstream?

Regards,
Salvatore

#1146895#17
Date:
2026-09-11 16:22:16 UTC
From:
To:
(Sorry Claude wrote this, but if true thought it be helpful for ya'll,
thanks. CVEs this year have been insane!)

Hi,

CVE-2026-85091 is the heap overflow in gz_vacate() (gzwrite.c), reached
through gzprintf()/gzvprintf() after a non-blocking write stall. The
advisory (GHSA-g5fp-32jq-cfw2) gives the affected range as 1.3.1.2
through 1.3.2, and the upstream history agrees:

- gz_vacate() and the non-blocking handling in the gz* routines were
  introduced in upstream commit 81cc0bebedd935daeb81b0b6e475d8786b51af3d
  ("Support non-blocking devices in the gz* routines.", 2025-05-25),
  after the v1.3.1 tag. v1.3.1.2 is the first tag that contains it and
  v1.3.2 (2026-02-17) the first release.
- gzwrite.c at v1.3.1 defines only gz_init, gz_comp, gz_zero and
  gz_write. There is no gz_vacate() and no stall handling: a short or
  failed write() is treated as a fatal Z_ERRNO.

The tracker currently lists trixie (1:1.3.dfsg+really1.3.1-1) and
bookworm (1:1.2.13.dfsg-1) as vulnerable. Both predate the vulnerable
code, so I believe they should be marked <not-affected> (vulnerable code
introduced in 1.3.2), leaving only 1:1.3.dfsg+really1.3.2-* in
forky/sid affected.

#1146895#22
Date:
2026-09-17 06:52:13 UTC
From:
To:
Hi Mark,

Attached is a proposed update for zlib in unstable with one related
patch cherry-picked and the upstream commited change for
CVE-2026-85091.

I tested the update as well against the published reporducers, and the
update would be tested as well on
https://debusine.debian.net/debian/developers/work-request/1293184/

Regards,
Salvatore

#1146895#27
Date:
2026-09-17 06:53:18 UTC
From:
To:
Hi,

And now attached for real :-(

Regards,
Salvatore

#1146895#36
Date:
2026-09-22 00:37:38 UTC
From:
To:
The CVE text limits the affected range to 1.3.1.2 through 1.3.2. That
range is too narrow. The overflow predates non-blocking write support:
I reproduced it under ASan on upstream 1.2.11 and 1.2.13 in both
gz_write() and gzvprintf(). The direct-path code involved dates from
1.2.3.5.

No write stall is needed to reach it. Any gz_comp() failure on the
direct path leaves the same state, so a descriptor opened read-only
reproduces it without sockets or timing.

Method and per-patch results are in my comment on the upstream issue:

https://github.com/madler/zlib/issues/1292#issuecomment-5562455575

Upstream fix, already noted in the tracker:


https://github.com/madler/zlib/commit/df84af25dc1942490e1d1c899a07619152a46148

The commit applies to the bookworm and trixie sources as well as sid,
so a backport of that single hunk covers all three.

Steve Antonakakis

#1146895#45
Date:
2026-10-02 10:46:20 UTC
From:
To:
Hello,

The tracker currently lists zlib as vulnerable to CVE-2026-85091 in
bookworm and trixie. As far as I can tell, neither release contains the
vulnerable code.

   - The CVE covers zlib 1.3.1.2 through 1.3.2. The vulnerable function
   gz_vacate() and the non-blocking write code came in with upstream commit
   81cc0be ("Support non-blocking devices in the gz* routines", 25 May 2025).
   That commit is in v1.3.1.2 but not in v1.3.1.
   - trixie (1:1.3.dfsg+really1.3.1-1) ships upstream 1.3.1 with no Debian
   patches. Its gzwrite.c has no gz_vacate().
https://sources.debian.org/src/zlib/1:1.3.dfsg+really1.3.1-1/gzwrite.c/
   - bookworm (1:1.2.13.dfsg-1) predates the commit as well.
   - forky/sid (1:1.3.dfsg+really1.3.2-3) does contain the code (gz_vacate()
   at line 382), so it remains affected:
https://sources.debian.org/src/zlib/1:1.3.dfsg+really1.3.2-3/gzwrite.c/

Upstream discussion: https://github.com/madler/zlib/issues/1310

If the analysis above is correct, could you please mark bookworm and trixie
as not-affected?
Thank you,
Dimitris

#1146895#50
Date:
2026-10-05 04:46:22 UTC
From:
To:
Hi,

No, we won't mark it yet as such. The reasons are explained in
https://github.com/madler/zlib/issues/1310#issuecomment-5979623265 ,
https://github.com/madler/zlib/issues/1292#issuecomment-5562455575 and
https://bugs.debian.org/1146895#36 .

So it will depends if upstream will consider this a separate issue or
in scope of the assignment.

Regards,
Salvatore

#1146895#55
Date:
2026-10-11 16:35:21 UTC
From:
To:
Hi,

I agree with Salvatore.

Additionally I was able to create an poc [1] that crashes even when not
using the non-blocking API.
The mechanics for the crash are the same as for the non-blocking poc,
namely a crash due the invalid state.

The crash goes away with the upstream fix for CVE-2026-85091 [2],

[1] https://github.com/madler/zlib/issues/1292#issuecomment-597805192
[2]
https://github.com/madler/zlib/commit/df84af25dc1942490e1d1c899a07619152a46148


Whether this will have a dedicated CVE will depend on upstream view on
this issue.

Cheers,
tobi

#1146895#60
Date:
2026-10-23 03:02:24 UTC
From:
To:
Hi Mark,

Are you okay with if I upload this NMU to proceed with the fix in
usntable, and we (me for trixie, and Tobias is doing bookworm and
older), to address the issue?

Regards,
Salvatore

#1146895#65
Date:
2026-10-25 22:25:38 UTC
From:
To:
Please don't upload anything to unstable, there's a bunch of churn for
cross build and possibly some other stuff I ought to upload anyway.
Whatever you want to do for the releases is OK for me.

#1146895#72
Date:
2026-10-25 23:50:23 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
zlib, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1146895@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Mark Brown <broonie@debian.org> (supplier of updated zlib package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Sun, 25 Oct 2026 22:40:02 +0000
Source: zlib
Architecture: source
Version: 1:1.3.dfsg+really1.3.2-4
Distribution: unstable
Urgency: low
Maintainer: Mark Brown <broonie@debian.org>
Changed-By: Mark Brown <broonie@debian.org>
Closes: 1141300 1146895
Changes:
 zlib (1:1.3.dfsg+really1.3.2-4) unstable; urgency=low
 .
   * Pull in upstream patch to fix void undefined behavior in gzwrite.c.
   * Pull in upstream patch to fix buffer overflow bug in non-blocking
     gzwrite (CVE-2026-85091) (Closes: #1146895).
   * Apply patch from Helmut Grohne <helmut@subdivi.de> making the
     multilib dependencies massively more verbose to avoid cross build
     issues due to incomplete gcc-multilib not being available on some
     architectures (closes: #1141300).
Checksums-Sha1:
 fe42bb63d416e3716a4fd57454f6117297a74a7e 3931 zlib_1.3.dfsg+really1.3.2-4.dsc
 00655a512f6bee30dc3a8ede9a827f693c5cb33c 18988 zlib_1.3.dfsg+really1.3.2-4.debian.tar.xz
Checksums-Sha256:
 5735985df9244ebceb03e606342d3d0bf2fd76284f3ccc939a266b43b559a8e1 3931 zlib_1.3.dfsg+really1.3.2-4.dsc
 ee9db06d87b2d810b9edd8485b8b39433b18eb30d93f9e1d40fe8dbd40eda7a1 18988 zlib_1.3.dfsg+really1.3.2-4.debian.tar.xz
Files:
 bdd9ce491c9505232be99c1d40fb3f2c 3931 libs optional zlib_1.3.dfsg+really1.3.2-4.dsc
 d59fcdbd3ab0221d457793f5e67dfd63 18988 libs optional zlib_1.3.dfsg+really1.3.2-4.debian.tar.xz
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmrejvYACgkQJNaLcl1U
h9CliQf7BTF845QsbzBKAVreIHobEUUJHdesKORDo3RI2dCbW75fyJ3lB85f8AJ/
KJ45xsSAFE/AddMijqYTfOPNcFQ07lLxI3FWSkiQiiHKIccA80+Dg5BPdG4zQXEV
ufM6Mwv+nVkCRmJtn5kUixUH1taTimNVZHxXaRhZnQEvHInB8lxujSuvjsnJZkrG
hhIyFNuVkg+W/gQ6X28asytj3uWTwyu+CtfrIoNm8lEARJ/3rhxRVt9nHuyYYWsD
awz2wiv4Lbgglld1A744jSwuXJ4vh17wQKIfnOTZuE4s1ZFFqfQmkRr20JrG/7TH
p3q1yQbdoBeHjW9Rbc0Quakmzc1csQ==
=Q/n+
-----END PGP SIGNATURE-----

#1146895#77
Date:
2026-10-26 06:54:40 UTC
From:
To:
Hi Mark,

Thanks for your feedback; Alright I have not done any upload to
unstable. I see you uploaded a version with the fix applied, thank
you!

Regards,
Salvatore

#1146895#82
Date:
2026-11-07 12:47:05 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
zlib, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1146895@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Salvatore Bonaccorso <carnil@debian.org> (supplier of updated zlib package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Sun, 01 Nov 2026 06:57:53 +0100
Source: zlib
Architecture: source
Version: 1:1.3.dfsg+really1.3.1-1+deb13u1
Distribution: trixie-security
Urgency: high
Maintainer: Mark Brown <broonie@debian.org>
Changed-By: Salvatore Bonaccorso <carnil@debian.org>
Closes: 1128336 1146895
Changes:
 zlib (1:1.3.dfsg+really1.3.1-1+deb13u1) trixie-security; urgency=high
 .
   * Non-maintainer upload by the Security Team.
   * Check for negative lengths in crc32_combine functions (CVE-2026-27171)
     (Closes: #1128336)
   * Fix buffer overflow bug in non-blocking gzwrite (CVE-2026-85091)
     (Closes: #1146895)
Checksums-Sha1:
 9fc34f82c50cc1042f5cad4a9a3656014d13c967 3271 zlib_1.3.dfsg+really1.3.1-1+deb13u1.dsc
 3b19b81105d3436095134a648c521b678905eaac 1325737 zlib_1.3.dfsg+really1.3.1.orig.tar.gz
 64f0e544f965d01678d0183559d4ae0a7a8d99ec 17836 zlib_1.3.dfsg+really1.3.1-1+deb13u1.debian.tar.xz
 c0d579bff5026482c68f972c6cd79e2d5ba8850b 5465 zlib_1.3.dfsg+really1.3.1-1+deb13u1_source.buildinfo
Checksums-Sha256:
 7954224611bd043d62c094abf81cefcf9d97276479fc495767fcbc92cc6552f2 3271 zlib_1.3.dfsg+really1.3.1-1+deb13u1.dsc
 60dd315c07f616887caa029408308a018ace66e3d142726a97db164b3b8f69fb 1325737 zlib_1.3.dfsg+really1.3.1.orig.tar.gz
 4e99de80447700cf16ecf8ed3e77fabb39f085a5fffc66713466ccf07397cc04 17836 zlib_1.3.dfsg+really1.3.1-1+deb13u1.debian.tar.xz
 9144638049c2ea0b176909b1afaaa5ae9b9e3278617dd10b526e373b03c94b23 5465 zlib_1.3.dfsg+really1.3.1-1+deb13u1_source.buildinfo
Files:
 9256c237372053faee83cda14e393fad 3271 libs optional zlib_1.3.dfsg+really1.3.1-1+deb13u1.dsc
 29e0750ce6c0a9f719354d678ebffc6e 1325737 libs optional zlib_1.3.dfsg+really1.3.1.orig.tar.gz
 60e3d0be7a623e72f56ce9f31d32c388 17836 libs optional zlib_1.3.dfsg+really1.3.1-1+deb13u1.debian.tar.xz
 31c0ff6dec73164ec6e6ee3070027c16 5465 libs optional zlib_1.3.dfsg+really1.3.1-1+deb13u1_source.buildinfo
-----BEGIN PGP SIGNATURE-----

iQKmBAEBCgCQFiEERkRAmAjBceBVMd3uBUy48xNDz0QFAmrofAtfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDQ2
NDQ0MDk4MDhDMTcxRTA1NTMxRERFRTA1NENCOEYzMTM0M0NGNDQSHGNhcm5pbEBk
ZWJpYW4ub3JnAAoJEAVMuPMTQ89EtWcP/3o2PU3AXJPEokrz4BrD+kzrAA8A1JtG
rKHwJXn4a/FjiJ493yIHeQSFt1y75aw3BYPWfv60QHJCNU2rKXbOduxdRvgNLugi
clBPXcbRt1PaGqxWpMqTx1dsTcNeVOXSPUOHSdE7fIZAyoCOFyvT1fiv6XqWB1qS
atE22fGaU5Rw4khHfxAK9TpHFWSlsvz3manMmy8F5vuwK1oFAB6IcDGEJG2Ov8Ab
CpmsW8utrkEEtQWetna0g/DGlgCemk9qO89wytdb7YCqokHfaWkpHUbdVta/GI8p
4QgmMkD9lBGHWfQ81XtcScDjbXu0uyDT6IXAuImdoXoGif2fekhmO0LeG4Rt2Bc7
D2y+6sSLuHew5Wx9uf+mueFs9fz5LQYOfFUQ3BnhZ4QOkwYT6rA4Ot6D64+wOPP+
JVA8bzBBVEEjH65q12Ab2dUkA7JYaV0CSVNY2igC+ZhxXd7WrTD9zPjFzGUNhFl8
O7ggYSRtUERPeU2wAjptYJnwX1zxKLh3/caW0W6nsRkbgTKllWGP7uQp1Mw77Ito
ZGcbPEELyRqYOV+Yu0Zwmuhz3YQJKPXtj1BpzQJWuTsNg9xK5Eta/vgcIRUIgSfd
QauovfQIEKAUHYjU0aJFN+WTuE4USE0PTI1RODPIKvr6dC9RiLRuONTt/nllfUPf
XrwtdYRlcKSV
=p5xd
-----END PGP SIGNATURE-----