Home/CVE/Rust is a multi-paradigm, general-purpose programming language designed for performance and safety, especially safe conc
CVE

CVE-2022-21658

Rust is a multi-paradigm, general-purpose programming language designed for performance and safety, especially safe conc

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.

HIGH · CVSS 7.3 EPSS 0.00906
Act now
  • Public exploit or PoC is available
  • CVSS base score ≥ 7.0
Sigma rules8 YARA rules0

Affected Products & Versions

7
rust-lang rust>= 1.0.0 and <= 1.58.0
apple macos>= 12.0.0 and < 12.3

Public Exploits & PoCs

2

Sigma Hunt Rules

8
Exact rules name this CVE ID. Product rules name an affected product in their title. Related rules cover techniques used by actors who exploited this CVE. Showing the most relevant matches; the complete related set is on the full drill-down.
producthighSuspicious Microsoft Office Child Process - MacOS
producthighRemote Access Tool - Renamed MeshAgent Execution - MacOS
producthighBinary Padding - MacOS
productmediumSuspicious Execution via macOS Script Editor
productmediumSystem Information Discovery Via Sysctl - MacOS
productmediumNew File Exclusion Added To Time Machine Via Tmutil - MacOS

Scoring & Timeline

7.3
HIGH · CVSS v3.1 · security-advisories@github.com
View on NVD
Attack Vector
Network Adjacent Local Physical
Attack Complexity
Low High
Privileges Required
None Low High
User Interaction
None Required
Scope
Unchanged Changed
Confidentiality
None Low High
Integrity
None Low High
Availability
None Low High
Published to NVD20 Jan 2022 · 06:15 PM
CVSS VectorCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:N/I:L/A:H
SSVC triage · cisa-vulnrichment
Exploitation
poc
Automatable
no
Technical impact
partial
SSVC asks the questions that actually drive patch urgency: is it being exploited, can attacks be automated, and how total is the impact.

Vendor Advisories

18
siemens-csafSSA-277137
suse-csafopenSUSE-SU-2024:11767-1
suse-csafopenSUSE-SU-2024:11768-1
suse-csafopenSUSE-SU-2024:11769-1
suse-csafopenSUSE-SU-2022:0843-1
Intelligence Graph · click any node to traverse
CVETechnique ActorTool Family
drag to reposition · click any node to traverse · button top-right enlarges
External lookups - second-class, for what we don’t hold ourselves
Vulnerabilities
CISA KEV catalog
CWE weaknesses
CAPEC attack patterns
Package vulnerabilities
Threat intelligence
Threat actors
Tools & malware
ATT&CK techniques
IOCs
Detection & defense
Sigma rules
YARA rules
Atomic Red Team tests
D3FEND countermeasures
Compliance
NIST 800-53
ISO 27001:2022
SOC 2 TSC
PCI-DSS v4.0
CIS Controls v8.1
About
All capabilities
Live statistics
Data sources
Privacy policy
Terms of service
threatengine.sh  ·  Open-source threat intelligence platform  ·  100+ authoritative sources  ·  Every fact traces to its origin