
Cloud Vulnerability DB
A community-led vulnerabilities database
RUSTSEC-2023-0018 affects the removedirall Rust crate, which provides functionality for recursive directory deletion. The vulnerability was discovered in version 0.7.0 and earlier versions, with a fix released in version 0.8.2. The vulnerability affects systems using the affected versions of the removedirall crate (Debian Security).
The vulnerability stems from Time-of-Check-Time-of-Use (TOCTOU) race conditions in both the implementation and contract of directory operations. The issue allows an attacker to exploit the time gap between checking a path and performing operations on it, potentially leading to privilege escalation. The vulnerability follows the same pattern as CVE-2022-21658 in Rust itself, where a privileged process performing recursive deletion in an attacker-controlled directory could be tricked into deleting privileged files on all operating systems (GitHub Commit).
The vulnerability could allow an attacker to trick a privileged process into deleting files outside the intended directory tree. For example, if a privileged process attempts to delete a directory named 'etc', an attacker could manipulate the path to make it delete the system's /etc directory instead, potentially causing system damage (GitHub Commit).
The vulnerability has been fixed in version 0.8.2 by implementing a new safe API that works with file descriptors rather than paths. The fix uses file-handle relative operations to prevent path manipulation attacks. For systems that cannot immediately upgrade, processes running with elevated privileges should implement secure methods to identify directories before deletion. The developers have also introduced a new extension trait 'RemoveDir' that provides a more secure interface (GitHub Commit).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."