Security context

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

lightseekorg/tokenspeed
main @ e9fb42a
3
Fixes
0
CVEs
HIGH
Peak severity
50.0%
Coverage
Highlights
Memory Corruption: 2 prior fixes. Scrutinize any change in this area.
python/tokenspeed/runtime/cache/utils.py: most-fixed (1 issue). Treat as high-risk during review.
3 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: Integer overflows in index arithmetic can cause out-of-bounds reads and writes on GPU memory during key-value cache offset calculations. Developers must ensure 64-bit casting is consistently applied to physical page and token indices before performing multiplication or offset derivation.
Memory Corruption: Index calculations within Triton kernels for MLA KV-buffers are susceptible to integer overflows leading to invalid GPU pointer offsets. This risk is mitigated only by explicit type casting of indices to int64 before load operations.
Use After Free: Pruned TreeNodes in the scheduler can be freed while still tracked by raw-pointer bookkeeping structures (such as mamba_leaves_), creating a Use-After-Free condition when those raw pointers are subsequently dereferenced. Careful lifecycle management and untracking hooks are required.