Security context

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

lief-project/lief
main @ 811a871
17
Fixes
0
CVEs
HIGH
Peak severity
35.7%
Coverage
Highlights
Out-of-bounds Read: 4 prior fixes. Scrutinize any change in this area.
src/PE/Parser.cpp: most-fixed (4 issues). Treat as high-risk during review.
12 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.

Integer Overflow / Out-of-Bounds Read: Multiple fixes address 32-bit/64-bit arithmetic overflows when computing offsets or sizes from file data, leading to out-of-bounds reads. These are spread across different parsers, indicating a systemic lack of checked arithmetic on untrusted length fields.
Out-of-bounds Read: Several fixes add bounds checks before reading or copying data from binary content, but the checks are inconsistent (e.g., using wrong size fields, missing null-terminator handling). This suggests many read paths may still lack proper validation.
Buffer Overflow / Heap Buffer Overflow: Buffer overflows occur when lengths read from the file are used without validation, both in the core parser and in example code. The example bug shows that even non-core paths can be vulnerable.