
Cloud Vulnerability DB
A community-led vulnerabilities database
The remove_dir_all crate, a Rust library that provides enhanced functionality over the standard library fs::remove_dir_all function, was found to contain Time-of-check Time-of-use (TOCTOU) race conditions in versions prior to 0.8.0. The vulnerability was identified by the Rust security team and could potentially allow arbitrary paths to be deleted through symlink manipulation (GitHub Advisory).
The vulnerability stems from TOCTOU race conditions that could occur when a symlink is substituted for a path after the type of the path has been checked. This vulnerability follows the same pattern as CVE-2022-21658 in Rust itself, where an attacker could trick a privileged process performing a recursive delete in an attacker-controlled directory into deleting privileged files on all operating systems (GitHub Commit).
An attacker could potentially manipulate the system to delete arbitrary files by exploiting the race condition. For example, if a privileged process attempts to delete a tree called 'etc' in a parent directory 'p', an attacker could move 'p' to 'p-prime' and replace 'p' with a symlink to '/', resulting in the deletion of system-critical files like '/etc' (GitHub Commit).
The issue has been fixed in version 0.8.0 of remove_dir_all. The new version implements file-handle relative operations, where paths are opened relative to a file descriptor (Unix) or handle (Windows). A new extension trait 'RemoveDir' has been introduced that provides a more secure interface. For processes that might run with elevated privileges, it's recommended to implement secure directory identification methods to avoid the initial race condition (GitHub Advisory).
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."