- Reported
-
- Issued
-
- Package
-
zstd-safe
(crates.io)
- Type
-
INFO
Unsound
- Categories
-
- Keywords
-
#buffer-overflow
#experimental
#zstdmt
- References
-
- Patched
-
- Unaffected
-
- Affected Functions
- Version
zstd_safe::CCtx::try_clone
-
Description
CCtx::try_clone (experimental feature, deprecated) copies tables sized
from the context's applied parameters. Starting a multithreaded frame
(zstdmt feature) replaces those parameters with the workers' without
resizing the context's own tables, so after an abandoned single-threaded
frame, the copy wrote up to 512 KiB past a heap allocation, or read past
one. This became reachable with the bundled zstd 1.5.6.
The flaw was corrected by refusing try_clone (and the unsafe
compress_block) once NbWorkers was set on the context.
Advisory available under CC0-1.0
license.