> CVE-2022-21658 [HIGH]

« BACK_TO_HOME
PUBLISHED
2022-01-20 18:15
MODIFIED
2024-11-21 06:45
CVSS_SCORE V3
7.3
EPSS (Prob. Exploit)
1.38%
Top 27.8%
DATA SOURCES:
NVD 🔗 2025-10-18 CVE PROJECT 🔗 2026-01-19 FIRST EPSS 🔗 2026-11-08 OSV 🔗 2026-11-15

> 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.

> AFFECTED_PRODUCTS

Apple - macOS
>= 12.0.0 < 12.3
Fedoraproject - Fedora
Version: 34
Fedoraproject - Fedora
Version: 35
Apple - Iphone Os
< 15.4
Apple - Tvos
< 15.4
Apple - Watchos
< 8.5
Apple - Ipados
< 15.4
Rust-Lang - Rust
>= 1.0.0 <= 1.58.0

> CVSS V3 METRICS

CVSS_VECTOR
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:N/I:L/A:H

> MÉTRIQUES CVSS DÉTAILLÉES

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:N/I:L/A:H
Métrique Valeur Interprétation
AV (Vecteur d'Attaque)
Attack Vector
Local (L)
Exploit nécessite un accès local au système
AC (Complexité d'Attaque)
Attack Complexity
Low (L)
Peu de conditions requises pour exploiter
PR (Privilèges Requis)
Privileges Required
Low (L)
Authentifié avec compte utilisateur basique
UI (Interaction Utilisateur)
User Interaction
None (N)
Aucune interaction utilisateur nécessaire
S (Périmètre)
Scope
Changed (C)
Impact s'étend au-delà du composant compromis
C (Impact Confidentialité)
Confidentiality Impact
None (N)
Aucune divulgation d'informations
I (Impact Intégrité)
Integrity Impact
Low (L)
Modification limitée des données possible
A (Impact Disponibilité)
Availability Impact
High (H)
Interruption totale du service possible

> RÉSUMÉ DES IMPACTS

Confidentialité
None
Aucune divulgation d'informations
Intégrité
Low
Modification limitée des données possible
Disponibilité
High
Interruption totale du service possible

> OSV (GOOGLE OPEN SOURCE VULNERABILITIES)

Race condition in std::fs::remove_dir_all in rustlang

AFFECTED PACKAGES:
Unknown / Unknown
ALIASES:
GHSA-r9cc-f5pr-p3j2

> HISTORIQUE DES MODIFICATIONS

Première apparition
20/01/2022 18:15
Source: NVD
📊 ENRICHISSEMENT 18/10/2025 14:32
CVEPROJECT
Champ modifié: CVE Project
Ancienne valeur:
Non
Nouvelle valeur:
Oui
Total des modifications: 1 Dernière mise à jour: 1 year ago
« BACK_TO_HOME