CVE-2022-21658: apple ipados Race Condition Enabling Link Following
Vulnerability summary
CVE-2022-21658 is a high (CVSS 7.3) Race Condition Enabling Link Following vulnerability in apple ipados. EPSS estimates a 1.38% chance of exploitation in the next 30 days, higher than 71.5% of scored vulnerabilities. 2 public exploits are recorded.
Timeline
- 20-01-2022PublishedVulnerability first disclosed.
- 22-04-2025Last modifiedVulnerability information updated.
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.
CVSS metrics
6 scores · 5 sources · 2 versions- OSV · Red hatEcosystem advisory · calculated5.3MediumCVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:NDiffers
- OSV · UbuntuEcosystem advisory · calculated6.3MediumCVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:HDiffers
- OSV · DebianEcosystem advisory · calculated6.3MediumCVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:HDiffers
- NVDNIST6.3MediumCVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:HDiffers
EPSS trend
Probability
1.38%
Chance of exploitation in the next 30 days
Percentile
72%
Versus all other CVEs
30-day change
0.00 pp
From 1.38% on 18-09-2026
Known exploited
Compare KEV catalogsNot in any of the 3 tracked catalogs.
Public exploits
2 foundRust
Maturity: poc
Exploit Reference (blog.rust-lang.org)
Maturity: unknown
Weaknesses
CWE · root cause- CWE-363Race Condition Enabling Link FollowingThe 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.
- CWE-367Time-of-check Time-of-use (TOCTOU) Race ConditionThe 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.
Affected systems
Suse27 products
- libredwg&distro=SUSE Package Hub 15 SP3< 0.12.5-bp153.2.3.1
- rust1.55&distro=SUSE Linux Enterprise Module for Development Tools 15 SP3< 1.55.0-150300.7.6.1
- rust1.56&distro=SUSE Linux Enterprise Module for Development Tools 15 SP3< 1.56.1-150300.7.6.1
- rust1.57&distro=SUSE Linux Enterprise Module for Development Tools 15 SP3< 1.57.0-150300.7.7.1
- rust1.58&distro=SUSE Linux Enterprise Module for Development Tools 15 SP3< 1.58.0-150300.7.3.1
Redhat22 products
- cargo< 0:1.58.1-1.module+el8.6.0+14021+586eff1a
- cargo-debuginfo< 0:1.58.1-1.module+el8.6.0+14021+586eff1a
- cargo-doc< 0:1.58.1-1.module+el8.6.0+14021+586eff1a
- clippy< 0:1.58.1-1.module+el8.6.0+14021+586eff1a
- clippy-debuginfo< 0:1.58.1-1.module+el8.6.0+14021+586eff1a
Opensuse10 products
- libredwg&distro=openSUSE Leap 15.3< 0.12.5-bp153.2.3.1
- rust1.55&distro=openSUSE Leap 15.3< 1.55.0-150300.7.6.1
- rust1.56&distro=openSUSE Leap 15.3< 1.56.1-150300.7.6.1
- rust1.56&distro=openSUSE Tumbleweed< 1.56.1-4.1
- rust1.57&distro=openSUSE Leap 15.3< 1.57.0-150300.7.7.1
Debian1 product
- rustc< 1.57.0+dfsg1-1
Fedoraproject1 product
- fedoraEOL34 | 35
Mageia1 product
- rust< 1.57.0-1.1.mga8
Rust-lang1 product
- rust< 1.58.1 | ≥ 1.0.0, ≤ 1.58.0
Ubuntu1 product
- rustcAll versions (No fix recorded) | < 1.59.0+dfsg1~ubuntu1~llvm-1~ubuntu1~20.04.2
9 vendors · 69 products
References
45 links- github.com/rust-lang/rust/security/advisories/GHSA-r9cc-f5pr-p3j2ARTICLEREPORTExploitMitigationThird Party Advisory
- github.com/rust-lang/rust/pull/93110/commits/32ed6e599bb4722efefd78bbc9cd7ec4613cb946PatchThird Party Advisory
- github.com/rust-lang/rust/pull/93110/commits/406cc071d6cfdfdb678bf3d83d766851de95abafPatchThird Party Advisory
- github.com/rust-lang/rust/pull/93110/commits/4f0ad1c92ca08da6e8dc17838070975762f59714PatchThird Party Advisory
- lists.fedoraproject.org/archives/…Vendor Advisory
- lists.fedoraproject.org/archives/…Vendor Advisory
- lists.fedoraproject.org/archives/…Vendor Advisory
- lists.fedoraproject.org/archives/…Vendor Advisory
Show all 45 references
- support.apple.com/kb/HT213183Third Party Advisory
- support.apple.com/kb/HT213182Third Party Advisory
- support.apple.com/kb/HT213186Third Party Advisory
- support.apple.com/kb/HT213193Third Party Advisory
- lists.opensuse.org/archives/…Advisory
- github.com/rust-lang/…REPORT
- lists.opensuse.org/archives/…Advisory
- lists.opensuse.org/archives/…Advisory
- lists.opensuse.org/archives/…Advisory
- lists.opensuse.org/archives/…Advisory