Security context

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

yurymalkov/hnsw
master @ d9b3608
2
Fixes
0
CVEs
HIGH
Peak severity
100.0%
Coverage
Highlights
Double Free: 1 prior fix. Scrutinize any change in this area.
hnswlib/hnswalg.h: 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.

Double Free: Inadequate validation of configuration parameters during index initialization can lead to integer overflow conditions that trigger memory corruption, specifically double free vulnerabilities. This was demonstrated in the HierarchicalNSW constructor where an unconstrained parameter size led to improper allocation state.
Integer Overflow: Using 32-bit unsigned integers for size calculations during index serialization or memory operations can cause silent wrap-around overflows when dealing with large datasets. This allows subsequent out-of-bounds heap writes via memcpy.