CVE-2020-36212
📋 TL;DR
This vulnerability in the abi_stable Rust crate before version 0.9.1 involves a double drop issue in the DrainFilter functionality, which can lead to memory corruption and potential arbitrary code execution. It affects any Rust application using the vulnerable versions of the abi_stable crate. The issue stems from improper memory management that could be triggered during specific operations.
💻 Affected Systems
- abi_stable Rust crate
📦 What is this software?
Abi Stable by Abi Stable Project
⚠️ Risk & Real-World Impact
Worst Case
Memory corruption leading to arbitrary code execution, potentially allowing full system compromise or remote code execution if the vulnerable code handles untrusted input.
Likely Case
Application crashes, denial of service, or memory corruption leading to undefined behavior and potential data corruption.
If Mitigated
Limited impact if the vulnerable functionality isn't used or if input validation prevents triggering the condition.
🎯 Exploit Status
Exploitation requires triggering the specific memory management issue through application logic. No public exploit code has been documented.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 0.9.1 and later
Vendor Advisory: https://rustsec.org/advisories/RUSTSEC-2020-0105.html
Restart Required: Yes
Instructions:
1. Update Cargo.toml to specify abi_stable version '>=0.9.1' 2. Run 'cargo update' to fetch the patched version 3. Rebuild and redeploy the application 4. Restart any running services using the updated application
🔧 Temporary Workarounds
Avoid DrainFilter usage
allTemporarily avoid using the DrainFilter functionality in abi_stable until patched
Modify Rust code to use alternative methods instead of DrainFilter
🧯 If You Can't Patch
- Implement strict input validation and sanitization for any data processed by the vulnerable functionality
- Isolate the vulnerable application in a restricted environment with minimal privileges
🔍 How to Verify
Check if Vulnerable:
Check Cargo.lock or Cargo.toml for abi_stable dependency version. If version is <0.9.1, the system is vulnerable.
Check Version:
grep -i abi_stable Cargo.toml Cargo.lock
Verify Fix Applied:
Verify that Cargo.lock shows abi_stable version 0.9.1 or higher after running cargo update
📡 Detection & Monitoring
Log Indicators:
- Application crashes with memory corruption errors
- Segmentation faults in Rust applications using abi_stable
Network Indicators:
- Unusual application behavior or crashes following specific operations
SIEM Query:
Process monitoring for Rust application crashes with memory-related error codes