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.
Conclusion & alert: CVE-2022-21658 is rated High Exploit Risk (70.7/100): CVSS High severity, with medium exploitation likelihood (EPSS 0.91%). Core evidence: 2 public exploit reference(s) are indexed (Exploit-DB). Mandatory action: Public exploits are available—assess exposure, apply mitigations, and prioritize patching.
Risk is dynamic; we continuously reassess and refresh what is shown on this page as upstream context changes.
| EDB-ID | Source | Kind | Published | Link |
|---|---|---|---|---|
| — | nvd_ref | exploit_tag | Exploit-DB ↗ | |
| — | nvd_ref | exploit_tag | Exploit-DB ↗ |
EPSS lead: Daily EPSS estimates relative likelihood of exploitation; percentile ranks this CVE among scored vulnerabilities (higher = more severe relative rank).
| # | Date | Old EPSS score | New EPSS score | Delta (New - Old) |
|---|---|---|---|---|
| 1 | 2026-03-04 | 0.76% | 0.91% | +0.14% |
| 2 | 2026-03-01 | 0.89% | 0.76% | -0.13% |
| 3 | 2026-02-04 | — | 0.89% | — |
Full EPSS history (52 records total)
CVSS metrics for this CVE.
| Base score | Version | Severity | Vector | Exploitability | Impact | Score source |
|---|---|---|---|---|---|---|
| 7.3 | 3.1 | HIGH |
|
2.0 | 4.7 | [email protected] |
| 6.3 | 3.1 | MEDIUM |
|
1.0 | 5.2 | [email protected] |
| 3.3 | 2.0 | LOW |
|
3.4 | 4.9 | [email protected] |
| vendor | priority | summary | link |
|---|---|---|---|
alpine
|
medium | CVE-2022-21658: 1 source package rows (rust); 32 state rows across 6 repos (3.19-main, 3.20-main, 3.21-main, 3.22-main, edge-community, edge-main); fixed 0, open 32. | https://security.alpinelinux.org/vuln/CVE-2022-21658 |
debian
|
not yet assigned | CVE-2022-21658 not yet assigned priority: Debian including 1 source packages (rustc), 5 status rows across 5 suites (bookworm, bullseye, forky, sid, trixie): resolved 4, open 1. | https://security-tracker.debian.org/tracker/CVE-2022-21658 |
gentoo
|
normal | CVE-2022-21658: 1 GLSA(s) (202210-09), 2 atom(s) (dev-lang/rust, dev-lang/rust-bin); latest impact normal. | https://bugs.gentoo.org/buglist.cgi?quicksearch=CVE-2022-21658 |
redhat
|
medium | — | https://access.redhat.com/security/cve/CVE-2022-21658 |
suse
|
medium | CVE-2022-21658 severity moderate: SUSE including 53 source package names (1.56-2.1:cargo1.56-1.56.1-150300.7.6.1, 1.56-2.1:rust1.56-1.56.1-150300.7.6.1, …), 223 product×package rows across 31 product lines (Container bci/rust, SUSE CaaS Platform 4.0, … (31 product lines)): Fixed 223. | https://www.suse.com/security/cve/CVE-2022-21658/ |
ubuntu
|
medium | CVE-2022-21658 medium priority: Ubuntu including 1 source packages (rustc), 15 status rows across 15 suites (bionic, focal, hirsute, impish, jammy, kinetic, lunar, mantic, noble, oracular, plucky, questing, trusty, upstream, xenial): not-affected 6, DNE 3, ignored 2, needed 2, released 2. | https://ubuntu.com/security/CVE-2022-21658 |
| Vendor | Product | Version | Raw CPE |
|---|---|---|---|
| rust-lang | rust | >= 1.0.0, <= 1.58.0 | cpe:2.3:a:rust-lang:rust:*:*:*:*:*:*:*:* |
| fedoraproject | fedora | 34 | cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:* |
| fedoraproject | fedora | 35 | cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:* |
| apple | ipados | < 15.4 | cpe:2.3:o:apple:ipados:*:*:*:*:*:*:*:* |
| apple | iphone_os | < 15.4 | cpe:2.3:o:apple:iphone_os:*:*:*:*:*:*:*:* |
| apple | macos | >= 12.0.0, < 12.3 | cpe:2.3:o:apple:macos:*:*:*:*:*:*:*:* |
| apple | tvos | < 15.4 | cpe:2.3:o:apple:tvos:*:*:*:*:*:*:*:* |
| apple | watchos | < 8.5 | cpe:2.3:o:apple:watchos:*:*:*:*:*:*:*:* |