Search CVEs and advisories

Search CVEs and Linux security advisories by vendor, product, package, or severity, and see which vulnerabilities each advisory addresses.

CVE

CVE-2022-21658

published high CVSS 3.1 · 7.3

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

Published
20 Jan 2022, 00:00:00 UTC
Updated
22 Apr 2025, 18:32:53 UTC
Language
en

Package status and fixes

Distro / vendorReleasePackage / productPublisher statusFixed buildSource
rust-lang — rust< 1.58.1 Affected Not stated GitHub_M
Amazon Linux AL2 Release evaluationALAS2-2022-1817 Fixed Not stated Amazon Linux assessment
AlmaLinux 8 rust Advisory build 1.58.1-1.module_el8.6.0+2748+176088b3 ALSA-2022:1894
Oracle Linux 8 rustaarch64 · rust-toolset · ol8 is enabled Advisory build 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 ELSA-2022-1894
Red Hat Enterprise Linux RHEL-8 rustaarch64 Advisory build 1.58.1-1.module+el8.6.0+14021+586eff1a RHSA-2022:1894
SUSE / openSUSE SLE-15 rustaarch64 Advisory build 1.53.0-3.40.1 SUSE-SU-2022:0200-1
Oracle Linux 8 rustx86_64 · rust-toolset · ol8 is enabled Advisory build 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 ELSA-2022-1894
Red Hat Enterprise Linux RHEL-8 rustppc64le Advisory build 1.58.1-1.module+el8.6.0+14021+586eff1a RHSA-2022:1894
Show 94 more entries
Distro / vendorReleasePackage / productPublisher statusFixed buildSource
Red Hat Enterprise Linux RHEL-8 rusts390x Advisory build 1.58.1-1.module+el8.6.0+14021+586eff1a RHSA-2022:1894
Red Hat Enterprise Linux RHEL-8 rustsrc Advisory build 1.58.1-1.module+el8.6.0+14021+586eff1a RHSA-2022:1894
Red Hat Enterprise Linux RHEL-8 rustx86_64 Advisory build 1.58.1-1.module+el8.6.0+14021+586eff1a RHSA-2022:1894
SUSE / openSUSE SLE-15 rustppc64le Advisory build 1.53.0-3.40.1 SUSE-SU-2022:0200-1
SUSE / openSUSE SLE-15 rusts390x Advisory build 1.53.0-3.40.1 SUSE-SU-2022:0200-1
SUSE / openSUSE SLE-15 rustx86_64 Advisory build 1.53.0-3.40.1 SUSE-SU-2022:0200-1
SUSE / openSUSE SLE-15-SP1 rustaarch64 Advisory build 1.53.0-22.1 SUSE-SU-2022:0491-1
SUSE / openSUSE SLE-15-SP1 rustppc64le Advisory build 1.53.0-22.1 SUSE-SU-2022:0491-1
SUSE / openSUSE SLE-15-SP1 rusts390x Advisory build 1.53.0-22.1 SUSE-SU-2022:0491-1
SUSE / openSUSE SLE-15-SP1 rustx86_64 Advisory build 1.53.0-22.1 SUSE-SU-2022:0491-1
SUSE / openSUSE SLE-15-SP2 rustaarch64 Advisory build 1.53.0-22.1 SUSE-SU-2022:0491-1
SUSE / openSUSE SLE-15-SP2 rustppc64le Advisory build 1.53.0-22.1 SUSE-SU-2022:0491-1
SUSE / openSUSE SLE-15-SP2 rusts390x Advisory build 1.53.0-22.1 SUSE-SU-2022:0491-1
SUSE / openSUSE SLE-15-SP2 rustx86_64 Advisory build 1.53.0-22.1 SUSE-SU-2022:0491-1
SUSE / openSUSE SLE-15-SP3 rustaarch64 Advisory build 1.59.0-150300.21.20.1 SUSE-SU-2022:0843-1
SUSE / openSUSE SLE-15-SP3 rustppc64le Advisory build 1.59.0-150300.21.20.1 SUSE-SU-2022:0843-1
SUSE / openSUSE SLE-15-SP3 rusts390x Advisory build 1.59.0-150300.21.20.1 SUSE-SU-2022:0843-1
SUSE / openSUSE SLE-15-SP3 rustx86_64 Advisory build 1.59.0-150300.21.20.1 SUSE-SU-2022:0843-1
SUSE / openSUSE openSUSE-Leap-15.3 rustaarch64 Advisory build 1.59.0-150300.21.20.1 OPENSUSE-SU-2022:0843-1
SUSE / openSUSE openSUSE-Leap-15.3 rustppc64le Advisory build 1.59.0-150300.21.20.1 OPENSUSE-SU-2022:0843-1
SUSE / openSUSE openSUSE-Leap-15.3 rusts390x Advisory build 1.59.0-150300.21.20.1 OPENSUSE-SU-2022:0843-1
SUSE / openSUSE openSUSE-Leap-15.3 rustx86_64 Advisory build 1.59.0-150300.21.20.1 OPENSUSE-SU-2022:0843-1
AlmaLinux 8 cargo Advisory build 1.58.1-1.module_el8.6.0+2748+176088b3 ALSA-2022:1894
AlmaLinux 8 cargo-doc Advisory build 1.58.1-1.module_el8.6.0+2748+176088b3 ALSA-2022:1894
AlmaLinux 8 clippy Advisory build 1.58.1-1.module_el8.6.0+2748+176088b3 ALSA-2022:1894
AlmaLinux 8 rls Advisory build 1.58.1-1.module_el8.6.0+2748+176088b3 ALSA-2022:1894
AlmaLinux 8 rust-analysis Advisory build 1.58.1-1.module_el8.6.0+2748+176088b3 ALSA-2022:1894
AlmaLinux 8 rust-debugger-common Advisory build 1.58.1-1.module_el8.6.0+2748+176088b3 ALSA-2022:1894
AlmaLinux 8 rust-doc Advisory build 1.58.1-1.module_el8.6.0+2748+176088b3 ALSA-2022:1894
AlmaLinux 8 rust-gdb Advisory build 1.58.1-1.module_el8.6.0+2748+176088b3 ALSA-2022:1894
AlmaLinux 8 rust-lldb Advisory build 1.58.1-1.module_el8.6.0+2748+176088b3 ALSA-2022:1894
AlmaLinux 8 rust-src Advisory build 1.58.1-1.module_el8.6.0+2748+176088b3 ALSA-2022:1894
AlmaLinux 8 rust-std-static Advisory build 1.58.1-1.module_el8.6.0+2748+176088b3 ALSA-2022:1894
AlmaLinux 8 rust-std-static-wasm32-unknown-unknown Advisory build 1.58.1-1.module_el8.6.0+2748+176088b3 ALSA-2022:1894
AlmaLinux 8 rust-std-static-wasm32-wasi Advisory build 1.58.1-1.module_el8.6.0+2748+176088b3 ALSA-2022:1894
AlmaLinux 8 rust-toolset Advisory build 1.58.1-1.module_el8.6.0+2748+176088b3 ALSA-2022:1894
AlmaLinux 8 rustfmt Advisory build 1.58.1-1.module_el8.6.0+2748+176088b3 ALSA-2022:1894
Oracle Linux 8 cargoaarch64 · rust-toolset · ol8 is enabled Advisory build 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 ELSA-2022-1894
Oracle Linux 8 cargox86_64 · rust-toolset · ol8 is enabled Advisory build 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 ELSA-2022-1894
Oracle Linux 8 cargo-docaarch64 · rust-toolset · ol8 is enabled Advisory build 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 ELSA-2022-1894
Oracle Linux 8 cargo-docx86_64 · rust-toolset · ol8 is enabled Advisory build 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 ELSA-2022-1894
Oracle Linux 8 clippyaarch64 · rust-toolset · ol8 is enabled Advisory build 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 ELSA-2022-1894
Oracle Linux 8 clippyx86_64 · rust-toolset · ol8 is enabled Advisory build 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 ELSA-2022-1894
Oracle Linux 8 rlsaarch64 · rust-toolset · ol8 is enabled Advisory build 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 ELSA-2022-1894
Oracle Linux 8 rlsx86_64 · rust-toolset · ol8 is enabled Advisory build 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 ELSA-2022-1894
Oracle Linux 8 rust-analysisaarch64 · rust-toolset · ol8 is enabled Advisory build 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 ELSA-2022-1894
Oracle Linux 8 rust-analysisx86_64 · rust-toolset · ol8 is enabled Advisory build 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 ELSA-2022-1894
Oracle Linux 8 rust-debugger-commonaarch64 · rust-toolset · ol8 is enabled Advisory build 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 ELSA-2022-1894
Oracle Linux 8 rust-debugger-commonx86_64 · rust-toolset · ol8 is enabled Advisory build 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 ELSA-2022-1894
Oracle Linux 8 rust-docaarch64 · rust-toolset · ol8 is enabled Advisory build 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 ELSA-2022-1894
Oracle Linux 8 rust-docx86_64 · rust-toolset · ol8 is enabled Advisory build 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 ELSA-2022-1894
Oracle Linux 8 rust-gdbaarch64 · rust-toolset · ol8 is enabled Advisory build 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 ELSA-2022-1894
Oracle Linux 8 rust-gdbx86_64 · rust-toolset · ol8 is enabled Advisory build 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 ELSA-2022-1894
Oracle Linux 8 rust-lldbaarch64 · rust-toolset · ol8 is enabled Advisory build 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 ELSA-2022-1894
Oracle Linux 8 rust-lldbx86_64 · rust-toolset · ol8 is enabled Advisory build 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 ELSA-2022-1894
Oracle Linux 8 rust-srcaarch64 · rust-toolset · ol8 is enabled Advisory build 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 ELSA-2022-1894
Oracle Linux 8 rust-srcx86_64 · rust-toolset · ol8 is enabled Advisory build 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 ELSA-2022-1894
Oracle Linux 8 rust-std-staticaarch64 · rust-toolset · ol8 is enabled Advisory build 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 ELSA-2022-1894
Oracle Linux 8 rust-std-staticx86_64 · rust-toolset · ol8 is enabled Advisory build 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 ELSA-2022-1894
Oracle Linux 8 rust-std-static-wasm32-unknown-unknownaarch64 · rust-toolset · ol8 is enabled Advisory build 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 ELSA-2022-1894
Oracle Linux 8 rust-std-static-wasm32-unknown-unknownx86_64 · rust-toolset · ol8 is enabled Advisory build 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 ELSA-2022-1894
Oracle Linux 8 rust-std-static-wasm32-wasiaarch64 · rust-toolset · ol8 is enabled Advisory build 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 ELSA-2022-1894
Oracle Linux 8 rust-std-static-wasm32-wasix86_64 · rust-toolset · ol8 is enabled Advisory build 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 ELSA-2022-1894
Oracle Linux 8 rust-toolsetaarch64 · rust-toolset · ol8 is enabled Advisory build 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 ELSA-2022-1894
Oracle Linux 8 rust-toolsetx86_64 · rust-toolset · ol8 is enabled Advisory build 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 ELSA-2022-1894
Oracle Linux 8 rustfmtaarch64 · rust-toolset · ol8 is enabled Advisory build 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 ELSA-2022-1894
Oracle Linux 8 rustfmtx86_64 · rust-toolset · ol8 is enabled Advisory build 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 ELSA-2022-1894
Red Hat Enterprise Linux RHEL-8 cargoaarch64 Advisory build 1.58.1-1.module+el8.6.0+14021+586eff1a RHSA-2022:1894
Red Hat Enterprise Linux RHEL-8 cargoppc64le Advisory build 1.58.1-1.module+el8.6.0+14021+586eff1a RHSA-2022:1894
Red Hat Enterprise Linux RHEL-8 cargos390x Advisory build 1.58.1-1.module+el8.6.0+14021+586eff1a RHSA-2022:1894
Red Hat Enterprise Linux RHEL-8 cargox86_64 Advisory build 1.58.1-1.module+el8.6.0+14021+586eff1a RHSA-2022:1894
Red Hat Enterprise Linux RHEL-8 cargo-debuginfoaarch64 Advisory build 1.58.1-1.module+el8.6.0+14021+586eff1a RHSA-2022:1894
Red Hat Enterprise Linux RHEL-8 cargo-debuginfoppc64le Advisory build 1.58.1-1.module+el8.6.0+14021+586eff1a RHSA-2022:1894
Red Hat Enterprise Linux RHEL-8 cargo-debuginfos390x Advisory build 1.58.1-1.module+el8.6.0+14021+586eff1a RHSA-2022:1894
Red Hat Enterprise Linux RHEL-8 cargo-debuginfox86_64 Advisory build 1.58.1-1.module+el8.6.0+14021+586eff1a RHSA-2022:1894
Red Hat Enterprise Linux RHEL-8 cargo-docnoarch Advisory build 1.58.1-1.module+el8.6.0+14021+586eff1a RHSA-2022:1894
Red Hat Enterprise Linux RHEL-8 clippyaarch64 Advisory build 1.58.1-1.module+el8.6.0+14021+586eff1a RHSA-2022:1894
Red Hat Enterprise Linux RHEL-8 clippyppc64le Advisory build 1.58.1-1.module+el8.6.0+14021+586eff1a RHSA-2022:1894
Red Hat Enterprise Linux RHEL-8 clippys390x Advisory build 1.58.1-1.module+el8.6.0+14021+586eff1a RHSA-2022:1894
Red Hat Enterprise Linux RHEL-8 clippyx86_64 Advisory build 1.58.1-1.module+el8.6.0+14021+586eff1a RHSA-2022:1894
Red Hat Enterprise Linux RHEL-8 clippy-debuginfoaarch64 Advisory build 1.58.1-1.module+el8.6.0+14021+586eff1a RHSA-2022:1894
Red Hat Enterprise Linux RHEL-8 clippy-debuginfoppc64le Advisory build 1.58.1-1.module+el8.6.0+14021+586eff1a RHSA-2022:1894
Red Hat Enterprise Linux RHEL-8 clippy-debuginfos390x Advisory build 1.58.1-1.module+el8.6.0+14021+586eff1a RHSA-2022:1894
Red Hat Enterprise Linux RHEL-8 clippy-debuginfox86_64 Advisory build 1.58.1-1.module+el8.6.0+14021+586eff1a RHSA-2022:1894
Red Hat Enterprise Linux RHEL-8 rlsaarch64 Advisory build 1.58.1-1.module+el8.6.0+14021+586eff1a RHSA-2022:1894
Red Hat Enterprise Linux RHEL-8 rlsppc64le Advisory build 1.58.1-1.module+el8.6.0+14021+586eff1a RHSA-2022:1894
Red Hat Enterprise Linux RHEL-8 rlss390x Advisory build 1.58.1-1.module+el8.6.0+14021+586eff1a RHSA-2022:1894
Red Hat Enterprise Linux RHEL-8 rlsx86_64 Advisory build 1.58.1-1.module+el8.6.0+14021+586eff1a RHSA-2022:1894
Red Hat Enterprise Linux RHEL-8 rls-debuginfoaarch64 Advisory build 1.58.1-1.module+el8.6.0+14021+586eff1a RHSA-2022:1894
Red Hat Enterprise Linux RHEL-8 rls-debuginfoppc64le Advisory build 1.58.1-1.module+el8.6.0+14021+586eff1a RHSA-2022:1894
Red Hat Enterprise Linux RHEL-8 rls-debuginfos390x Advisory build 1.58.1-1.module+el8.6.0+14021+586eff1a RHSA-2022:1894
Red Hat Enterprise Linux RHEL-8 rls-debuginfox86_64 Advisory build 1.58.1-1.module+el8.6.0+14021+586eff1a RHSA-2022:1894
Red Hat Enterprise Linux RHEL-8 rust-analysisaarch64 Advisory build 1.58.1-1.module+el8.6.0+14021+586eff1a RHSA-2022:1894
Red Hat Enterprise Linux RHEL-8 rust-analysisppc64le Advisory build 1.58.1-1.module+el8.6.0+14021+586eff1a RHSA-2022:1894

