synced 14 MIN AGO
01 Record

CVE-2022-21658

Race condition in std::fs::remove_dir_all in rustlang

HighPUBLISHEDCNA: GitHub_M
CNA base score7.3 CVSS v3.xCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:N/I:L/A:H

02 Description

Race condition in std::fs::remove_dir_all in rustlang

03 Exploitation and scoring

Exploitation
Public exploit code exists. CISA's assessment records a public proof of concept. That is not a report of exploitation in the wild.
SSVC decision
  • ExploitationpocPublic proof-of-concept exploit code exists. Not a report of exploitation in the wild.
  • AutomatablenoAt least one step from reconnaissance to exploitation cannot be reliably automated.
  • Technical ImpactpartialSuccessful exploitation gives limited control of the vulnerable component.
CISA publishes the decision points, not a final SSVC decision. The decision also depends on mission and well-being impact, which is a property of your deployment rather than of the vulnerability.
EPSS probability
1.37% probability of exploitation activity in the next 30 days.
EPSS percentile
Equal to or higher than the score of 71.8% of scored records. A rank, not a probability.
NVD base score
6.3 (CVSS v3.x), scored by the NVD independently of the CNA.
NVD CVSS vector
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:H
NVD analysis status
Modified. NVD last modified this record on 2026-06-17.
Red Hat severity
Moderate. Red Hat's rating for its own products, not a CVSS rating.

Exploit-prediction scores from FIRST. Independent scoring and analysis status from the NVD. Vendor severity from Red Hat. Exploitation assessment and catalog membership from CISA.

04 Metadata

Published
2022-01-20 00:00Z4 YR AGO
Last updated
2025-04-22 18:32Z1 YR AGO
Reserved
2021-11-16
Assigning CNA
GitHub_M
Record state
PUBLISHED
Severity
High (CVSS 7.3)
CNA CVSS vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:N/I:L/A:H
Weaknesses
  • CWE-363Race Condition Enabling Link FollowingBase
  • CWE-367Time-of-check Time-of-use (TOCTOU) Race ConditionBase
Data version
5.1
Document digest
35e1682c1d662b9f515fb46b75c9db871a2661e6ac51ceb873b145e247ecbe29

05 Affected products

VendorProductVersionsPlatforms
rust-langrust< 1.58.1—

06 References

07 Fixed in

AlmaLinux 8

  • cargo
    Fixed in 1.58.1-1.module_el8.6.0+2748+176088b3
  • cargo-doc
    Fixed in 1.58.1-1.module_el8.6.0+2748+176088b3
  • clippy
    Fixed in 1.58.1-1.module_el8.6.0+2748+176088b3
  • rls
    Fixed in 1.58.1-1.module_el8.6.0+2748+176088b3
  • rust
    Fixed in 1.58.1-1.module_el8.6.0+2748+176088b3
  • rust-analysis
    Fixed in 1.58.1-1.module_el8.6.0+2748+176088b3
  • rust-debugger-common
    Fixed in 1.58.1-1.module_el8.6.0+2748+176088b3
  • rust-doc
    Fixed in 1.58.1-1.module_el8.6.0+2748+176088b3
  • rust-gdb
    Fixed in 1.58.1-1.module_el8.6.0+2748+176088b3
  • rust-lldb
    Fixed in 1.58.1-1.module_el8.6.0+2748+176088b3
  • rust-src
    Fixed in 1.58.1-1.module_el8.6.0+2748+176088b3
  • rust-std-static
    Fixed in 1.58.1-1.module_el8.6.0+2748+176088b3
  • rust-std-static-wasm32-unknown-unknown
    Fixed in 1.58.1-1.module_el8.6.0+2748+176088b3
  • rust-std-static-wasm32-wasi
    Fixed in 1.58.1-1.module_el8.6.0+2748+176088b3
  • rust-toolset
    Fixed in 1.58.1-1.module_el8.6.0+2748+176088b3
  • rustfmt
    Fixed in 1.58.1-1.module_el8.6.0+2748+176088b3

Source: AlmaLinux, AlmaLinux OS. Copyright (c) 2023 AlmaLinux OS. Licensed under MIT License. Received through OSV.dev. Reformatted by exploit.cc.

CloudLinux 8

  • cargo
    Fixed in 1.58.1-1.module_el8.6.0+2748+176088b3
  • cargo-doc
    Fixed in 1.58.1-1.module_el8.6.0+2748+176088b3
  • clippy
    Fixed in 1.58.1-1.module_el8.6.0+2748+176088b3
  • rls
    Fixed in 1.58.1-1.module_el8.6.0+2748+176088b3
  • rust
    Fixed in 1.58.1-1.module_el8.6.0+2748+176088b3
  • rust-analysis
    Fixed in 1.58.1-1.module_el8.6.0+2748+176088b3
  • rust-debugger-common
    Fixed in 1.58.1-1.module_el8.6.0+2748+176088b3
  • rust-doc
    Fixed in 1.58.1-1.module_el8.6.0+2748+176088b3
  • rust-gdb
    Fixed in 1.58.1-1.module_el8.6.0+2748+176088b3
  • rust-lldb
    Fixed in 1.58.1-1.module_el8.6.0+2748+176088b3
  • rust-src
    Fixed in 1.58.1-1.module_el8.6.0+2748+176088b3
  • rust-std-static
    Fixed in 1.58.1-1.module_el8.6.0+2748+176088b3
  • rust-std-static-wasm32-unknown-unknown
    Fixed in 1.58.1-1.module_el8.6.0+2748+176088b3
  • rust-std-static-wasm32-wasi
    Fixed in 1.58.1-1.module_el8.6.0+2748+176088b3
  • rust-toolset
    Fixed in 1.58.1-1.module_el8.6.0+2748+176088b3
  • rustfmt
    Fixed in 1.58.1-1.module_el8.6.0+2748+176088b3

Derived from AlmaLinux 8. Partial coverage: only packages taken from AlmaLinux 8 are listed.

Source: CloudLinux errata, CloudLinux Inc. Derived from: AlmaLinux, AlmaLinux OS. Copyright (c) 2023 AlmaLinux OS. Licensed under MIT License. Received through OSV.dev. Reformatted by exploit.cc.

Debian 12

  • rustc
    Fixed in 1.57.0+dfsg1-1

Source: Debian Security Tracker, the Debian security team. Received through OSV.dev. Reformatted by exploit.cc.

Debian 13

  • rustc
    Fixed in 1.57.0+dfsg1-1

Source: Debian Security Tracker, the Debian security team. Received through OSV.dev. Reformatted by exploit.cc.

Debian 14

  • rustc
    Fixed in 1.57.0+dfsg1-1

Source: Debian Security Tracker, the Debian security team. Received through OSV.dev. Reformatted by exploit.cc.

Ubuntu 20.04 LTS

  • rustc
    Fixed in 1.59.0+dfsg1~ubuntu1~llvm-1~ubuntu1~20.04.2

Source: Ubuntu, Canonical Ltd. Licensed under CC BY-SA 4.0. Received through OSV.dev. Reformatted by exploit.cc.

Ubuntu Pro 14.04 LTS

  • rustc
    No fix yet

Source: Ubuntu, Canonical Ltd. Licensed under CC BY-SA 4.0. Received through OSV.dev. Reformatted by exploit.cc.

Ubuntu Pro 16.04 LTS

  • rustc
    No fix yet

Source: Ubuntu, Canonical Ltd. Licensed under CC BY-SA 4.0. Received through OSV.dev. Reformatted by exploit.cc.

A release or ecosystem missing from this list has no record here. It may be unaffected or not covered by the source. Source notices and licences.