Security context

What an agent needs to avoid regressing past fixes and find the next vuln in this repo.

facebook/zstd
dev @ 10da6ba
26
Fixes
0
CVEs
HIGH
Peak severity
61.9%
Coverage
Highlights
Buffer Overflow: 11 prior fixes. Scrutinize any change in this area.
lib/compress/zstd_compress.c: most-fixed (6 issues). Treat as high-risk during review.
20 high-severity fixes in this history; regressions here are high-impact.
Recurring patterns

The bug types that recur here, drawn from past fixes, not open vulnerabilities.

Buffer Overflow: Multiple buffer overflows in compression paths due to insufficient bounds checks on output buffers, table sizes, and bit-buffer operations. Crafted input or undersized buffers can cause memory corruption.
Buffer Overflow: Legacy decompression formats repeatedly suffered heap/stack buffer overflows from missing litSize and source size bounds checks before memcpy operations. Each legacy version needed independent fixes, indicating a systemic lack of validation in these code paths.
Memory Corruption: Memory corruption from improper sequence validation, hashset probe index wrapping, and pointer arithmetic overflow in 32-bit mode. These bugs can lead to arbitrary code execution.