Security context

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

dtolnay/cxx
master @ a5e5eb5
4
Fixes
0
CVEs
HIGH
Peak severity
50.0%
Coverage
Highlights
Memory Safety: 2 prior fixes. Scrutinize any change in this area.
macro/src/expand.rs: most-fixed (2 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.

Sandbox Escape: The code generation macro failed to accurately propagate unsafety on generated Rust shims for extern functions, allowing unsafe foreign code blocks to be invoked implicitly from safe Rust contexts. Developers must ensure code-generation paths strictly enforce 'unsafe' on all generated shim definitions that cross the FFI boundary.
Memory Safety: Exposing unchecked vector indexing (`get_unchecked`) as a safe API bypasses Rust's safety boundary, leading to potential out-of-bounds memory access. Unchecked methods operating on raw C++ pointers must always require explicit unsafe blocks.
Sandbox Escape: Allowing untrusted extern shared structs in safe blocks risks sound integration with C++ structures, bypassing safety invariants. Strict syntactic validation is required during translation to reject shared structures not explicitly enclosed within unsafe extern declarations.