Security context

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

pierrec/lz4
v4 @ a296161
5
Fixes
0
CVEs
HIGH
Peak severity
20.0%
Coverage
Highlights
Buffer Overflow: 2 prior fixes. Scrutinize any change in this area.
internal/lz4block: most-fixed (3 issues). Treat as high-risk during review.
4 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.

Out of Bounds Write: The AMD64 assembly decoder contained vulnerabilities where signed comparisons and missing carry-flag validation could bypass bounds checks, allowing arbitrary memory corruption during block decompression. Developers must ensure assembly implementations mirror the strict unsigned comparison boundaries of safe Go code.
Buffer Overflow: Architecture-specific (ARM) assembly routines and 32-bit platform decoders are susceptible to integer overflows when calculating match/literal lengths or destination buffer offsets, leading to massive heap corruption. Explicit carry-flag validations and maximum limit checks must guard all pointer arithmetic.
Information Disclosure: Reusing dirty buffers from a shared pool without clearing them on zero-length or direct-mode reads can leak previously decompressed payload data to unprivileged callers. State changes and buffer allocations must be cleared cleanly.