Rust Patterns
32+ vulnerability patterns for Rust applications focusing on unsafe code, memory safety, and concurrency issues.
Memory Safety by Default
Rust's ownership system prevents many vulnerabilities at compile time. Bloodhound focuses on unsafe blocks, FFI boundaries, and logic errors.
Overview
While Rust provides strong memory safety guarantees, unsafe code blocks, FFI, and logic errors can still introduce vulnerabilities.
6
Critical
10
High
9
Medium
7
Low
Unsafe Code
Critical
Unsafe Transmute
std::mem::transmute can create invalid values or violate memory safety.
Vulnerable
Rust
Secure
Rust
Critical
Raw Pointer Dereference
Dereferencing raw pointers without proper validation.
Vulnerable
Rust
Secure
Rust
Memory Safety
Critical
Use After Free (unsafe)
Accessing memory after it has been freed in unsafe code.
Vulnerable
Rust
Secure
Rust
Critical
Buffer Overflow
Writing beyond buffer bounds using unsafe slice operations.
Vulnerable
Rust
Secure
Rust
Concurrency Issues
High
Data Race
Concurrent mutable access without proper synchronization.
Vulnerable
Rust
Secure
Rust
Medium
Potential Deadlock
Acquiring locks in inconsistent order can cause deadlocks.
Vulnerable
Rust
Secure
Rust
Cryptographic Errors
High
Weak Random Number Generation
Using non-cryptographic RNG for security-sensitive operations.
Vulnerable
Rust
Secure
Rust
Medium
Timing Attack in Comparison
Non-constant-time comparison leaks information through timing.
Vulnerable
Rust
Secure
Rust