GHSA-f2wx-xjfw-xjv6: Topgrade Topgrade Time-of-check Time-of-use (TOCTOU) Race Vulnerability

LOW
CWE-367
Published
Advisory Summary

GHSA-f2wx-xjfw-xjv6 is a LOW topgrade time-of-check time-of-use (toctou) race vulnerability (CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition) affecting Topgrade libraries in the crates.io ecosystem. The issue involves topgrade time-of-check time-of-use (toctou) race condition in remove_dir_all. Remediation is available by upgrading affected packages to version 12.0.1.

GHSA-f2wx-xjfw-xjv6 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-f2wx-xjfw-xjv6
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition
Affected Product Topgrade
Package Ecosystem crates.io
Published Date
Last Updated

How to Fix GHSA-f2wx-xjfw-xjv6

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

topgrade fixed: 12.0.1
Upgrade topgrade to 12.0.1
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 topgrade

How to Check if You Are Affected

To determine whether your application is affected by GHSA-f2wx-xjfw-xjv6, inspect your project dependencies for Topgrade:

inspect dependencies for topgrade

Analyze the terminal output to locate any version of Topgrade in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 12.0.1), 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-367: Time-of-check Time-of-use (TOCTOU) Race Condition, where the product checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check. In Topgrade, 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

### Summary https://github.com/advisories/GHSA-mc8h-8q98-g5hr https://github.com/XAMPPRocky/remove_dir_all/commit/7247a8b6ee59fc99bbb69ca6b3ca4bfd8c809ead `tempfile` v0.4.26 ships with affected `remove_dir_all` v0.5.3 and so blocks my deployment of v12 to openSUSE distribution because it imposes a clean `cargo audit` Updating `tempfile` is warranted

GHSA-f2wx-xjfw-xjv6 Affected Topgrade Versions

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

References

Frequently Asked Questions

What is GHSA-f2wx-xjfw-xjv6?
GHSA-f2wx-xjfw-xjv6 is a security vulnerability in Topgrade involving topgrade Time-of-check Time-of-use (TOCTOU) Race Condition in remove_dir_all under CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition.
Which Topgrade versions are affected?
Affected versions include releases prior to 12.0.1 across affected packages: topgrade.
What version fixes GHSA-f2wx-xjfw-xjv6?
Upgrading to 12.0.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is topgrade affected?
Yes, topgrade is affected in releases prior to 12.0.1. Upgrade your dependency to 12.0.1 or later.
What CWE is associated with GHSA-f2wx-xjfw-xjv6?
GHSA-f2wx-xjfw-xjv6 is classified under CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition (The product checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check.).
How can I check crates.io dependencies for GHSA-f2wx-xjfw-xjv6?
Run the dependency tree command: 'inspect dependencies for topgrade'. 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-f2wx-xjfw-xjv6",
  "modified" : "2023-07-17T18:21:58Z",
  "published" : "2023-07-17T18:21:58Z",
  "aliases" : [ ],
  "summary" : "topgrade Time-of-check Time-of-use (TOCTOU) Race Condition in remove_dir_all",
  "details" : "### Summary\nhttps://github.com/advisories/GHSA-mc8h-8q98-g5hr\nhttps://github.com/XAMPPRocky/remove_dir_all/commit/7247a8b6ee59fc99bbb69ca6b3ca4bfd8c809ead\n\n`tempfile` v0.4.26 ships with affected `remove_dir_all` v0.5.3 and so blocks my deployment of v12 to openSUSE distribution because it imposes a clean `cargo audit`\n\nUpdating `tempfile` is warranted",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "topgrade"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "12.0.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 12.0.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/topgrade-rs/topgrade/security/advisories/GHSA-f2wx-xjfw-xjv6"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/XAMPPRocky/remove_dir_all/commit/7247a8b6ee59fc99bbb69ca6b3ca4bfd8c809ead"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-mc8h-8q98-g5hr"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/topgrade-rs/topgrade"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/topgrade-rs/topgrade/releases/tag/v12.0.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-367" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-07-17T18:21:58Z",
    "nvd_published_at" : null
  }
}