CVE-2022-21658
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.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Affected products
55- osv-coords53 versionspkg:rpm/almalinux/cargopkg:rpm/almalinux/cargo-docpkg:rpm/almalinux/clippypkg:rpm/almalinux/rlspkg:rpm/almalinux/rustpkg:rpm/almalinux/rust-analysispkg:rpm/almalinux/rust-debugger-commonpkg:rpm/almalinux/rust-docpkg:rpm/almalinux/rustfmtpkg:rpm/almalinux/rust-gdbpkg:rpm/almalinux/rust-lldbpkg:rpm/almalinux/rust-srcpkg:rpm/almalinux/rust-std-staticpkg:rpm/almalinux/rust-std-static-wasm32-unknown-unknownpkg:rpm/almalinux/rust-std-static-wasm32-wasipkg:rpm/almalinux/rust-toolsetpkg:rpm/opensuse/libredwg&distro=openSUSE%20Leap%2015.3pkg:rpm/opensuse/rust1.55&distro=openSUSE%20Leap%2015.3pkg:rpm/opensuse/rust1.56&distro=openSUSE%20Leap%2015.3pkg:rpm/opensuse/rust1.56&distro=openSUSE%20Tumbleweedpkg:rpm/opensuse/rust1.57&distro=openSUSE%20Leap%2015.3pkg:rpm/opensuse/rust1.57&distro=openSUSE%20Tumbleweedpkg:rpm/opensuse/rust1.58&distro=openSUSE%20Leap%2015.3pkg:rpm/opensuse/rust1.58&distro=openSUSE%20Tumbleweedpkg:rpm/opensuse/rust1.59&distro=openSUSE%20Leap%2015.3pkg:rpm/opensuse/rust&distro=openSUSE%20Leap%2015.3pkg:rpm/suse/libredwg&distro=SUSE%20Package%20Hub%2015%20SP3pkg:rpm/suse/rust1.55&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Development%20Tools%2015%20SP3pkg:rpm/suse/rust1.56&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Development%20Tools%2015%20SP3pkg:rpm/suse/rust1.57&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Development%20Tools%2015%20SP3pkg:rpm/suse/rust1.58&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Development%20Tools%2015%20SP3pkg:rpm/suse/rust1.59&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Development%20Tools%2015%20SP3pkg:rpm/suse/rust&distro=SUSE%20Enterprise%20Storage%206pkg:rpm/suse/rust&distro=SUSE%20Enterprise%20Storage%207pkg:rpm/suse/rust&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP1-ESPOSpkg:rpm/suse/rust&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP1-LTSSpkg:rpm/suse/rust&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP2-ESPOSpkg:rpm/suse/rust&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP2-LTSSpkg:rpm/suse/rust&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015-ESPOSpkg:rpm/suse/rust&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015-LTSSpkg:rpm/suse/rust&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Development%20Tools%2015%20SP3pkg:rpm/suse/rust&distro=SUSE%20Linux%20Enterprise%20Real%20Time%2015%20SP2pkg:rpm/suse/rust&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP1-BCLpkg:rpm/suse/rust&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP1-LTSSpkg:rpm/suse/rust&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP2-BCLpkg:rpm/suse/rust&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP2-LTSSpkg:rpm/suse/rust&distro=SUSE%20Linux%20Enterprise%20Server%2015-LTSSpkg:rpm/suse/rust&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015pkg:rpm/suse/rust&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015%20SP1pkg:rpm/suse/rust&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015%20SP2pkg:rpm/suse/rust&distro=SUSE%20Manager%20Proxy%204.1pkg:rpm/suse/rust&distro=SUSE%20Manager%20Retail%20Branch%20Server%204.1pkg:rpm/suse/rust&distro=SUSE%20Manager%20Server%204.1
< 1.58.1-1.module_el8.6.0+2748+176088b3+ 52 more
- (no CPE)range: < 1.58.1-1.module_el8.6.0+2748+176088b3
- (no CPE)range: < 1.58.1-1.module_el8.6.0+2748+176088b3
- (no CPE)range: < 1.58.1-1.module_el8.6.0+2748+176088b3
- (no CPE)range: < 1.58.1-1.module_el8.6.0+2748+176088b3
- (no CPE)range: < 1.58.1-1.module_el8.6.0+2748+176088b3
- (no CPE)range: < 1.58.1-1.module_el8.6.0+2748+176088b3
- (no CPE)range: < 1.58.1-1.module_el8.6.0+2748+176088b3
- (no CPE)range: < 1.58.1-1.module_el8.6.0+2748+176088b3
- (no CPE)range: < 1.58.1-1.module_el8.6.0+2748+176088b3
- (no CPE)range: < 1.58.1-1.module_el8.6.0+2748+176088b3
- (no CPE)range: < 1.58.1-1.module_el8.6.0+2748+176088b3
- (no CPE)range: < 1.58.1-1.module_el8.6.0+2748+176088b3
- (no CPE)range: < 1.58.1-1.module_el8.6.0+2748+176088b3
- (no CPE)range: < 1.58.1-1.module_el8.6.0+2748+176088b3
- (no CPE)range: < 1.58.1-1.module_el8.6.0+2748+176088b3
- (no CPE)range: < 1.58.1-1.module_el8.6.0+2748+176088b3
- (no CPE)range: < 0.12.5-bp153.2.3.1
- (no CPE)range: < 1.55.0-150300.7.6.1
- (no CPE)range: < 1.56.1-150300.7.6.1
- (no CPE)range: < 1.56.1-4.1
- (no CPE)range: < 1.57.0-150300.7.7.1
- (no CPE)range: < 1.57.0-3.1
- (no CPE)range: < 1.58.0-150300.7.3.1
- (no CPE)range: < 1.58.0-2.1
- (no CPE)range: < 1.59.0-150300.7.4.2
- (no CPE)range: < 1.53.0-22.1
- (no CPE)range: < 0.12.5-bp153.2.3.1
- (no CPE)range: < 1.55.0-150300.7.6.1
- (no CPE)range: < 1.56.1-150300.7.6.1
- (no CPE)range: < 1.57.0-150300.7.7.1
- (no CPE)range: < 1.58.0-150300.7.3.1
- (no CPE)range: < 1.59.0-150300.7.4.2
- (no CPE)range: < 1.53.0-22.1
- (no CPE)range: < 1.53.0-22.1
- (no CPE)range: < 1.53.0-22.1
- (no CPE)range: < 1.53.0-22.1
- (no CPE)range: < 1.53.0-22.1
- (no CPE)range: < 1.53.0-22.1
- (no CPE)range: < 1.53.0-3.40.1
- (no CPE)range: < 1.53.0-3.40.1
- (no CPE)range: < 1.59.0-150300.21.20.1
- (no CPE)range: < 1.53.0-22.1
- (no CPE)range: < 1.53.0-22.1
- (no CPE)range: < 1.53.0-22.1
- (no CPE)range: < 1.53.0-22.1
- (no CPE)range: < 1.53.0-22.1
- (no CPE)range: < 1.53.0-3.40.1
- (no CPE)range: < 1.53.0-3.40.1
- (no CPE)range: < 1.53.0-22.1
- (no CPE)range: < 1.53.0-22.1
- (no CPE)range: < 1.53.0-22.1
- (no CPE)range: < 1.53.0-22.1
- (no CPE)range: < 1.53.0-22.1
Patches
Vulnerability mechanics
References
15- github.com/rust-lang/rust/pull/93110nvdPatchThird Party Advisory
- github.com/rust-lang/rust/pull/93110/commits/32ed6e599bb4722efefd78bbc9cd7ec4613cb946nvdPatchThird Party Advisory
- github.com/rust-lang/rust/pull/93110/commits/406cc071d6cfdfdb678bf3d83d766851de95abafnvdPatchThird Party Advisory
- github.com/rust-lang/rust/pull/93110/commits/4f0ad1c92ca08da6e8dc17838070975762f59714nvdPatchThird Party Advisory
- blog.rust-lang.org/2022/01/20/cve-2022-21658.htmlnvdExploitMitigationVendor Advisory
- github.com/rust-lang/rust/security/advisories/GHSA-r9cc-f5pr-p3j2nvdExploitMitigationThird Party Advisory
- security.gentoo.org/glsa/202210-09nvdThird Party Advisory
- support.apple.com/kb/HT213182nvdThird Party Advisory
- support.apple.com/kb/HT213183nvdThird Party Advisory
- support.apple.com/kb/HT213186nvdThird Party Advisory
- support.apple.com/kb/HT213193nvdThird Party Advisory
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/7JKZDTBMGAWIFJSNWKBMPO5EAKRR4BEW/nvd
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/BK32QZLHDC2OVLPKTUHNT2G3VHWHD4LX/nvd
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/C63NH72Q7UHJM5V3IVYRI7LVBGGFQMSQ/nvd
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/CKGTACKMKAPRDPWPTU26GYWBELIRFF5N/nvd
News mentions
0No linked articles in our index yet.