Vulnerability DatabaseGHSA-f2wx-xjfw-xjv6

GHSA-f2wx-xjfw-xjv6
Rust vulnerability analysis and mitigation

Overview

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).

Technical details

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).

Impact

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).

Mitigation and workarounds

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).

Additional resources


SourceThis report was generated using AI

Related Rust vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-22863CRITICAL9.2
  • RustRust
  • deno
NoYesJan 15, 2026
CVE-2026-23519HIGH8.9
  • RustRust
  • yazi
NoYesJan 15, 2026
RUSTSEC-2026-0003HIGH8.9
  • RustRust
  • cmov
NoYesJan 14, 2026
CVE-2026-22864HIGH8.1
  • RustRust
  • deno
NoYesJan 15, 2026
CVE-2026-22782LOW2.9
  • RustRust
  • rustfs
NoYesJan 16, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management