GHSA-mc8h-8q98-g5hr: Remove dir all Race Condition Enabling Link Following Vulnerability

LOW
CWE-366 CWE-367
Published
Advisory Summary

GHSA-mc8h-8q98-g5hr is a LOW race condition enabling link following vulnerability (CWE-366: Race Condition within a Thread) affecting Remove dir all libraries in the crates.io ecosystem. The issue involves race condition enabling link following and time-of-check time-of-use (toctou) race condition in remove_dir_all. Remediation is available by upgrading affected packages to version 0.8.0.

GHSA-mc8h-8q98-g5hr at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-mc8h-8q98-g5hr
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-366: Race Condition within a Thread
Affected Product Remove dir all
Package Ecosystem crates.io
Published Date
Last Updated

How to Fix GHSA-mc8h-8q98-g5hr

To remediate this vulnerability, upgrade all affected Remove dir all dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

remove_dir_all fixed: 0.8.0
Upgrade remove_dir_all to 0.8.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for remove_dir_all

How to Check if You Are Affected

To determine whether your application is affected by GHSA-mc8h-8q98-g5hr, inspect your project dependencies for Remove dir all:

inspect dependencies for remove_dir_all

Analyze the terminal output to locate any version of Remove dir all in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.8.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-366: Race Condition within a Thread, where if two threads of execution use a resource simultaneously, there exists the possibility that resources may be used while invalid, in turn making the state of execution undefined. In Remove dir all, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

The `remove_dir_all` crate is a Rust library that offers additional features over the Rust standard library `fs::remove_dir_all` function. It suffers the same class of failure as the code it was layering over: TOCTOU race conditions, with the ability to cause arbitrary paths to be deleted by substituting a symlink for a path after the type of the path was checked. Thanks to the Rust security team for identifying the problem and alerting us to it.

GHSA-mc8h-8q98-g5hr Affected Remove dir all Versions

1 component(s)
Fixed Versions:
0.8.0
Product / Package Ecosystem Affected Versions Fixed Version
remove_dir_all
crates.io
< 0.8.0
0.8.0

References

Frequently Asked Questions

What is GHSA-mc8h-8q98-g5hr?
GHSA-mc8h-8q98-g5hr is a security vulnerability in Remove dir all involving Race Condition Enabling Link Following and Time-of-check Time-of-use (TOCTOU) Race Condition in remove_dir_all under CWE-366: Race Condition within a Thread.
Which Remove dir all versions are affected?
Affected versions include releases prior to 0.8.0 across affected packages: remove_dir_all.
What version fixes GHSA-mc8h-8q98-g5hr?
Upgrading to 0.8.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is remove_dir_all affected?
Yes, remove_dir_all is affected in releases prior to 0.8.0. Upgrade your dependency to 0.8.0 or later.
What CWE is associated with GHSA-mc8h-8q98-g5hr?
GHSA-mc8h-8q98-g5hr is classified under CWE-366: Race Condition within a Thread (If two threads of execution use a resource simultaneously, there exists the possibility that resources may be used while invalid, in turn making the state of execution undefined.).
How can I check crates.io dependencies for GHSA-mc8h-8q98-g5hr?
Run the dependency tree command: 'inspect dependencies for remove_dir_all'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-mc8h-8q98-g5hr",
  "modified" : "2023-02-24T16:23:59Z",
  "published" : "2023-02-24T16:23:59Z",
  "aliases" : [ ],
  "summary" : "Race Condition Enabling Link Following and Time-of-check Time-of-use (TOCTOU) Race Condition in remove_dir_all",
  "details" : "The `remove_dir_all` crate is a Rust library that offers additional features over the Rust standard library `fs::remove_dir_all` function. It suffers the same class of failure as the code it was layering over: TOCTOU race conditions, with the ability to cause arbitrary paths to be deleted by substituting a symlink for a path after the type of the path was checked.\n\nThanks to the Rust security team for identifying the problem and alerting us to it.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "remove_dir_all"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.8.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/XAMPPRocky/remove_dir_all/security/advisories/GHSA-mc8h-8q98-g5hr"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/XAMPPRocky/remove_dir_all/commit/7247a8b6ee59fc99bbb69ca6b3ca4bfd8c809ead"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/XAMPPRocky/remove_dir_all"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2023-0018.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-366", "CWE-367" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-02-24T16:23:59Z",
    "nvd_published_at" : null
  }
}