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.

INFO

Published Date :

Jan. 20, 2022, 6:15 p.m.

Last Modified :

Nov. 7, 2023, 3:43 a.m.

Remotely Exploitable :

No

Impact Score :

4.7

Exploitability Score :

2.0
Public PoC/Exploit Available at Github

CVE-2022-21658 has a 12 public PoC/Exploit available at Github. Go to the Public Exploits tab to see the list.

Affected Products

The following products are affected by CVE-2022-21658 vulnerability. Even if cvefeed.io is aware of the exact versions of the products that are affected, the information is not represented in the table below.

ID Vendor Product Action
1 Apple macos
2 Apple iphone_os
3 Apple tvos
4 Apple watchos
5 Apple ipados
1 Fedoraproject fedora
1 Rust-lang rust
References to Advisories, Solutions, and Tools

Here, you will find a curated list of external links that provide in-depth information, practical solutions, and valuable tools related to CVE-2022-21658.

URL Resource
https://blog.rust-lang.org/2022/01/20/cve-2022-21658.html Exploit Mitigation Vendor Advisory
https://github.com/rust-lang/rust/pull/93110 Patch Third Party Advisory
https://github.com/rust-lang/rust/pull/93110/commits/32ed6e599bb4722efefd78bbc9cd7ec4613cb946 Patch Third Party Advisory
https://github.com/rust-lang/rust/pull/93110/commits/406cc071d6cfdfdb678bf3d83d766851de95abaf Patch Third Party Advisory
https://github.com/rust-lang/rust/pull/93110/commits/4f0ad1c92ca08da6e8dc17838070975762f59714 Patch Third Party Advisory
https://github.com/rust-lang/rust/security/advisories/GHSA-r9cc-f5pr-p3j2 Exploit Mitigation Third Party Advisory
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/7JKZDTBMGAWIFJSNWKBMPO5EAKRR4BEW/
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/BK32QZLHDC2OVLPKTUHNT2G3VHWHD4LX/
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/C63NH72Q7UHJM5V3IVYRI7LVBGGFQMSQ/
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/CKGTACKMKAPRDPWPTU26GYWBELIRFF5N/
https://security.gentoo.org/glsa/202210-09 Third Party Advisory
https://support.apple.com/kb/HT213182 Third Party Advisory
https://support.apple.com/kb/HT213183 Third Party Advisory
https://support.apple.com/kb/HT213186 Third Party Advisory
https://support.apple.com/kb/HT213193 Third Party Advisory

We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).

All CVE - PoC in GitHub

poc proofofconcept tester allcve cvegithub cvenew cvepoc cveupdate

Updated: 3 weeks, 3 days ago
5 stars 2 fork 2 watcher
Born at : March 22, 2024, 3:58 p.m. This repo has been linked 928 different CVEs too.

None

Updated: 6 months, 1 week ago
1 stars 0 fork 0 watcher
Born at : March 11, 2024, 1:21 p.m. This repo has been linked 930 different CVEs too.

None

Updated: 1 year, 5 months ago
0 stars 2 fork 2 watcher
Born at : April 8, 2023, 6:19 a.m. This repo has been linked 923 different CVEs too.

None

Updated: 7 months, 1 week ago
20 stars 3 fork 3 watcher
Born at : Feb. 14, 2023, 6:10 p.m. This repo has been linked 921 different CVEs too.

None

Updated: 7 months ago
2 stars 2 fork 2 watcher
Born at : Nov. 25, 2022, 5:43 p.m. This repo has been linked 930 different CVEs too.

None

Updated: 2 months, 3 weeks ago
8 stars 1 fork 1 watcher
Born at : June 21, 2022, 7:45 a.m. This repo has been linked 943 different CVEs too.

A simple programm, inteneded to replace "rm" and "rmdir" by combining their features in single executable.

rust-lang cargo rustc cli rust windows-cli linux-cli wsl2 wsl-ubuntu ubuntu ubuntu2004

