CVE-2020-35882

8.1 HIGH

📋 TL;DR

This vulnerability in the Rocket web framework for Rust allows creating multiple mutable references to the same object, potentially causing data races. It affects Rust applications using Rocket versions before 0.4.5. The issue could lead to memory corruption or unexpected behavior in concurrent environments.

💻 Affected Systems

Products:
  • Rocket web framework for Rust
Versions: All versions before 0.4.5
Operating Systems: All platforms running Rust applications
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects applications using the LocalRequest::clone method. Applications not using this specific method may not be vulnerable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Memory corruption leading to application crashes, data corruption, or potential remote code execution in worst-case scenarios with unsafe code usage.

🟠

Likely Case

Application instability, crashes, or data corruption in multi-threaded environments when LocalRequest::clone is used.

🟢

If Mitigated

Minimal impact if proper thread safety practices are followed and the vulnerable function is avoided.

🌐 Internet-Facing: MEDIUM
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

Exploitation requires specific conditions where LocalRequest::clone is used in concurrent contexts. No public exploits have been documented.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 0.4.5 and later

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

Restart Required: Yes

Instructions:

1. Update Cargo.toml to specify rocket = "^0.4.5" or later. 2. Run 'cargo update' to fetch the patched version. 3. Rebuild and redeploy your application.

🔧 Temporary Workarounds

Avoid LocalRequest::clone

all

Refactor code to avoid using the LocalRequest::clone method entirely

🧯 If You Can't Patch

  • Implement additional synchronization mechanisms around LocalRequest usage
  • Isolate vulnerable components and implement strict access controls

🔍 How to Verify

Check if Vulnerable:

Check Cargo.toml or Cargo.lock for rocket dependency version below 0.4.5

Check Version:

grep rocket Cargo.lock

Verify Fix Applied:

Verify rocket version is 0.4.5 or higher in Cargo.lock after update

📡 Detection & Monitoring

Log Indicators:

  • Application crashes, segmentation faults, or memory access errors in logs

Network Indicators:

  • Unusual application behavior or service interruptions

SIEM Query:

Application logs containing 'segmentation fault', 'memory corruption', or 'data race' errors

🔗 References

📤 Share & Export