CVE-2020-35874

8.1 HIGH

📋 TL;DR

This vulnerability in the Rust internment crate allows attackers to exploit a race condition in ArcIntern::drop, leading to use-after-free memory corruption. This affects any Rust application using vulnerable versions of the internment crate, potentially allowing arbitrary code execution or application crashes.

💻 Affected Systems

Products:
  • Rust applications using internment crate
Versions: All versions through 2020-05-28
Operating Systems: All platforms running Rust applications
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects applications that use the vulnerable ArcIntern functionality from the internment crate.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution leading to complete system compromise, data theft, or ransomware deployment.

🟠

Likely Case

Application crashes, denial of service, or memory corruption leading to unpredictable behavior.

🟢

If Mitigated

Limited impact with proper memory safety controls and sandboxing, potentially just crashes.

🌐 Internet-Facing: MEDIUM
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

Exploitation requires triggering the race condition in ArcIntern::drop, which may be challenging to reliably achieve.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 0.4.0 or later

Vendor Advisory: https://rustsec.org/advisories/RUSTSEC-2020-0017.html

Restart Required: Yes

Instructions:

1. Update Cargo.toml to use internment >= 0.4.0
2. Run 'cargo update' to fetch the fixed version
3. Rebuild and redeploy your application
4. Restart any running instances

🔧 Temporary Workarounds

Remove internment dependency

all

Temporarily remove or replace the internment crate with alternative memory management solutions

cargo remove internment

🧯 If You Can't Patch

  • Isolate affected applications in containers or sandboxes to limit potential damage
  • Implement strict network segmentation to prevent lateral movement if compromised

🔍 How to Verify

Check if Vulnerable:

Check Cargo.lock or Cargo.toml for 'internment' version <= 0.4.0

Check Version:

grep -A2 'name = "internment"' Cargo.lock

Verify Fix Applied:

Verify Cargo.lock shows internment >= 0.4.0 and run 'cargo audit' to confirm no vulnerabilities

📡 Detection & Monitoring

Log Indicators:

  • Application crashes with segmentation faults
  • Unexpected memory access errors in Rust logs

Network Indicators:

  • Unusual outbound connections from Rust applications

SIEM Query:

source="application_logs" AND ("segmentation fault" OR "use-after-free" OR "memory corruption")

🔗 References

📤 Share & Export