Package entries are limited to the first 100 builds and 100 linked advisories.

Description

Rust is a multi-paradigm, general-purpose programming language designed for performance and safety, especially safe concurrency. The Rust Security Response WG was notified that the `std::fs::remove_dir_all` standard library function is vulnerable a race condition enabling symlink following (CWE-363). An attacker could use this security issue to trick a privileged program into deleting files and directories the attacker couldn't otherwise access or delete. Rust 1.0.0 through Rust 1.58.0 is affected by this vulnerability with 1.58.1 containing a patch. Note that the following build targets don't have usable APIs to properly mitigate the attack, and are thus still vulnerable even with a patched toolchain: macOS before version 10.10 (Yosemite) and REDOX. We recommend everyone to update to Rust 1.58.1 as soon as possible, especially people developing programs expected to run in privileged contexts (including system daemons and setuid binaries), as those have the highest risk of being affected by this. Note that adding checks in your codebase before calling remove_dir_all will not mitigate the vulnerability, as they would also be vulnerable to race conditions like remove_dir_all itself. The existing mitigation is working as intended outside of race conditions.

en · GitHub_M · cna

Vendor advisories explicitly linked to this CVE.

20

Assessment

CVSS risk assessment and additional context for this vulnerability.

CVSS version
3.1
Base score
7.3 / 10
Severity
high
Provider
GitHub_M · cna
Vector string
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:N/I:L/A:H

