CVE-2020-35895
📋 TL;DR
CVE-2020-35895 is a memory corruption vulnerability in the Rust stack crate's ArrayVec implementation that allows out-of-bounds writes during element insertion. This can lead to arbitrary code execution, denial of service, or data corruption. Any Rust application using the vulnerable stack crate versions is affected.
💻 Affected Systems
- Rust applications using stack crate
📦 What is this software?
Stack by Stack Project
⚠️ Risk & Real-World Impact
Worst Case
Remote code execution leading to complete system compromise, data exfiltration, or ransomware deployment.
Likely Case
Application crash (denial of service) or memory corruption leading to unpredictable behavior.
If Mitigated
Limited impact with proper memory protections and exploit mitigations like ASLR and stack canaries.
🎯 Exploit Status
Exploitation requires triggering the vulnerable ArrayVec insertion code path.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: stack crate version 0.3.1 or later
Vendor Advisory: https://rustsec.org/advisories/RUSTSEC-2020-0042.html
Restart Required: Yes
Instructions:
1. Update Cargo.toml to require stack crate >=0.3.1. 2. Run 'cargo update' to fetch patched version. 3. Rebuild and redeploy application.
🔧 Temporary Workarounds
Remove stack crate dependency
allReplace stack crate with alternative safe implementations
cargo remove stack
cargo add [alternative-crate]
🧯 If You Can't Patch
- Implement input validation and sanitization for all ArrayVec insertion operations
- Deploy memory protection controls like ASLR, DEP, and stack canaries
🔍 How to Verify
Check if Vulnerable:
Check Cargo.lock for stack crate version <0.3.1 or run 'cargo audit'
Check Version:
grep -A2 'name = "stack"' Cargo.lock
Verify Fix Applied:
Verify Cargo.lock contains stack crate >=0.3.1 and 'cargo audit' shows no vulnerabilities
📡 Detection & Monitoring
Log Indicators:
- Application crashes with segmentation faults
- Memory access violation errors
- Unexpected process termination
Network Indicators:
- Unusual outbound connections following application crashes
SIEM Query:
source="application.logs" AND ("segmentation fault" OR "access violation" OR "stack crate")