CVE-2024-27284
📋 TL;DR
This is a use-after-free vulnerability in the cassandra-rs Rust driver for Cassandra databases. When code accesses an iterator item after the iterator has advanced, it accesses freed memory causing undefined behavior. This affects Rust applications using vulnerable versions of the cassandra-rs driver to connect to Cassandra databases.
💻 Affected Systems
- cassandra-rs Rust driver
📦 What is this software?
Cassandra Rs by Cassandra Rs Project
⚠️ Risk & Real-World Impact
Worst Case
Remote code execution leading to complete system compromise, data corruption, or service disruption through memory corruption.
Likely Case
Application crashes, memory corruption leading to data integrity issues, or denial of service.
If Mitigated
Limited to application instability if proper memory safety controls and sandboxing are implemented.
🎯 Exploit Status
Exploitation requires attacker to control or influence iterator usage patterns in vulnerable Rust code. No public exploits have been reported.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 3.0.0
Vendor Advisory: https://github.com/Metaswitch/cassandra-rs/security/advisories/GHSA-x9xc-63hg-vcfq
Restart Required: Yes
Instructions:
1. Update Cargo.toml to specify cassandra-rs version 3.0.0 or higher. 2. Run 'cargo update' to fetch the new version. 3. Rebuild and redeploy your Rust application. 4. Restart any running services using the updated application.
🔧 Temporary Workarounds
Avoid iterator reuse patterns
allModify code to avoid accessing iterator items after advancing the iterator. Store needed values before advancing.
🧯 If You Can't Patch
- Implement strict input validation and sanitization for all data processed through cassandra-rs iterators
- Deploy application in sandboxed/containerized environments with memory protection controls
🔍 How to Verify
Check if Vulnerable:
Check Cargo.toml or Cargo.lock for cassandra-rs dependency version. If version is <3.0.0, the application is vulnerable.
Check Version:
grep -A2 -B2 'cassandra-rs' Cargo.toml || grep 'cassandra-rs' Cargo.lock
Verify Fix Applied:
Verify cassandra-rs version is 3.0.0 or higher in Cargo.lock after update. Test iterator usage patterns in your application code.
📡 Detection & Monitoring
Log Indicators:
- Application crashes with segmentation faults
- Memory corruption errors in application logs
- Unexpected Rust panic messages related to iterator access
Network Indicators:
- Unusual database query patterns from application
- Increased failed Cassandra connection attempts
SIEM Query:
source="application_logs" AND ("segmentation fault" OR "use-after-free" OR "iterator" AND "panic")
🔗 References
- https://github.com/Metaswitch/cassandra-rs/commit/ae054dc8044eac9c2c7ae2b1ab154b53ca7f8df7
- https://github.com/Metaswitch/cassandra-rs/security/advisories/GHSA-x9xc-63hg-vcfq
- https://github.com/Metaswitch/cassandra-rs/commit/ae054dc8044eac9c2c7ae2b1ab154b53ca7f8df7
- https://github.com/Metaswitch/cassandra-rs/security/advisories/GHSA-x9xc-63hg-vcfq