Security context

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

hsivonen/encoding_rs
main @ a1b7557
3
Fixes
0
CVEs
HIGH
Peak severity
Highlights
Memory Corruption: 2 prior fixes. Scrutinize any change in this area.
encoding_rs: most-fixed (1 issue). Treat as high-risk during review.
2 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.

Memory Corruption: SSE2-accelerated UTF-16 to Latin1 conversions suffered from memory corruption because pointer-offset bounds checks failed to account for the current offset pointer. Future SIMD optimizations must strictly validate offset bounds relative to the destination buffer layout.
Memory Corruption: Validation bypasses in ALU/SIMD fast-paths for UTF-16 data can allow malformed surrogate pairs to pass checks, downstream leading to memory safety violations in unsafe blocks assuming validated input.
Integer Overflow: Worst-case buffer size calculation methods are susceptible to integer overflows, which could lead to under-allocation and subsequent heap buffer overflows in callers. Computations must utilize checked arithmetic.