- Reported
-
- Issued
-
- Package
-
zstd-safe
(crates.io)
- Type
-
INFO
Unsound
- Categories
-
- Keywords
-
#seekable
#out-of-bounds
- References
-
- Patched
-
- Unaffected
-
- Affected Functions
- Version
zstd_safe::seekable::SeekableCStream::compress_stream
-
Description
InBuffer's fields are public, so safe code can set pos past the end of
src. The position was passed to the C library unchecked, and
ZSTD_seekable_compressStream, unlike the other streaming functions, does
not validate it: it read past the end of the input slice, by up to the
frame size, and compressed that memory into the output.
The flaw was corrected by checking the position before every call into the
C library.
Advisory available under CC0-1.0
license.