CVE-2022-21658

Source
https://nvd.nist.gov/vuln/detail/CVE-2022-21658
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-21658.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2022-21658
Aliases
  • GHSA-r9cc-f5pr-p3j2
Related
Published
2022-01-20T18:15:07Z
Modified
2024-09-18T03:27:14.641685Z
Severity
  • 6.3 (Medium) CVSS_V3 - CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:H CVSS Calculator
Summary
[none]
Details

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 removedirall will not mitigate the vulnerability, as they would also be vulnerable to race conditions like removedirall itself. The existing mitigation is working as intended outside of race conditions.

References

Affected packages

Debian:11 / rustc

Package

Name
rustc
Purl
pkg:deb/debian/rustc?arch=source

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected

Affected versions

1.*

1.48.0+dfsg1-2
1.49.0~beta.4+dfsg1-1~exp1
1.49.0+dfsg1-1~exp1
1.49.0+dfsg1-1
1.49.0+dfsg1-2
1.50.0+dfsg1-1~exp1
1.50.0+dfsg1-1~exp2
1.50.0+dfsg1-1~exp3
1.50.0+dfsg1-1~exp4
1.50.0+dfsg1-1
1.51.0+dfsg1-1~exp1
1.51.0+dfsg1-1~exp2
1.51.0+dfsg1-1~exp3
1.51.0+dfsg1-1
1.52.0~beta.3+dfsg1-1~exp1
1.52.0~beta.3+dfsg1-1~exp2
1.52.0~beta.3+dfsg1-1~exp3
1.52.0~beta.3+dfsg1-1~exp4
1.52.0+dfsg1-1~exp1
1.52.1+dfsg1-1~exp1
1.52.1+dfsg1-1~exp2
1.52.1+dfsg1-1~exp3
1.52.1+dfsg1-1
1.53.0+dfsg1-1~exp1
1.53.0+dfsg1-1
1.53.0+dfsg1-2
1.53.0+dfsg1-3
1.53.0+dfsg1-4
1.54.0+dfsg1-1~exp1
1.54.0+dfsg1-1
1.54.0+dfsg1-2
1.54.0+dfsg1-3
1.55.0+dfsg1-0
1.55.0+dfsg1-1~exp1
1.55.0+dfsg1-1
1.55.0+dfsg1-2
1.56.0~beta.4+dfsg1-1~exp1
1.56.0~beta.4+dfsg1-1~exp2
1.56.0+dfsg1-1
1.56.0+dfsg1-2
1.57.0+dfsg1-1~exp1
1.57.0+dfsg1-1
1.58.1+dfsg1-1~exp1
1.58.1+dfsg1-1
1.59.0+dfsg1-1~exp1
1.59.0+dfsg1-1
1.59.0+dfsg1-2
1.60.0+dfsg1-1~exp1
1.60.0+dfsg1-1
1.61.0+dfsg1-1~exp1
1.61.0+dfsg1-1
1.61.0+dfsg1-2
1.62.1+dfsg1-1~exp1
1.62.1+dfsg1-1
1.63.0+dfsg1-1~exp1
1.63.0+dfsg1-1
1.63.0+dfsg1-2
1.64.0+dfsg1-1~exp1
1.64.0+dfsg1-1~exp2
1.64.0+dfsg1-1~exp3
1.64.0+dfsg1-1~exp4
1.64.0+dfsg1-1
1.65.0+dfsg1-1~exp1
1.65.0+dfsg1-1~exp2
1.65.0+dfsg1-1~exp3
1.65.0+dfsg1-1
1.65.0+dfsg1-2
1.66.0+dfsg1-1~exp1
1.66.0+dfsg1-1
1.67.1+dfsg1-1~exp1
1.67.1+dfsg1-1
1.68.2+dfsg1-1~exp1
1.68.2+dfsg1-1
1.69.0+dfsg1-1~exp1
1.69.0+dfsg1-1~exp2
1.69.0+dfsg1-1
1.70.0+dfsg1-1~exp1
1.70.0+dfsg1-1~exp2
1.70.0+dfsg1-1~exp3
1.70.0+dfsg1-1
1.70.0+dfsg1-2~exp1
1.70.0+dfsg1-2
1.70.0+dfsg1-3
1.70.0+dfsg1-4
1.70.0+dfsg1-5
1.70.0+dfsg1-6
1.70.0+dfsg1-7
1.70.0+dfsg1-8
1.70.0+dfsg1-8.1
1.70.0+dfsg1-9
1.70.0+dfsg2-1~exp1
1.70.0+dfsg2-1~exp2
1.70.0+dfsg2-1~exp3
1.70.0+dfsg2-1
1.70.0+dfsg2-1+loong64
1.71.1+dfsg1-1~exp1
1.71.1+dfsg1-1~exp2
1.71.1+dfsg1-1
1.71.1+dfsg1-2
1.72.1+dfsg1-1~exp1
1.72.1+dfsg1-1~exp2
1.72.1+dfsg1-1
1.72.1+dfsg1-1+hurd.1
1.73.0+dfsg1-1~exp1
1.73.0+dfsg1-1
1.73.0+dfsg1-1+hurd.1
1.73.0+dfsg1-1+loong64
1.74.1+dfsg1-1~exp1
1.74.1+dfsg1-1
1.74.1+dfsg1-1+hurd.1
1.75.0+dfsg1-1~exp1
1.75.0+dfsg1-1
1.75.0+dfsg1-2
1.75.0+dfsg1-3
1.75.0+dfsg1-4
1.75.0+dfsg1-4+hurd.1
1.75.0+dfsg1-5
1.76.0+dfsg1-1~exp1
1.76.0+dfsg1-1
1.76.0+dfsg1-1+hurd.1
1.77.2+dfsg1-1~exp1
1.77.2+dfsg1-1
1.78.0+dfsg1-1~exp1
1.78.0+dfsg1-2
1.79.0+dfsg1-1~exp1
1.79.0+dfsg1-1
1.79.0+dfsg1-2
1.79.0+dfsg1-2+hurd.1
1.80.0+dfsg1-1~exp1
1.80.1+dfsg1-1~exp1
1.80.1+dfsg1-1
1.80.1+dfsg1-1+hurd.1
1.81.0+dfsg1-1~exp1

Ecosystem specific

{
    "urgency": "not yet assigned"
}

Debian:12 / rustc

Package

Name
rustc
Purl
pkg:deb/debian/rustc?arch=source

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
1.57.0+dfsg1-1

Ecosystem specific

{
    "urgency": "not yet assigned"
}

Debian:13 / rustc

Package

Name
rustc
Purl
pkg:deb/debian/rustc?arch=source

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
1.57.0+dfsg1-1

Ecosystem specific

{
    "urgency": "not yet assigned"
}