CVE-2020-35891

7.5 HIGH

📋 TL;DR

This vulnerability in the Rust ordnung crate allows memory corruption through a double-free condition in the compact::Vec remove() function. Attackers could potentially execute arbitrary code or crash applications using this library. All Rust applications that depend on affected versions of the ordnung crate are vulnerable.

💻 Affected Systems

Products:
  • Rust applications using the ordnung crate
Versions: All versions through 2020-09-03
Operating Systems: All platforms running Rust applications
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects Rust applications that use the compact::Vec::remove() function from the ordnung 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) and potential memory corruption leading to data leakage.

🟢

If Mitigated

Contained crashes without privilege escalation if proper sandboxing and memory protections are in place.

🌐 Internet-Facing: MEDIUM
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Exploitation requires triggering the vulnerable remove() function with specific conditions to cause double-free.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Update to ordnung crate version after 2020-09-03

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

Restart Required: Yes

Instructions:

1. Update Cargo.toml to use ordnung crate version > 0.9.0
2. Run 'cargo update --package ordnung'
3. Rebuild and redeploy your application
4. Restart affected services

🔧 Temporary Workarounds

Avoid compact::Vec::remove()

all

Temporarily avoid using the vulnerable remove() function on compact::Vec instances

// Code review to identify and avoid compact::Vec::remove() calls

🧯 If You Can't Patch

  • Implement strict input validation to prevent triggering the vulnerable code path
  • Deploy memory protection mechanisms like ASLR and DEP to reduce exploit impact

🔍 How to Verify

Check if Vulnerable:

Check Cargo.lock for ordnung crate version <= 0.9.0 or check dependencies with 'cargo tree | grep ordnung'

Check Version:

grep ordnung Cargo.lock | head -1

Verify Fix Applied:

Verify ordnung crate version > 0.9.0 in Cargo.lock and test application functionality

📡 Detection & Monitoring

Log Indicators:

  • Application crashes with memory corruption errors
  • Segmentation faults in Rust applications

Network Indicators:

  • Unusual outbound connections following application crashes

SIEM Query:

source="application_logs" AND ("segmentation fault" OR "double free" OR "memory corruption") AND process="rust_app"

🔗 References

📤 Share & Export