Repository navigation
Commit 53a8a29
zstd-safe: refuse to enable CParameter::StableInBuffer
In stable-input mode zstd keeps the ZSTD_inBuffer pointer of a
compress_stream* call and reads deferred bytes from it in later calls,
including flush_stream()/end_stream(), which take no input at all. An
InBuffer only borrows its slice for one call, so safe code could free it
in between, and zstd would compress freed memory into the frame.
The safe API cannot uphold this requirement: refuse StableInBuffer(true)
with ZSTD_error_parameter_unsupported.
Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-BF808SHX.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MxSMUdwqoQ3qm6UF82MgZD1 parent 781ea45 commit 53a8a29
2 files changed
Lines changed: 38 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
84 | 92 | | |
85 | 93 | | |
86 | 94 | | |
| |||
749 | 757 | | |
750 | 758 | | |
751 | 759 | | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
752 | 763 | | |
753 | | - | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
754 | 767 | | |
755 | 768 | | |
756 | 769 | | |
| |||
2529 | 2542 | | |
2530 | 2543 | | |
2531 | 2544 | | |
| 2545 | + | |
| 2546 | + | |
| 2547 | + | |
| 2548 | + | |
| 2549 | + | |
| 2550 | + | |
2532 | 2551 | | |
2533 | 2552 | | |
2534 | 2553 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
258 | 276 | | |
259 | 277 | | |
260 | 278 | | |
| |||
0 commit comments