Vulnerability DatabaseRUSTSEC-2023-0018

RUSTSEC-2023-0018
Rust vulnerability analysis and mitigation

Overview

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

Technical details

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

Impact

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

Mitigation and workarounds

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

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-2025-65807HIGH8.4
  • RustRust
  • sd
NoNoDec 10, 2025
CVE-2025-66627HIGH7.8
  • RustRust
  • wasmi
NoYesDec 09, 2025
CVE-2025-67487MEDIUM5.5
  • RustRust
  • static-web-server
NoYesDec 09, 2025
CVE-2025-66622LOW1.3
  • RustRust
  • matrix-sdk-base
NoYesDec 09, 2025
RUSTSEC-2025-0135N/AN/A
  • RustRust
  • matrix-sdk-base
NoYesDec 08, 2025

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