Updated: 2 years ago
1 stars 0 fork 0 watcher
Born at : Feb. 6, 2022, 9:51 a.m. This repo has been linked 1 different CVEs too.

POC for cve-2022-21658

rust cve-2022-21658 poc

Rust

Updated: 11 months, 2 weeks ago
2 stars 1 fork 1 watcher
Born at : Jan. 21, 2022, 6:09 a.m. This repo has been linked 1 different CVEs too.

test 反向辣鸡数据投放 CVE-2022-23305 工具 利用 教程 Exploit POC

cve-2020-

Updated: 1 year, 10 months ago
5 stars 2 fork 2 watcher
Born at : Jan. 21, 2022, 5:07 a.m. This repo has been linked 2608 different CVEs too.

本项目用于搜集 2022 年的漏洞,注意:本项目并不刻意搜集 POC 或 EXP,主要以CVE-2021、CVE-2022 为关键词,包含但不限于漏洞资讯、漏洞复现、漏洞分析、漏洞验证、漏洞利用

Updated: 1 month ago
380 stars 53 fork 53 watcher
Born at : Jan. 15, 2022, 12:31 a.m. This repo has been linked 53 different CVEs too.

Customizable subcommands to build your Wasm projects using xtask.

Rust

Updated: 1 week, 6 days ago
49 stars 8 fork 8 watcher
Born at : Oct. 6, 2021, 2:40 p.m. This repo has been linked 1 different CVEs too.

Rust语言安全相关分析

rust rust-sec rust-security fuzz rust-crate

Rust

Updated: 4 months, 4 weeks ago
23 stars 2 fork 2 watcher
Born at : Oct. 31, 2018, 5:44 a.m. This repo has been linked 17 different CVEs too.

Results are limited to the first 15 repositories due to potential performance issues.

The following list is the news that have been mention CVE-2022-21658 vulnerability anywhere in the article.