Publisher product statements

Version ranges and default statuses as reported by each provider.

Affected vendor and product assertions
VendorProductVersion statusSource
rust-lang rust < 1.58.1 (affected) GitHub_M · cna

Weaknesses

2
  • CWE-363 CWE-363: Race Condition Enabling Link Following (GitHub_M · cna)
  • CWE-367 CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition (GitHub_M · cna)

References

15

Provider assertions

3

GitHub_M · cna

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

CISA-ADP · adp

CISA ADP Vulnrichment

CVE · adp

CVE Program Container

Provenance

Schema
5.1
Searchable
yes
Content hash
c7aab8a0ef93dda22cfbf6c8480a1f8ba512ca3b8376c0895f8984fb03528dc2
Ingested
23 Sep 2026, 07:58:18 UTC
Source record
Official CVE record

Search filters

Match options apply to free text. CVE words match tokens; use contains:"…" for literal substrings.

Text

Words and phrases
buffer overflow "remote code execution"
Word prefix
auth*
Literal substring (title or description)
contains:"use-after-free"
Exclude a term or filter
-test -vendor:example

Affected product

Vendor
vendor:Example
Product
product:"Demo Widget"

Severity and score

Severity · none, low, medium, high, critical, unknown
severity:critical
CWE identifier
cwe:CWE-863
CVSS score (0–10)
cvss:>=7.0

Dates and status

Published date · comparisons, relative days
published:>=2026-01-01
Updated date · comparisons, relative days
updated:<30d
Status · published (default), rejected, unknown
status:rejected