CVE-2021-28037

9.8 CRITICAL

📋 TL;DR

This vulnerability in the internment crate for Rust allows data races that can lead to memory corruption due to improper Sync trait implementation. Any Rust application using internment crate versions before 0.4.2 is affected, potentially leading to crashes or arbitrary code execution.

💻 Affected Systems

Products:
  • Rust applications using internment crate
Versions: All versions before 0.4.2
Operating Systems: All platforms running Rust applications
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects Rust applications that explicitly use the internment crate. Not a vulnerability in Rust itself.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Memory corruption leading to arbitrary code execution, complete system compromise, or remote code execution in network-facing services.

🟠

Likely Case

Application crashes, data corruption, or denial of service due to memory safety violations.

🟢

If Mitigated

Limited impact if application runs with minimal privileges and doesn't handle sensitive data.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

Exploitation requires triggering data races in concurrent code using Intern<T>. Requires application-specific knowledge.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 0.4.2

Vendor Advisory: https://rustsec.org/advisories/RUSTSEC-2021-0036.html

Restart Required: Yes

Instructions:

1. Update Cargo.toml to require 'internment = "^0.4.2"' 2. Run 'cargo update' 3. Rebuild and redeploy application 4. Restart affected services

🔧 Temporary Workarounds

Avoid concurrent usage

all

Prevent data races by avoiding concurrent access to Intern<T> objects

Pin to safe version

all

Force dependency resolution to safe version

cargo update -p internment --precise 0.4.2

🧯 If You Can't Patch

  • Isolate affected applications in containers or VMs with minimal privileges
  • Implement strict network segmentation to limit blast radius

🔍 How to Verify

Check if Vulnerable:

Check Cargo.lock for 'internment' version <0.4.2 or run: cargo tree | grep internment

Check Version:

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

Verify Fix Applied:

Verify Cargo.lock shows internment version 0.4.2 or higher

📡 Detection & Monitoring

Log Indicators:

  • Segmentation faults
  • Memory access violations
  • Unexpected application crashes

Network Indicators:

  • Unusual outbound connections from Rust applications

SIEM Query:

process.name:"rust_app" AND (event.type:"crash" OR event.type:"segfault")

🔗 References

📤 Share & Export