RustSec logo

History ⋅ Edit ⋅ JSON (OSV)

RUSTSEC-2026-0397

OutBuffer::around_pos exposes uninitialized memory

Reported
Issued
Package
zstd-safe (crates.io)
Type
INFO Unsound
Categories
Keywords
#uninitialized-memory
References
Patched
  • >=8.2.0
Unaffected
  • <4.0.0
Affected Functions
Version
zstd_safe::OutBuffer::around_pos
  • >=4.0.0, <8.2.0

Description

OutBuffer::around_pos accepted a position past the initialized length of a Vec<u8>. The next streaming call then marked everything before the position as initialized, so safe code could read stale heap memory between the vector's previous length and that position.

The flaw was corrected by zero-filling that gap.

Advisory available under CC0-1.0 license.