High, CVSS 8.7GoAmendedPublished
compress zstd: Panic on two-block frames
CVE-2026-116591 · GHSA-fpmh-frq8-7rj8
- Affected
- Go github.com/klauspost/compress/zstd < 1.20.2
- Fixed in
- 1.20.2· Vendor fix available
- Issue
- A crafted ~27 KB two-block zstd frame makes DecodeAll and the streaming decoder panic with an out-of-range slice index instead of returning a decode error. The same bytes decode fine with the reference zstd. Any program that decompresses untrusted zstd input can be crashed by it. Reproduced on v1.20.0 and v1.20.1. Released in https://github.com/klauspost/compress/releases/tag/v1.20.2 Details The panic is in the FSE decoder that `huff0.ReadTable` uses to read a block's Huffman-weight table. Three conditions have to hold at once, and the crafted frame arranges all three. 1. A count that doesn't fit is accepted. `readNCount` permits a tableLog up to 15 (`tablelogAbsoluteMax`, checked at `fse/decompress.go:54`), so a symbol's normalized count can reach 32768 (2^15). The count is stored in an `int16` at…
Recommended action: Upgrade to 1.20.2 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.