bitVakt

Kernel Kit / Infix / v26.10.0latest

CVE-2026-85091

8.3high

libzlib1.3.2 · 1.3.1in 4 of 4 releases

Not yet analysed by NVD. Matched on the vendor's record; this may change when NVD has analysed it.

Reach libzlib · 8 builds in 4 of 4 releases

full reviewcross-check✓ a member decided

Description · NVD

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.

Published 2026-09-03NVD

CVSS 4.0Network · no privileges · no user interaction

How it is reached

Attack vector
Network
Attack complexity
High
Attack requirements
None
Privileges required
None
User interaction
None

What it costs

Confidentiality
None
Integrity
High
Availability
High

What it costs other systems

Confidentiality
None
Integrity
None
Availability
None

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

References 5
Review Av26.10.0aarch64_minimalNot exposed✓ accepted by a member, 2026-11-20 · settles 8 of 8

Fable 5.2 · medium confidence · 2026-11-19

The build ships unpatched zlib 1.3.2: gz_write() in output/build/libzlib-1.3.2/gzwrite.c still leaves strm.next_in pointing at the caller's buffer on a failed write, no patch is applied, and libz.so.1.3.2 is installed on the target.

No shipped caller can drive the failing sequence, though. The only gz write user that runs by default is statd's journal, which calls gzwrite() in 4096-byte chunks (below the 8192-byte threshold for the direct path that sets the stale pointer) and closes the file on the first error. Nothing in the target packages calls gzprintf, gzputs, gzputc or gzfwrite, and the only gzclearerr() caller is sudoreplay on a read handle.

Reaching the bug would need something outside the product: a root shell to install or run software that writes 8 KiB or more per gzwrite() and keeps writing after an error. It is not reachable from a network interface, and I found no YANG node or CLI command that changes this.

Evidence 12
  1. Vulnerable code present: the direct path sets `state->strm.next_in = buf` and returns on a `gz_comp()` error without resetting it.

    output/build/libzlib-1.3.2/gzwrite.c:234-246

  2. Later gz write calls compute a buffer position from `strm->next_in` relative to `state->in`, with no fix for a stale pointer.

    output/build/libzlib-1.3.2/gzwrite.c:382-396 (gz_vacate), :212, :333, :452

  3. Empty file: no patches are applied. `buildroot/package/libzlib/` contains only `libzlib.mk` and `libzlib.hash`, and `patches/` has no zlib entry.

    output/build/libzlib-1.3.2/.applied_patches_list

  4. `BR2_PACKAGE_ZLIB=y`, `BR2_PACKAGE_LIBZLIB=y` and `BR2_PACKAGE_PROVIDES_ZLIB="libzlib"`: libzlib is the target zlib provider, not only a host package.

    output/.config:2101-2105

  5. `usr/lib/libz.so.1.3.2` is installed to the target; `gzwrite.c` is always compiled (`gzwrite.lo` is in the build directory, and `configure.log` shows a plain `./configure --shared --prefix=/usr`).

    output/build/libzlib-1.3.2/.files-list.txt

  6. The only default-running gz writer: `gzopen(dst, "wb")`, then `gzwrite(gz, buf, n)` with `char buf[4096]`; on any short write it calls `gzclose()` and returns. No further write and no `gzclearerr()`.

    output/build/statd-1.0/journal.c:55-88 (gzip_file)

  7. `GZBUFSIZE` is 8192, and writes with `len < state->size` take the copy path, so `statd`'s 4096-byte writes never reach the line that sets `next_in` to the caller's buffer.

    output/build/libzlib-1.3.2/gzguts.h:156 and gzwrite.c:205

  8. `statd` is enabled in finit by default and starts the journal unconditionally, so `gz_write()` itself does run in the factory configuration, but only on local files under `/var/lib/statd`.

    package/statd/statd.mk:53-54, package/statd/statd.conf:2, output/build/statd-1.0/statd.c:566

  9. `sudo` I/O logging calls `gzwrite()`, but the only `gzclearerr()` caller is `sudoreplay` on the timing file it reads.

    output/build/sudo-1.9.17p2/lib/iolog/iolog_write.c:62, lib/iolog/iolog_clearerr.c:40, plugins/sudoers/sudoreplay.c:770

  10. No `log_input` or `log_output` defaults, so `sudo` I/O logging is off in the shipped configuration; nothing in `board`, `package` or `src/confd` mentions those options.

    output/target/etc/sudoers:46-139, board/common/rootfs/etc/sudoers.d/wheel:1

  11. `libxml2` calls `gzwrite()` only for compressed output on a blocking file descriptor, with no `gzclearerr()` and no retry after an error.

    output/build/libxml2-2.15.4/xmlIO.c:1114-1117, 1276-1291

  12. Every gz write entry point returns early while `state->err` is set unless `state->again` (EAGAIN/EWOULDBLOCK) is true, so a caller must use a non-blocking descriptor or call `gzclearerr()` to continue after a failed write.

    output/build/libzlib-1.3.2/gzwrite.c:264, 291, 320, 360, 423

Version and patches

The CVE's range is 1.2.11 through 1.3.2 and this build is exactly 1.3.2 (buildroot/package/libzlib/libzlib.mk, ZLIB_VERSION "1.3.2" in output/build/libzlib-1.3.2/zlib.h:44), so the match is correct. No fixed release is named in the brief, and I could not read upstream fix commit df84af25 offline. The fix is not in the tree: gz_write() and gz_vacate() are unmodified, and .applied_patches_list is empty.

Recommendation

Not urgent, but do not document this as not applicable: the vulnerable code is shipped and only the current callers' usage keeps it unreachable.

Pick up the fix at normal priority, either by bumping libzlib once a release containing commit df84af25 exists or by backporting that commit as a patch under patches/libzlib/.

Re-check this finding if a package is added that uses gzprintf/gzputs, writes 8 KiB or more per gzwrite(), or writes gzip streams to pipes or sockets.

Open questions

The caller search covered C/C++/Go/Rust/Python sources of target packages under output/build (254 directories). Binaries shipped without source, or callers in other languages, would not have been seen.

By my reading of 1.3.2, a non-EAGAIN failure such as EPIPE still blocks later writes until gzclearerr() is called, which is narrower than the CVE text suggests. I could not check this against the upstream advisory or fix commit because they are not available offline.

gzclose_w() calls gz_comp(state, Z_FINISH) without checking the error state. That does not matter for statd, whose next_in always stays inside zlib's own buffer, but I did not check whether the upstream fix also touches that path.

Members of Kernel Kit decide. Sign in if you are one.