CVE-2020-36212

7.5 HIGH

📋 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

Products:
  • abi_stable Rust crate
Versions: All versions before 0.9.1
Operating Systems: All platforms running Rust applications
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects Rust applications that directly use the abi_stable crate's DrainFilter functionality. Applications using other crates that depend on vulnerable abi_stable versions are also affected.

📦 What is this software?

⚠️ 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.

🌐 Internet-Facing: MEDIUM
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

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

all

Temporarily 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

🔗 References

📤 Share & Export