CVE-2022-21658: Race condition in std::fs::remove_dir_all in rustlang
LLVM. A race condition was addressed with additional validation.
Other sources
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::removedirall 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 removedirall will not mitigate the vulnerability, as they would also be vulnerable to race conditions like removedirall itself. The existing mitigation is working as intended outside of race conditions.
Credit
Affected Software
Remediation
Patch Available
Event History
Parent advisories
This vulnerability appears in the following advisories.
Peer vulnerabilities
Found alongside the following vulnerabilities.
- CVE-2022-22633
- CVE-2022-22666
- CVE-2022-22634
- CVE-2022-22635
- CVE-2022-22636
- CVE-2022-22611
- CVE-2022-22612
- CVE-2022-22641
- CVE-2022-22613
- CVE-2022-22614
- CVE-2022-22615
- CVE-2022-22632
- CVE-2022-22638
- CVE-2022-22640
- CVE-2022-21658
- CVE-2022-22670
- CVE-2022-22609
- CVE-2022-22600
- CVE-2022-22621
- CVE-2022-22662
- CVE-2022-22610
- CVE-2022-22624
- CVE-2022-22628
- CVE-2022-22629
- CVE-2022-22637
- CVE-2022-22596
- CVE-2021-30946
- CVE-2021-36976
- CVE-2022-22618
- CVE-2022-22654
- CVE-2022-22599
- CVE-2022-22669
- CVE-2022-22665
- CVE-2022-22630
- CVE-2022-22631
- CVE-2022-22625
- CVE-2022-22648
- CVE-2022-22626
- CVE-2022-22627
- CVE-2022-22597
- CVE-2022-22616
- CVE-2022-22663
- CVE-2022-26691
- CVE-2021-22946
- CVE-2021-22947
- CVE-2021-22945
- CVE-2022-22643
- CVE-2022-22657
- CVE-2022-22664
- CVE-2021-30977
- CVE-2022-46706
- CVE-2022-22661
- CVE-2022-22647
- CVE-2022-22656
- CVE-2022-22672
- CVE-2022-22644
- CVE-2022-26690
- CVE-2022-26688
- CVE-2022-22617
- CVE-2022-22650
- CVE-2022-22655
- CVE-2022-22651
- CVE-2022-22639
- CVE-2022-22660
- CVE-2021-4136
- CVE-2021-4166
- CVE-2021-4173
- CVE-2021-4187
- CVE-2021-4192
- CVE-2021-4193
- CVE-2021-46059
- CVE-2022-0128
- CVE-2022-0156
- CVE-2022-0158
- CVE-2021-30918
- CVE-2022-22668
- CVE-2022-22582
- CVE-2022-22652
- CVE-2022-22598
- CVE-2022-22642
- CVE-2022-22667
- CVE-2022-22653
- CVE-2022-22622
- CVE-2022-22659
- CVE-2022-22671
Frequently Asked Questions
What is CVE-2022-21658?
CVE-2022-21658 is a vulnerability in LLVM that was addressed with additional validation.
Which software versions are affected by CVE-2022-21658?
CVE-2022-21658 affects macOS Monterey 12.3, watchOS up to 8.5, iOS up to 15.4, iPadOS up to 15.4, and tvOS up to 15.4.
How severe is CVE-2022-21658?
The severity of CVE-2022-21658 is not specified.
How can I fix CVE-2022-21658?
To fix CVE-2022-21658, update your software to the specified versions provided by Apple.
Where can I find more information about CVE-2022-21658?
More information about CVE-2022-21658 can be found on the following Apple support pages: [link1], [link2], [link3].