CVE-2020-35889

8.1 HIGH

📋 TL;DR

This vulnerability in the crayon Rust crate is a Time-of-Check Time-of-Use (TOCTOU) issue that can lead to memory safety violations via HandleLike. Attackers could exploit this to cause crashes or potentially execute arbitrary code. Any Rust application using vulnerable versions of the crayon crate is affected.

💻 Affected Systems

Products:
  • crayon Rust crate
Versions: All versions through 2020-08-31
Operating Systems: All platforms running Rust applications
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects applications that use the vulnerable crayon crate functionality.

📦 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 unstable behavior.

🟢

If Mitigated

Limited impact due to memory safety protections in Rust, but still potential for crashes.

🌐 Internet-Facing: MEDIUM - Requires specific conditions and exploitation of TOCTOU race conditions.
🏢 Internal Only: LOW - Typically requires local access or specific application integration.

🎯 Exploit Status

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

Exploitation requires precise timing and specific conditions due to TOCTOU nature.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Versions after 2020-08-31

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

Restart Required: Yes

Instructions:

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

🔧 Temporary Workarounds

Remove crayon dependency

all

Temporarily remove or replace crayon crate with alternative if possible

cargo remove crayon

🧯 If You Can't Patch

  • Isolate affected applications in network segments
  • Implement strict access controls and monitoring

🔍 How to Verify

Check if Vulnerable:

Check Cargo.lock for crayon version ≤ 0.8.31

Check Version:

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

Verify Fix Applied:

Verify crayon version > 0.8.31 in Cargo.lock after update

📡 Detection & Monitoring

Log Indicators:

  • Application crashes
  • Memory access violation errors
  • Panic messages related to crayon

Network Indicators:

  • Unusual process behavior from Rust applications

SIEM Query:

process.name:rust AND (event.type:crash OR error.message:"crayon")

🔗 References

📤 Share & Export