# CVE-2022-21658: cargo: Rust Toolset provides the Rust programming language compiler rustc, the cargo build tool and dependency manager, and...

CVE-2022-21658 is fixed in 20 products on 1 platform, first by DEBIAN-CVE-2022-21658, released January 20, 2022. It is not reported as exploited. Patch Radar priority: Routine.

- Web page: https://patchblox.com/security/cve/CVE-2022-21658
- Priority: Routine
- CVSS: 6.3 (Moderate)
- EPSS: 0.0138
- CISA KEV: not listed
- Exploited (vendor report): no
- Publicly disclosed: no
- Published: Jan 20, 2022

## Description

Rust Toolset provides the Rust programming language compiler rustc, the cargo build tool and dependency manager, and required libraries.   The following packages have been upgraded to a later upstream version: rust (1.58.0). (BZ#2002883)  Security Fix(es):  * rust: Race condition in remove_dir_all leading to removal of files outside of the directory being removed (CVE-2022-21658)  For more details about the security issue(s), including the impact, a CVSS score, acknowledgments, and other related information, refer to the CVE page(s) listed in the References section.  Additional Changes:  For detailed information on changes in this release, see the Red Hat Enterprise Linux 8.6 Release Notes linked from the References section.

## Where it's fixed

| Platform | Product | Fixed in | Fix | Released |
|---|---|---|---|---|
| Linux | cargo RHEL 8 | 0:1.58.1-1.module+el8.6.0+14021+586eff1a | [RHSA-2022:1894](https://patchblox.com/security/data/fix/linux/rhsa-2022-1894.md) | May 10, 2022 |
| Linux | cargo almalinux 8 | 1.58.1-1.module_el8.6.0+2748+176088b3 | [ALSA-2022:1894](https://patchblox.com/security/data/fix/linux/alsa-2022-1894.md) | May 10, 2022 |
| Linux | cargo ol 8 | 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 | [ELSA-2022-1894](https://patchblox.com/security/data/fix/linux/elsa-2022-1894.md) | May 17, 2022 |
| Linux | cargo-doc RHEL 8 | 0:1.58.1-1.module+el8.6.0+14021+586eff1a | [RHSA-2022:1894](https://patchblox.com/security/data/fix/linux/rhsa-2022-1894.md) | May 10, 2022 |
| Linux | cargo-doc almalinux 8 | 1.58.1-1.module_el8.6.0+2748+176088b3 | [ALSA-2022:1894](https://patchblox.com/security/data/fix/linux/alsa-2022-1894.md) | May 10, 2022 |
| Linux | cargo-doc ol 8 | 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 | [ELSA-2022-1894](https://patchblox.com/security/data/fix/linux/elsa-2022-1894.md) | May 17, 2022 |
| Linux | clippy RHEL 8 | 0:1.58.1-1.module+el8.6.0+14021+586eff1a | [RHSA-2022:1894](https://patchblox.com/security/data/fix/linux/rhsa-2022-1894.md) | May 10, 2022 |
| Linux | clippy almalinux 8 | 1.58.1-1.module_el8.6.0+2748+176088b3 | [ALSA-2022:1894](https://patchblox.com/security/data/fix/linux/alsa-2022-1894.md) | May 10, 2022 |
| Linux | clippy ol 8 | 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 | [ELSA-2022-1894](https://patchblox.com/security/data/fix/linux/elsa-2022-1894.md) | May 17, 2022 |
| Linux | libstd-rust-1.59 Ubuntu 20.04 LTS (focal) | 1.59.0+dfsg1~ubuntu1~llvm-1~ubuntu1~20.04.2 | [libstd-rust-1.59 1.59.0+dfsg1~ubuntu1~llvm-1~ubuntu1~20.04.2](https://patchblox.com/security/data/fix/linux/ubuntu-focal-libstd-rust-1.59-1.59.0-dfsg1-ubuntu1-llvm-1-ubuntu1-20.04.2.md) | Feb 15, 2022 |
| Linux | rls RHEL 8 | 0:1.58.1-1.module+el8.6.0+14021+586eff1a | [RHSA-2022:1894](https://patchblox.com/security/data/fix/linux/rhsa-2022-1894.md) | May 10, 2022 |
| Linux | rls almalinux 8 | 1.58.1-1.module_el8.6.0+2748+176088b3 | [ALSA-2022:1894](https://patchblox.com/security/data/fix/linux/alsa-2022-1894.md) | May 10, 2022 |
| Linux | rls ol 8 | 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 | [ELSA-2022-1894](https://patchblox.com/security/data/fix/linux/elsa-2022-1894.md) | May 17, 2022 |
| Linux | rust RHEL 8 | 0:1.58.1-1.module+el8.6.0+14021+586eff1a | [RHSA-2022:1894](https://patchblox.com/security/data/fix/linux/rhsa-2022-1894.md) | May 10, 2022 |
| Linux | rust almalinux 8 | 1.58.1-1.module_el8.6.0+2748+176088b3 | [ALSA-2022:1894](https://patchblox.com/security/data/fix/linux/alsa-2022-1894.md) | May 10, 2022 |
| Linux | rust ol 8 | 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 | [ELSA-2022-1894](https://patchblox.com/security/data/fix/linux/elsa-2022-1894.md) | May 17, 2022 |
| Linux | rust rocky 8 | 0:1.58.1-1.module+el8.6.0+826+60f85975 | [RLSA-2022:1894](https://patchblox.com/security/data/fix/linux/rlsa-2022-1894.md) | May 10, 2022 |
| Linux | rust-all Ubuntu 20.04 LTS (focal) | 1.59.0+dfsg1~ubuntu1~llvm-1~ubuntu1~20.04.2 | [rust-all 1.59.0+dfsg1~ubuntu1~llvm-1~ubuntu1~20.04.2](https://patchblox.com/security/data/fix/linux/ubuntu-focal-rust-all-1.59.0-dfsg1-ubuntu1-llvm-1-ubuntu1-20.04.2.md) | Feb 15, 2022 |
| Linux | rust-analysis RHEL 8 | 0:1.58.1-1.module+el8.6.0+14021+586eff1a | [RHSA-2022:1894](https://patchblox.com/security/data/fix/linux/rhsa-2022-1894.md) | May 10, 2022 |
| Linux | rust-analysis almalinux 8 | 1.58.1-1.module_el8.6.0+2748+176088b3 | [ALSA-2022:1894](https://patchblox.com/security/data/fix/linux/alsa-2022-1894.md) | May 10, 2022 |
| Linux | rust-analysis ol 8 | 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 | [ELSA-2022-1894](https://patchblox.com/security/data/fix/linux/elsa-2022-1894.md) | May 17, 2022 |
| Linux | rust-clippy Ubuntu 20.04 LTS (focal) | 1.59.0+dfsg1~ubuntu1~llvm-1~ubuntu1~20.04.2 | [rust-clippy 1.59.0+dfsg1~ubuntu1~llvm-1~ubuntu1~20.04.2](https://patchblox.com/security/data/fix/linux/ubuntu-focal-rust-clippy-1.59.0-dfsg1-ubuntu1-llvm-1-ubuntu1-20.04.2.md) | Feb 15, 2022 |
| Linux | rust-debugger-common RHEL 8 | 0:1.58.1-1.module+el8.6.0+14021+586eff1a | [RHSA-2022:1894](https://patchblox.com/security/data/fix/linux/rhsa-2022-1894.md) | May 10, 2022 |
| Linux | rust-debugger-common almalinux 8 | 1.58.1-1.module_el8.6.0+2748+176088b3 | [ALSA-2022:1894](https://patchblox.com/security/data/fix/linux/alsa-2022-1894.md) | May 10, 2022 |
| Linux | rust-debugger-common ol 8 | 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 | [ELSA-2022-1894](https://patchblox.com/security/data/fix/linux/elsa-2022-1894.md) | May 17, 2022 |
| Linux | rust-doc RHEL 8 | 0:1.58.1-1.module+el8.6.0+14021+586eff1a | [RHSA-2022:1894](https://patchblox.com/security/data/fix/linux/rhsa-2022-1894.md) | May 10, 2022 |
| Linux | rust-doc almalinux 8 | 1.58.1-1.module_el8.6.0+2748+176088b3 | [ALSA-2022:1894](https://patchblox.com/security/data/fix/linux/alsa-2022-1894.md) | May 10, 2022 |
| Linux | rust-doc ol 8 | 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 | [ELSA-2022-1894](https://patchblox.com/security/data/fix/linux/elsa-2022-1894.md) | May 17, 2022 |
| Linux | rust-gdb RHEL 8 | 0:1.58.1-1.module+el8.6.0+14021+586eff1a | [RHSA-2022:1894](https://patchblox.com/security/data/fix/linux/rhsa-2022-1894.md) | May 10, 2022 |
| Linux | rust-gdb Ubuntu 20.04 LTS (focal) | 1.59.0+dfsg1~ubuntu1~llvm-1~ubuntu1~20.04.2 | [rust-gdb 1.59.0+dfsg1~ubuntu1~llvm-1~ubuntu1~20.04.2](https://patchblox.com/security/data/fix/linux/ubuntu-focal-rust-gdb-1.59.0-dfsg1-ubuntu1-llvm-1-ubuntu1-20.04.2.md) | Feb 15, 2022 |
| Linux | rust-gdb almalinux 8 | 1.58.1-1.module_el8.6.0+2748+176088b3 | [ALSA-2022:1894](https://patchblox.com/security/data/fix/linux/alsa-2022-1894.md) | May 10, 2022 |
| Linux | rust-gdb ol 8 | 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 | [ELSA-2022-1894](https://patchblox.com/security/data/fix/linux/elsa-2022-1894.md) | May 17, 2022 |
| Linux | rust-lldb RHEL 8 | 0:1.58.1-1.module+el8.6.0+14021+586eff1a | [RHSA-2022:1894](https://patchblox.com/security/data/fix/linux/rhsa-2022-1894.md) | May 10, 2022 |
| Linux | rust-lldb Ubuntu 20.04 LTS (focal) | 1.59.0+dfsg1~ubuntu1~llvm-1~ubuntu1~20.04.2 | [rust-lldb 1.59.0+dfsg1~ubuntu1~llvm-1~ubuntu1~20.04.2](https://patchblox.com/security/data/fix/linux/ubuntu-focal-rust-lldb-1.59.0-dfsg1-ubuntu1-llvm-1-ubuntu1-20.04.2.md) | Feb 15, 2022 |
| Linux | rust-lldb almalinux 8 | 1.58.1-1.module_el8.6.0+2748+176088b3 | [ALSA-2022:1894](https://patchblox.com/security/data/fix/linux/alsa-2022-1894.md) | May 10, 2022 |
| Linux | rust-lldb ol 8 | 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 | [ELSA-2022-1894](https://patchblox.com/security/data/fix/linux/elsa-2022-1894.md) | May 17, 2022 |
| Linux | rust-src RHEL 8 | 0:1.58.1-1.module+el8.6.0+14021+586eff1a | [RHSA-2022:1894](https://patchblox.com/security/data/fix/linux/rhsa-2022-1894.md) | May 10, 2022 |
| Linux | rust-src Ubuntu 20.04 LTS (focal) | 1.59.0+dfsg1~ubuntu1~llvm-1~ubuntu1~20.04.2 | [rust-src 1.59.0+dfsg1~ubuntu1~llvm-1~ubuntu1~20.04.2](https://patchblox.com/security/data/fix/linux/ubuntu-focal-rust-src-1.59.0-dfsg1-ubuntu1-llvm-1-ubuntu1-20.04.2.md) | Feb 15, 2022 |
| Linux | rust-src almalinux 8 | 1.58.1-1.module_el8.6.0+2748+176088b3 | [ALSA-2022:1894](https://patchblox.com/security/data/fix/linux/alsa-2022-1894.md) | May 10, 2022 |
| Linux | rust-src ol 8 | 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 | [ELSA-2022-1894](https://patchblox.com/security/data/fix/linux/elsa-2022-1894.md) | May 17, 2022 |
| Linux | rust-std-static RHEL 8 | 0:1.58.1-1.module+el8.6.0+14021+586eff1a | [RHSA-2022:1894](https://patchblox.com/security/data/fix/linux/rhsa-2022-1894.md) | May 10, 2022 |
| Linux | rust-std-static almalinux 8 | 1.58.1-1.module_el8.6.0+2748+176088b3 | [ALSA-2022:1894](https://patchblox.com/security/data/fix/linux/alsa-2022-1894.md) | May 10, 2022 |
| Linux | rust-std-static ol 8 | 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 | [ELSA-2022-1894](https://patchblox.com/security/data/fix/linux/elsa-2022-1894.md) | May 17, 2022 |
| Linux | rust-std-static-wasm32-unknown-unknown RHEL 8 | 0:1.58.1-1.module+el8.6.0+14021+586eff1a | [RHSA-2022:1894](https://patchblox.com/security/data/fix/linux/rhsa-2022-1894.md) | May 10, 2022 |
| Linux | rust-std-static-wasm32-unknown-unknown almalinux 8 | 1.58.1-1.module_el8.6.0+2748+176088b3 | [ALSA-2022:1894](https://patchblox.com/security/data/fix/linux/alsa-2022-1894.md) | May 10, 2022 |
| Linux | rust-std-static-wasm32-unknown-unknown ol 8 | 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 | [ELSA-2022-1894](https://patchblox.com/security/data/fix/linux/elsa-2022-1894.md) | May 17, 2022 |
| Linux | rust-std-static-wasm32-wasi RHEL 8 | 0:1.58.1-1.module+el8.6.0+14021+586eff1a | [RHSA-2022:1894](https://patchblox.com/security/data/fix/linux/rhsa-2022-1894.md) | May 10, 2022 |
| Linux | rust-std-static-wasm32-wasi almalinux 8 | 1.58.1-1.module_el8.6.0+2748+176088b3 | [ALSA-2022:1894](https://patchblox.com/security/data/fix/linux/alsa-2022-1894.md) | May 10, 2022 |
| Linux | rust-std-static-wasm32-wasi ol 8 | 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 | [ELSA-2022-1894](https://patchblox.com/security/data/fix/linux/elsa-2022-1894.md) | May 17, 2022 |
| Linux | rust-toolset RHEL 8 | 0:1.58.1-1.module+el8.6.0+14021+586eff1a | [RHSA-2022:1894](https://patchblox.com/security/data/fix/linux/rhsa-2022-1894.md) | May 10, 2022 |
| Linux | rust-toolset almalinux 8 | 1.58.1-1.module_el8.6.0+2748+176088b3 | [ALSA-2022:1894](https://patchblox.com/security/data/fix/linux/alsa-2022-1894.md) | May 10, 2022 |
| Linux | rust-toolset ol 8 | 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 | [ELSA-2022-1894](https://patchblox.com/security/data/fix/linux/elsa-2022-1894.md) | May 17, 2022 |
| Linux | rust-toolset rocky 8 | 0:1.58.1-1.module+el8.6.0+826+60f85975 | [RLSA-2022:1894](https://patchblox.com/security/data/fix/linux/rlsa-2022-1894.md) | May 10, 2022 |
| Linux | rustc Debian 12.15 (bookworm) | 1.57.0+dfsg1-1 | [DEBIAN-CVE-2022-21658](https://patchblox.com/security/data/fix/linux/debian-cve-2022-21658.md) | Jan 20, 2022 |
| Linux | rustc Debian 13.5 (trixie) | 1.57.0+dfsg1-1 | [DEBIAN-CVE-2022-21658](https://patchblox.com/security/data/fix/linux/debian-cve-2022-21658.md) | Jan 20, 2022 |
| Linux | rustc Debian 14 | 1.57.0+dfsg1-1 | [DEBIAN-CVE-2022-21658](https://patchblox.com/security/data/fix/linux/debian-cve-2022-21658.md) | Jan 20, 2022 |
| Linux | rustc Ubuntu 20.04 LTS (focal) | 1.59.0+dfsg1~ubuntu1~llvm-1~ubuntu1~20.04.2 | [rustc 1.59.0+dfsg1~ubuntu1~llvm-1~ubuntu1~20.04.2](https://patchblox.com/security/data/fix/linux/ubuntu-focal-rustc-1.59.0-dfsg1-ubuntu1-llvm-1-ubuntu1-20.04.2.md) | Feb 15, 2022 |
| Linux | rustfmt RHEL 8 | 0:1.58.1-1.module+el8.6.0+14021+586eff1a | [RHSA-2022:1894](https://patchblox.com/security/data/fix/linux/rhsa-2022-1894.md) | May 10, 2022 |
| Linux | rustfmt Ubuntu 20.04 LTS (focal) | 1.59.0+dfsg1~ubuntu1~llvm-1~ubuntu1~20.04.2 | [rustfmt 1.59.0+dfsg1~ubuntu1~llvm-1~ubuntu1~20.04.2](https://patchblox.com/security/data/fix/linux/ubuntu-focal-rustfmt-1.59.0-dfsg1-ubuntu1-llvm-1-ubuntu1-20.04.2.md) | Feb 15, 2022 |
| Linux | rustfmt almalinux 8 | 1.58.1-1.module_el8.6.0+2748+176088b3 | [ALSA-2022:1894](https://patchblox.com/security/data/fix/linux/alsa-2022-1894.md) | May 10, 2022 |
| Linux | rustfmt ol 8 | 0:1.58.1-1.module+el8.6.0+20563+1eb4e043 | [ELSA-2022-1894](https://patchblox.com/security/data/fix/linux/elsa-2022-1894.md) | May 17, 2022 |

---

Data as of 2026-11-08T13:06:02Z UTC. Source: Patchblox Patch Radar (https://patchblox.com/security/patch-radar). Patchblox finds out-of-date software on Windows, macOS and Linux and updates it through release rings: https://patchblox.com/demo

Free to use with attribution: show "Data: Patchblox Patch Radar" with a link to https://patchblox.com/security/patch-radar. Terms, including what needs a written agreement: https://patchblox.com/security/patch-radar/use-the-data

Product names, logos and trademarks shown on Patch Radar belong to their respective owners. They are used only to identify the software each security fix applies to and to help readers find their platform. Their use does not imply any affiliation with, or endorsement by, those owners, and Patchblox is not affiliated with any of them.
