CVE-2022-21658
Fixed in a distro release EPSS 1%CVSS 7.3
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.
Products: rust-lang rust
Distro releases
| Release | Package | Fixed in |
|---|---|---|
| AlmaLinux:8 | cargo | 1.58.1-1.module_el8.6.0+2748+176088b3 |
| AlmaLinux:8 | cargo-doc | 1.58.1-1.module_el8.6.0+2748+176088b3 |
| AlmaLinux:8 | clippy | 1.58.1-1.module_el8.6.0+2748+176088b3 |
| AlmaLinux:8 | rls | 1.58.1-1.module_el8.6.0+2748+176088b3 |
| AlmaLinux:8 | rust | 1.58.1-1.module_el8.6.0+2748+176088b3 |
| AlmaLinux:8 | rust-analysis | 1.58.1-1.module_el8.6.0+2748+176088b3 |
| AlmaLinux:8 | rust-debugger-common | 1.58.1-1.module_el8.6.0+2748+176088b3 |
| AlmaLinux:8 | rust-doc | 1.58.1-1.module_el8.6.0+2748+176088b3 |
| AlmaLinux:8 | rust-gdb | 1.58.1-1.module_el8.6.0+2748+176088b3 |
| AlmaLinux:8 | rust-lldb | 1.58.1-1.module_el8.6.0+2748+176088b3 |
| AlmaLinux:8 | rust-src | 1.58.1-1.module_el8.6.0+2748+176088b3 |
| AlmaLinux:8 | rust-std-static | 1.58.1-1.module_el8.6.0+2748+176088b3 |
| AlmaLinux:8 | rust-std-static-wasm32-unknown-unknown | 1.58.1-1.module_el8.6.0+2748+176088b3 |
| AlmaLinux:8 | rust-std-static-wasm32-wasi | 1.58.1-1.module_el8.6.0+2748+176088b3 |
| AlmaLinux:8 | rust-toolset | 1.58.1-1.module_el8.6.0+2748+176088b3 |
| AlmaLinux:8 | rustfmt | 1.58.1-1.module_el8.6.0+2748+176088b3 |
| Debian:12 | rustc | 1.57.0+dfsg1-1 |
| Debian:13 | rustc | 1.57.0+dfsg1-1 |
| Debian:14 | rustc | 1.57.0+dfsg1-1 |
| Red Hat:enterprise_linux:8 | cargo | 0:1.58.1-1.module+el8.6.0+14021+586eff1a |
| Red Hat:enterprise_linux:8 | cargo-debuginfo | 0:1.58.1-1.module+el8.6.0+14021+586eff1a |
| Red Hat:enterprise_linux:8 | cargo-doc | 0:1.58.1-1.module+el8.6.0+14021+586eff1a |
| Red Hat:enterprise_linux:8 | clippy | 0:1.58.1-1.module+el8.6.0+14021+586eff1a |
| Red Hat:enterprise_linux:8 | clippy-debuginfo | 0:1.58.1-1.module+el8.6.0+14021+586eff1a |
| Red Hat:enterprise_linux:8 | rls | 0:1.58.1-1.module+el8.6.0+14021+586eff1a |
| Red Hat:enterprise_linux:8 | rls-debuginfo | 0:1.58.1-1.module+el8.6.0+14021+586eff1a |
| Red Hat:enterprise_linux:8 | rust | 0:1.58.1-1.module+el8.6.0+14021+586eff1a |
| Red Hat:enterprise_linux:8 | rust-analysis | 0:1.58.1-1.module+el8.6.0+14021+586eff1a |
| Red Hat:enterprise_linux:8 | rust-debugger-common | 0:1.58.1-1.module+el8.6.0+14021+586eff1a |
| Red Hat:enterprise_linux:8 | rust-debuginfo | 0:1.58.1-1.module+el8.6.0+14021+586eff1a |
| Red Hat:enterprise_linux:8 | rust-debugsource | 0:1.58.1-1.module+el8.6.0+14021+586eff1a |
| Red Hat:enterprise_linux:8 | rust-doc | 0:1.58.1-1.module+el8.6.0+14021+586eff1a |
| Red Hat:enterprise_linux:8 | rust-gdb | 0:1.58.1-1.module+el8.6.0+14021+586eff1a |
| Red Hat:enterprise_linux:8 | rust-lldb | 0:1.58.1-1.module+el8.6.0+14021+586eff1a |
| Red Hat:enterprise_linux:8 | rust-src | 0:1.58.1-1.module+el8.6.0+14021+586eff1a |
| Red Hat:enterprise_linux:8 | rust-std-static | 0:1.58.1-1.module+el8.6.0+14021+586eff1a |
| Red Hat:enterprise_linux:8 | rust-std-static-wasm32-unknown-unknown | 0:1.58.1-1.module+el8.6.0+14021+586eff1a |
| Red Hat:enterprise_linux:8 | rust-std-static-wasm32-wasi | 0:1.58.1-1.module+el8.6.0+14021+586eff1a |
| Red Hat:enterprise_linux:8 | rust-toolset | 0:1.58.1-1.module+el8.6.0+14021+586eff1a |
| Red Hat:enterprise_linux:8 | rustfmt | 0:1.58.1-1.module+el8.6.0+14021+586eff1a |
| Red Hat:enterprise_linux:8 | rustfmt-debuginfo | 0:1.58.1-1.module+el8.6.0+14021+586eff1a |
| Rocky Linux:8 | rust | 0:1.58.1-1.module+el8.6.0+826+60f85975 |
| Rocky Linux:8 | rust-toolset | 0:1.58.1-1.module+el8.6.0+826+60f85975 |
| SUSE:Enterprise Storage 6 | rust | 1.53.0-22.1 |
| SUSE:Enterprise Storage 7 | rust | 1.53.0-22.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP1-ESPOS | rust | 1.53.0-22.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS | rust | 1.53.0-22.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP2-ESPOS | rust | 1.53.0-22.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | rust | 1.53.0-22.1 |
| SUSE:Linux Enterprise High Performance Computing 15-ESPOS | rust | 1.53.0-3.40.1 |
| SUSE:Linux Enterprise High Performance Computing 15-LTSS | rust | 1.53.0-3.40.1 |
| SUSE:Linux Enterprise Module for Development Tools 15 SP3 | rust | 1.59.0-150300.21.20.1 |
| SUSE:Linux Enterprise Module for Development Tools 15 SP3 | rust1.55 | 1.55.0-150300.7.6.1 |
| SUSE:Linux Enterprise Module for Development Tools 15 SP3 | rust1.56 | 1.56.1-150300.7.6.1 |
| SUSE:Linux Enterprise Module for Development Tools 15 SP3 | rust1.57 | 1.57.0-150300.7.7.1 |
| SUSE:Linux Enterprise Module for Development Tools 15 SP3 | rust1.58 | 1.58.0-150300.7.3.1 |
| SUSE:Linux Enterprise Module for Development Tools 15 SP3 | rust1.59 | 1.59.0-150300.7.4.2 |
| SUSE:Linux Enterprise Real Time 15 SP2 | rust | 1.53.0-22.1 |
| SUSE:Linux Enterprise Server 15 SP1-BCL | rust | 1.53.0-22.1 |
| SUSE:Linux Enterprise Server 15 SP1-LTSS | rust | 1.53.0-22.1 |
| SUSE:Linux Enterprise Server 15 SP2-BCL | rust | 1.53.0-22.1 |
| SUSE:Linux Enterprise Server 15 SP2-LTSS | rust | 1.53.0-22.1 |
| SUSE:Linux Enterprise Server 15-LTSS | rust | 1.53.0-3.40.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 | rust | 1.53.0-3.40.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP1 | rust | 1.53.0-22.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP2 | rust | 1.53.0-22.1 |
| SUSE:Manager Proxy 4.1 | rust | 1.53.0-22.1 |
| SUSE:Manager Retail Branch Server 4.1 | rust | 1.53.0-22.1 |
| SUSE:Manager Server 4.1 | rust | 1.53.0-22.1 |
| SUSE:Package Hub 15 SP3 | libredwg | 0.12.5-bp153.2.3.1 |
| Ubuntu:20.04:LTS | rustc | 1.59.0+dfsg1~ubuntu1~llvm-1~ubuntu1~20.04.2 |
| Ubuntu:Pro:14.04:LTS | rustc | no fix |
| Ubuntu:Pro:16.04:LTS | rustc | no fix |
| openSUSE:Leap 15.3 | libredwg | 0.12.5-bp153.2.3.1 |
| openSUSE:Leap 15.3 | rust | 1.53.0-22.1 |
| openSUSE:Leap 15.3 | rust | 1.59.0-150300.21.20.1 |
| openSUSE:Leap 15.3 | rust1.55 | 1.55.0-150300.7.6.1 |
| openSUSE:Leap 15.3 | rust1.56 | 1.56.1-150300.7.6.1 |
| openSUSE:Leap 15.3 | rust1.57 | 1.57.0-150300.7.7.1 |
| openSUSE:Leap 15.3 | rust1.58 | 1.58.0-150300.7.3.1 |
| openSUSE:Leap 15.3 | rust1.59 | 1.59.0-150300.7.4.2 |
| openSUSE:Tumbleweed | rust1.56 | 1.56.1-4.1 |
| openSUSE:Tumbleweed | rust1.57 | 1.57.0-3.1 |
| openSUSE:Tumbleweed | rust1.58 | 1.58.0-2.1 |