Security context

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

rust-lang/cargo
master @ a4277b2
39
Fixes
13
CVEs
CRITICAL
Peak severity
51.5%
Coverage
Highlights
Denial of Service: 16 prior fixes. Scrutinize any change in this area.
src/cargo/sources/registry/mod.rs: most-fixed (6 issues). Treat as high-risk during review.
7 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.

Path Traversal: Unpacking registry tarball entries without strictly comparing the target directory prefix or handling symbolic links properly allows malicious packages to overwrite files outside the intended destination directory.
Authentication Bypass: Failing to perform strict cryptographic validation of SSH host keys against a trusted known_hosts file allows Man-in-the-Middle (MITM) attacks when downloading indexes and dependencies over SSH.
Denial of Service: Unpacking registry crate tarballs without enforcing hard limits on compression ratios or maximum total unpacked size makes Cargo vulnerable to decompression-bomb (zip bomb) resource exhaustion.