CVE-2020-35866

9.8 CRITICAL

📋 TL;DR

This vulnerability in the rusqlite crate for Rust allows memory safety violations through VTab/VTabCursor interfaces, potentially leading to arbitrary code execution. It affects Rust applications using rusqlite versions before 0.23.0 for SQLite database operations.

💻 Affected Systems

Products:
  • rusqlite crate for Rust
Versions: All versions before 0.23.0
Operating Systems: All platforms supported by Rust
Default Config Vulnerable: ⚠️ Yes
Notes: Any Rust application using vulnerable rusqlite versions with VTab/VTabCursor functionality is affected.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

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

🟠

Likely Case

Application crash or denial of service, with potential for memory corruption leading to information disclosure.

🟢

If Mitigated

Limited impact with proper sandboxing and privilege separation, potentially only causing application instability.

🌐 Internet-Facing: HIGH - Applications exposing SQLite functionality could be remotely exploited.
🏢 Internal Only: MEDIUM - Internal applications could be exploited by authenticated users or through other attack vectors.

🎯 Exploit Status

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

Exploitation requires crafting malicious VTab/VTabCursor operations, but no public exploit code is known.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 0.23.0 and later

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

Restart Required: Yes

Instructions:

1. Update Cargo.toml to require rusqlite >=0.23.0
2. Run 'cargo update rusqlite'
3. Rebuild and redeploy your application
4. Restart affected services

🔧 Temporary Workarounds

Disable VTab functionality

all

Disable virtual table support if not required

Configure rusqlite without 'vtab' feature flag in Cargo.toml

🧯 If You Can't Patch

  • Implement strict input validation and sanitization for all database operations
  • Deploy application in sandboxed/containerized environment with minimal privileges

🔍 How to Verify

Check if Vulnerable:

Check Cargo.lock or run 'cargo tree | grep rusqlite' to see installed version

Check Version:

grep rusqlite Cargo.lock | head -1

Verify Fix Applied:

Verify rusqlite version is >=0.23.0 in Cargo.lock and application functions correctly

📡 Detection & Monitoring

Log Indicators:

  • Application crashes with memory corruption errors
  • Unexpected database connection failures

Network Indicators:

  • Unusual database query patterns
  • Excessive failed SQL operations

SIEM Query:

source="application_logs" AND ("segmentation fault" OR "memory corruption" OR "rusqlite")

🔗 References

📤 Share & Export