The following table lists the changes that have been made to the CVE-2022-21658 vulnerability over time.

Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.

  • CVE Modified by [email protected]

    May. 14, 2024

    Action Type Old Value New Value
  • CVE Modified by [email protected]

    Nov. 07, 2023

    Action Type Old Value New Value
    Added Reference GitHub, Inc. https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/BK32QZLHDC2OVLPKTUHNT2G3VHWHD4LX/ [No types assigned]
    Added Reference GitHub, Inc. https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/C63NH72Q7UHJM5V3IVYRI7LVBGGFQMSQ/ [No types assigned]
    Added Reference GitHub, Inc. https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/CKGTACKMKAPRDPWPTU26GYWBELIRFF5N/ [No types assigned]
    Added Reference GitHub, Inc. https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/7JKZDTBMGAWIFJSNWKBMPO5EAKRR4BEW/ [No types assigned]
    Removed Reference GitHub, Inc. https://lists.fedoraproject.org/archives/list/[email protected]/message/BK32QZLHDC2OVLPKTUHNT2G3VHWHD4LX/
    Removed Reference GitHub, Inc. https://lists.fedoraproject.org/archives/list/[email protected]/message/C63NH72Q7UHJM5V3IVYRI7LVBGGFQMSQ/
    Removed Reference GitHub, Inc. https://lists.fedoraproject.org/archives/list/[email protected]/message/CKGTACKMKAPRDPWPTU26GYWBELIRFF5N/
    Removed Reference GitHub, Inc. https://lists.fedoraproject.org/archives/list/[email protected]/message/7JKZDTBMGAWIFJSNWKBMPO5EAKRR4BEW/
  • Modified Analysis by [email protected]

    Oct. 19, 2022

    Action Type Old Value New Value
    Changed Reference Type https://security.gentoo.org/glsa/202210-09 No Types Assigned https://security.gentoo.org/glsa/202210-09 Third Party Advisory
    Changed Reference Type https://support.apple.com/kb/HT213182 No Types Assigned https://support.apple.com/kb/HT213182 Third Party Advisory
    Changed Reference Type https://support.apple.com/kb/HT213183 No Types Assigned https://support.apple.com/kb/HT213183 Third Party Advisory
    Changed Reference Type https://support.apple.com/kb/HT213186 No Types Assigned https://support.apple.com/kb/HT213186 Third Party Advisory
    Changed Reference Type https://support.apple.com/kb/HT213193 No Types Assigned https://support.apple.com/kb/HT213193 Third Party Advisory
    Added CPE Configuration OR *cpe:2.3:o:apple:ipados:*:*:*:*:*:*:*:* versions up to (excluding) 15.4 *cpe:2.3:o:apple:iphone_os:*:*:*:*:*:*:*:* versions up to (excluding) 15.4 *cpe:2.3:o:apple:macos:*:*:*:*:*:*:*:* versions from (including) 12.0.0 up to (excluding) 12.3 *cpe:2.3:o:apple:tvos:*:*:*:*:*:*:*:* versions up to (excluding) 15.4 *cpe:2.3:o:apple:watchos:*:*:*:*:*:*:*:* versions up to (excluding) 8.5
  • CVE Modified by [email protected]

    Oct. 16, 2022

    Action Type Old Value New Value
    Added Reference https://security.gentoo.org/glsa/202210-09 [No Types Assigned]
  • CVE Modified by [email protected]

    May. 26, 2022

    Action Type Old Value New Value
    Added Reference https://support.apple.com/kb/HT213183 [No Types Assigned]
    Added Reference https://support.apple.com/kb/HT213182 [No Types Assigned]
    Added Reference https://support.apple.com/kb/HT213193 [No Types Assigned]
    Added Reference https://support.apple.com/kb/HT213186 [No Types Assigned]
  • Modified Analysis by [email protected]

    Mar. 25, 2022

    Action Type Old Value New Value
    Changed Reference Type https://lists.fedoraproject.org/archives/list/[email protected]/message/7JKZDTBMGAWIFJSNWKBMPO5EAKRR4BEW/ No Types Assigned https://lists.fedoraproject.org/archives/list/[email protected]/message/7JKZDTBMGAWIFJSNWKBMPO5EAKRR4BEW/ Mailing List, Third Party Advisory
    Changed Reference Type https://lists.fedoraproject.org/archives/list/[email protected]/message/CKGTACKMKAPRDPWPTU26GYWBELIRFF5N/ No Types Assigned https://lists.fedoraproject.org/archives/list/[email protected]/message/CKGTACKMKAPRDPWPTU26GYWBELIRFF5N/ Mailing List, Third Party Advisory
  • CVE Modified by [email protected]

    Feb. 14, 2022

    Action Type Old Value New Value
    Added Reference https://lists.fedoraproject.org/archives/list/[email protected]/message/7JKZDTBMGAWIFJSNWKBMPO5EAKRR4BEW/ [No Types Assigned]
  • CVE Modified by [email protected]

    Feb. 09, 2022

    Action Type Old Value New Value
    Added Reference https://lists.fedoraproject.org/archives/list/[email protected]/message/CKGTACKMKAPRDPWPTU26GYWBELIRFF5N/ [No Types Assigned]
  • Initial Analysis by [email protected]

    Jan. 31, 2022

    Action Type Old Value New Value
    Added CVSS V2 NIST (AV:L/AC:M/Au:N/C:N/I:P/A:P)
    Added CVSS V3.1 NIST AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:H
    Changed Reference Type https://blog.rust-lang.org/2022/01/20/cve-2022-21658.html No Types Assigned https://blog.rust-lang.org/2022/01/20/cve-2022-21658.html Exploit, Mitigation, Vendor Advisory
    Changed Reference Type https://github.com/rust-lang/rust/pull/93110 No Types Assigned https://github.com/rust-lang/rust/pull/93110 Patch, Third Party Advisory
    Changed Reference Type https://github.com/rust-lang/rust/pull/93110/commits/32ed6e599bb4722efefd78bbc9cd7ec4613cb946 No Types Assigned https://github.com/rust-lang/rust/pull/93110/commits/32ed6e599bb4722efefd78bbc9cd7ec4613cb946 Patch, Third Party Advisory
    Changed Reference Type https://github.com/rust-lang/rust/pull/93110/commits/406cc071d6cfdfdb678bf3d83d766851de95abaf No Types Assigned https://github.com/rust-lang/rust/pull/93110/commits/406cc071d6cfdfdb678bf3d83d766851de95abaf Patch, Third Party Advisory
    Changed Reference Type https://github.com/rust-lang/rust/pull/93110/commits/4f0ad1c92ca08da6e8dc17838070975762f59714 No Types Assigned https://github.com/rust-lang/rust/pull/93110/commits/4f0ad1c92ca08da6e8dc17838070975762f59714 Patch, Third Party Advisory
    Changed Reference Type https://github.com/rust-lang/rust/security/advisories/GHSA-r9cc-f5pr-p3j2 No Types Assigned https://github.com/rust-lang/rust/security/advisories/GHSA-r9cc-f5pr-p3j2 Exploit, Mitigation, Third Party Advisory
    Changed Reference Type https://lists.fedoraproject.org/archives/list/[email protected]/message/BK32QZLHDC2OVLPKTUHNT2G3VHWHD4LX/ No Types Assigned https://lists.fedoraproject.org/archives/list/[email protected]/message/BK32QZLHDC2OVLPKTUHNT2G3VHWHD4LX/ Mailing List, Third Party Advisory
    Changed Reference Type https://lists.fedoraproject.org/archives/list/[email protected]/message/C63NH72Q7UHJM5V3IVYRI7LVBGGFQMSQ/ No Types Assigned https://lists.fedoraproject.org/archives/list/[email protected]/message/C63NH72Q7UHJM5V3IVYRI7LVBGGFQMSQ/ Mailing List, Third Party Advisory
    Added CWE NIST CWE-367
    Added CPE Configuration OR *cpe:2.3:a:rust-lang:rust:*:*:*:*:*:*:*:* versions from (including) 1.0.0 up to (including) 1.58.0
    Added CPE Configuration OR *cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:* *cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:*
  • CVE Modified by [email protected]

    Jan. 25, 2022

    Action Type Old Value New Value
    Added Reference https://lists.fedoraproject.org/archives/list/[email protected]/message/BK32QZLHDC2OVLPKTUHNT2G3VHWHD4LX/ [No Types Assigned]
    Added Reference https://lists.fedoraproject.org/archives/list/[email protected]/message/C63NH72Q7UHJM5V3IVYRI7LVBGGFQMSQ/ [No Types Assigned]
EPSS is a daily estimate of the probability of exploitation activity being observed over the next 30 days. Following chart shows the EPSS score history of the vulnerability.
CWE - Common Weakness Enumeration

While CVE identifies specific instances of vulnerabilities, CWE categorizes the common flaws or weaknesses that can lead to vulnerabilities. CVE-2022-21658 is associated with the following CWEs:

Common Attack Pattern Enumeration and Classification (CAPEC)

Common Attack Pattern Enumeration and Classification (CAPEC) stores attack patterns, which are descriptions of the common attributes and approaches employed by adversaries to exploit the CVE-2022-21658 weaknesses.

Exploit Prediction

EPSS is a daily estimate of the probability of exploitation activity being observed over the next 30 days.

0.09 }} 0.02%

score

0.36981

percentile

CVSS31 - Vulnerability Scoring System
Attack Vector
Attack Complexity
Privileges Required
User Interaction
Scope
Confidentiality
Integrity
Availability