Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ CVE-2022-21658 — fedora

🟠 CVSS 7.3 — High ⚠️ Exploit Public CWE-363 NVD
7.3
CVSS Score
0 Low4 Medium7 High9 Critical10

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.

How this vulnerability can be exploited

This issue can be reached with local access to the system, attack complexity is low, an attacker needs low-level privileges on the target. No user interaction is required. The scope is changed, meaning a successful attack can affect components beyond the vulnerable one. Rated impact: confidentiality none, integrity low, availability high.

CVSS metrics in full

The score comes from this vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:N/I:L/A:H

  • Attack vector: Local — a local account, shell or session on the host is needed.
  • Attack complexity: Low — the attack works reliably, with no preparation.
  • Privileges required: Low — an ordinary user account is enough.
  • User interaction: None — nobody has to be tricked into anything.
  • Scope: Changed — a successful attack reaches components beyond the vulnerable one.
  • Confidentiality impact: None.
  • Integrity impact: Low — limited, and the attacker does not choose what is affected.
  • Availability impact: High — total loss, or loss the attacker controls.

Weakness class

CVE-2022-21658 is classified as CWE-363: Race Condition Enabling Link Following. The product checks the status of a file or directory before accessing it, which produces a race condition in which the file can be replaced with a link before the access is performed, causing the product to access the wrong file.

Affected software

CVE-2022-21658 is recorded against 7 packages.

  • fedora
  • ipados (fixed in 15.4)
  • iphone-os (fixed in 15.4)
  • macos (from 12.0.0 up to 12.3)
  • rust (from 1.0.0 up to 1.58.0)
  • tvos (fixed in 15.4)
  • watchos (fixed in 8.5)

Timeline and source

Published on 20 January 2022 and last revised on 17 June 2026. A public exploit is known to exist, which raises the urgency of patching considerably. A vendor advisory or fix has been published. Record sourced from NVD.

References

blog.rust-lang.org
github.com
github.com
github.com
github.com
github.com
lists.fedoraproject.org
lists.fedoraproject.org
lists.fedoraproject.org
lists.fedoraproject.org
security.gentoo.org
support.apple.com
support.apple.com
support.apple.com
support.apple.com
blog.rust-lang.org
github.com
github.com
github.com
github.com
github.com
lists.fedoraproject.org
lists.fedoraproject.org
lists.fedoraproject.org
lists.fedoraproject.org
security.gentoo.org
support.apple.com
support.apple.com
support.apple.com
support.apple.com

Other advisories for this package

fedora has other advisories on record. If you are patching this one, these are worth checking on the same host:

Same weakness in other software

These advisories are the same class of weakness (CWE-363: Race Condition Enabling Link Following) in other software:

CVE-2022-21658 on other distributions

Each distribution ships its own build and its own fixed version. Pick the one you run:

Details

Severity HIGH
CVSS Score 7.3
CVSS Vector CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:N/I:L/A:H
CWE CWE-363
Public Exploit ⚠️ Yes
Source NVD
Published 2022-01-20
Updated 2026-08-20
Modified 2026-06-17

Affected Packages

Software From version Fixed in
fedora — —
ipados — 15.4
iphone-os — 15.4
macos 12.0.0 12.3
rust 1.0.0 1.58.0
tvos — 15.4
watchos — 8.5

References

Exploit, Mitigation, Vendor Advisory https://blog.rust-lang.org/2022/01/20/cve-2022-21658.html
Patch, Third Party Advisory https://github.com/rust-lang/rust/pull/93110
Exploit, Mitigation, Vendor Advisory https://blog.rust-lang.org/2022/01/20/cve-2022-21658.html
Patch, Third Party Advisory https://github.com/rust-lang/rust/pull/93110

Similar Threats

Exploit Protection

Are you running fedora?

CVE-2022-21658 carries CVSS 7.3 High rating and a public exploit already exists. BotEraser checks your installation against this and other known CVE records, and blocks IPs associated with exploit activity.

Check My Site For CVE-2022-21658 →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.

Browse related advisories

All advisoriesCVECVE 2022
✓