CVE catalog

CVE-2022-21658

rustc: CVE-2022-21658

[CVE catalog]

Severity
High · CVSS 7.3CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:N/I:L/A:H
Published
Source
[NVD] · [CVE record]
EPSS
1.38% · Oct 25, 2026

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.

Vulnerable and fixed packages

Distribution-reported package versions and fixes. These do not depend on matching against the OpenFactory package catalog.

DistributionPackageReleaseVersionStatus
Debianrustcsid1.97.1+dfsg1-1fixed
Debianrustcforky1.97.1+dfsg1-1fixed
Debianrustctrixie1.85.1+dfsg1-1+deb13u1fixed
Debianrustcbookworm1.63.0+dfsg1-2fixed
Ubunturustcpro1.7.0+dfsg1-1vulnerable
Ubunturustcpro1.15.1+dfsg0-1~exp1ubuntu2~16.04.3vulnerable
Ubunturustcpro1.17.0+dfsg2-8~ubuntu0.16.04.2vulnerable
Ubunturustcpro1.21.0+dfsg1+llvm-0ubuntu3~16.04.1vulnerable
Ubunturustcpro1.22.1+dfsg1+llvm-0ubuntu2~16.04.2vulnerable
Ubunturustcpro1.24.1+dfsg1+llvm-0ubuntu1~16.04.1vulnerable
Ubunturustcpro1.25.0+dfsg1+llvm-0ubuntu1~16.04.1vulnerable
Ubunturustcpro1.28.0+dfsg1+llvm-0ubuntu1~16.04.1vulnerable
Ubunturustcpro1.30.0+dfsg1+llvm-2ubuntu1~16.04.1vulnerable
Ubunturustcpro1.31.0+dfsg1+llvm-2ubuntu1~16.04.1vulnerable
Ubunturustcpro1.32.0+dfsg1+llvm-1ubuntu1~16.04.1vulnerable
Ubunturustcpro1.34.1+dfsg2+llvm-0ubuntu1~16.04.1vulnerable
Ubunturustcpro1.35.0+dfsg0.1+llvm-0ubuntu1~16.04.1vulnerable
Ubunturustcpro1.36.0+dfsg1+llvm-2ubuntu1~16.04.1vulnerable
Ubunturustcpro1.37.0+dfsg1+llvm-1ubuntu1~16.04.1vulnerable
Ubunturustcpro1.39.0+dfsg1+llvm-3ubuntu1~16.04.1vulnerable
Ubunturustcpro1.41.0+dfsg1+llvm-0ubuntu1~16.04.1vulnerable
Ubunturustcpro1.43.0+dfsg1+llvm-1~exp1ubuntu2~16.04.1vulnerable
Ubunturustcpro1.47.0+dfsg1+llvm-1ubuntu1~16.04.1vulnerable
Ubunturustcpro1.47.0+dfsg1+llvm-1ubuntu1~16.04.1ubuntu2vulnerable
Ubunturustc20.041.37.0+dfsg1+llvm-1ubuntu1vulnerable
Ubunturustc20.041.38.0+dfsg0.2+llvm-0ubuntu1vulnerable
Ubunturustc20.041.38.0+dfsg0.2+llvm-0ubuntu2vulnerable
Ubunturustc20.041.39.0+dfsg1+llvm-3ubuntu1vulnerable
Ubunturustc20.041.40.0+dfsg1+llvm-5ubuntu1vulnerable
Ubunturustc20.041.41.0+dfsg1+llvm-0ubuntu1vulnerable
Ubunturustc20.041.41.0+dfsg1+llvm-0ubuntu2vulnerable
Ubunturustc20.041.43.0+dfsg1+llvm-1~exp1ubuntu1~20.04.1vulnerable
Ubunturustc20.041.47.0+dfsg1+llvm-1ubuntu1~20.04.1vulnerable
Ubunturustc20.041.51.0+dfsg1+llvm-1~exp3ubuntu1~20.04.2vulnerable
Ubunturustc20.041.53.0+dfsg1+llvm-4ubuntu1~20.04.1vulnerable
Ubunturustc20.041.57.0+dfsg1+llvm-0ubuntu1~20.04.1vulnerable
Ubunturustc20.041.59.0+dfsg1~ubuntu1~llvm-1~ubuntu1~20.04.2fixed
Opensuserust1.58tumbleweed1.58.0-2.1fixed
Suserust1.57linux enterprise module for development tools 15 sp31.57.0-150300.7.7.1fixed
Opensuserust1.57leap 15.31.57.0-150300.7.7.1fixed
Opensuserust1.56tumbleweed1.56.1-4.1fixed
Suserustlinux enterprise high performance computing 15-espos1.53.0-3.40.1fixed
Suserustlinux enterprise high performance computing 15-ltss1.53.0-3.40.1fixed
Suserustlinux enterprise server 15-ltss1.53.0-3.40.1fixed
Suserustlinux enterprise server for sap applications 151.53.0-3.40.1fixed
Opensuserust1.57tumbleweed1.57.0-3.1fixed
Suselibredwgpackage hub 15 sp30.12.5-bp153.2.3.1fixed
Opensuselibredwgleap 15.30.12.5-bp153.2.3.1fixed
Opensuserust1.56leap 15.31.56.1-150300.7.6.1fixed
Opensuserustleap 15.31.53.0-22.1fixed
Opensuserustleap 15.31.59.0-150300.21.20.1fixed
Opensuserust1.58leap 15.31.58.0-150300.7.3.1fixed
Opensuserust1.59leap 15.31.59.0-150300.7.4.2fixed
Suserustlinux enterprise module for development tools 15 sp31.59.0-150300.21.20.1fixed
Suserust1.58linux enterprise module for development tools 15 sp31.58.0-150300.7.3.1fixed
Suserust1.59linux enterprise module for development tools 15 sp31.59.0-150300.7.4.2fixed
Suserustlinux enterprise high performance computing 15 sp1-espos1.53.0-22.1fixed
Suserustlinux enterprise high performance computing 15 sp1-ltss1.53.0-22.1fixed
Suserustlinux enterprise high performance computing 15 sp2-espos1.53.0-22.1fixed
Suserustlinux enterprise high performance computing 15 sp2-ltss1.53.0-22.1fixed
Suserustlinux enterprise real time 15 sp21.53.0-22.1fixed
Suserustlinux enterprise server 15 sp1-bcl1.53.0-22.1fixed
Suserustlinux enterprise server 15 sp1-ltss1.53.0-22.1fixed
Suserustlinux enterprise server 15 sp2-bcl1.53.0-22.1fixed
Suserustlinux enterprise server 15 sp2-ltss1.53.0-22.1fixed
Suserustlinux enterprise server for sap applications 15 sp11.53.0-22.1fixed
Suserustlinux enterprise server for sap applications 15 sp21.53.0-22.1fixed
Suserustmanager proxy 4.11.53.0-22.1fixed
Suserustmanager retail branch server 4.11.53.0-22.1fixed
Suserustmanager server 4.11.53.0-22.1fixed
Suserustenterprise storage 61.53.0-22.1fixed
Suserustenterprise storage 71.53.0-22.1fixed
Suserust1.56linux enterprise module for development tools 15 sp31.56.1-150300.7.6.1fixed
Opensuserust1.55leap 15.31.55.0-150300.7.6.1fixed
Suserust1.55linux enterprise module for development tools 15 sp31.55.0-150300.7.6.1fixed

Fixed-version evidence

DistributionPackageTypeReleaseFixed versionUrgencyOriginBugs
Debianrustcsourcesid1.57.0+dfsg1-1not yet assignedNot reportedNot reported
Debianrustcsourceforky1.57.0+dfsg1-1not yet assignedNot reportedNot reported
Debianrustcsourcetrixie1.57.0+dfsg1-1not yet assignedNot reportedNot reported
Debianrustcsourcebookworm1.57.0+dfsg1-1not yet assignedNot reportedNot reported
Ubunturustcdeb20.041.59.0+dfsg1~ubuntu1~llvm-1~ubuntu1~20.04.2Not reportedUBUNTU-CVE-2022-21658Not reported
Opensuserust1.58rpmtumbleweed1.58.0-2.1Not reportedOPENSUSE-SU-2024:11769-1Not reported
Suserust1.57rpmlinux enterprise module for development tools 15 sp31.57.0-150300.7.7.1Not reportedSUSE-SU-2022:0175-1Not reported
Opensuserust1.57rpmleap 15.31.57.0-150300.7.7.1Not reportedOPENSUSE-SU-2022:0175-1Not reported
Opensuserust1.56rpmtumbleweed1.56.1-4.1Not reportedOPENSUSE-SU-2024:11767-1Not reported
Suserustrpmlinux enterprise high performance computing 15-espos1.53.0-3.40.1Not reportedSUSE-SU-2022:0200-1Not reported
Suserustrpmlinux enterprise high performance computing 15-ltss1.53.0-3.40.1Not reportedSUSE-SU-2022:0200-1Not reported
Suserustrpmlinux enterprise server 15-ltss1.53.0-3.40.1Not reportedSUSE-SU-2022:0200-1Not reported
Suserustrpmlinux enterprise server for sap applications 151.53.0-3.40.1Not reportedSUSE-SU-2022:0200-1Not reported
Opensuserust1.57rpmtumbleweed1.57.0-3.1Not reportedOPENSUSE-SU-2024:11768-1Not reported
Suselibredwgrpmpackage hub 15 sp30.12.5-bp153.2.3.1Not reportedOPENSUSE-SU-2022:0149-1Not reported
Opensuselibredwgrpmleap 15.30.12.5-bp153.2.3.1Not reportedOPENSUSE-SU-2022:0149-1Not reported
Opensuserust1.56rpmleap 15.31.56.1-150300.7.6.1Not reportedOPENSUSE-SU-2022:0149-1Not reported
Opensuserustrpmleap 15.31.53.0-22.1Not reportedOPENSUSE-SU-2022:0491-1Not reported
Opensuserustrpmleap 15.31.59.0-150300.21.20.1Not reportedOPENSUSE-SU-2022:0843-1Not reported
Opensuserust1.58rpmleap 15.31.58.0-150300.7.3.1Not reportedOPENSUSE-SU-2022:0843-1Not reported
Opensuserust1.59rpmleap 15.31.59.0-150300.7.4.2Not reportedOPENSUSE-SU-2022:0843-1Not reported
Suserustrpmlinux enterprise module for development tools 15 sp31.59.0-150300.21.20.1Not reportedSUSE-SU-2022:0843-1Not reported
Suserust1.58rpmlinux enterprise module for development tools 15 sp31.58.0-150300.7.3.1Not reportedSUSE-SU-2022:0843-1Not reported
Suserust1.59rpmlinux enterprise module for development tools 15 sp31.59.0-150300.7.4.2Not reportedSUSE-SU-2022:0843-1Not reported
Suserustrpmlinux enterprise high performance computing 15 sp1-espos1.53.0-22.1Not reportedSUSE-SU-2022:0491-1Not reported
Suserustrpmlinux enterprise high performance computing 15 sp1-ltss1.53.0-22.1Not reportedSUSE-SU-2022:0491-1Not reported
Suserustrpmlinux enterprise high performance computing 15 sp2-espos1.53.0-22.1Not reportedSUSE-SU-2022:0491-1Not reported
Suserustrpmlinux enterprise high performance computing 15 sp2-ltss1.53.0-22.1Not reportedSUSE-SU-2022:0491-1Not reported
Suserustrpmlinux enterprise real time 15 sp21.53.0-22.1Not reportedSUSE-SU-2022:0491-1Not reported
Suserustrpmlinux enterprise server 15 sp1-bcl1.53.0-22.1Not reportedSUSE-SU-2022:0491-1Not reported
Suserustrpmlinux enterprise server 15 sp1-ltss1.53.0-22.1Not reportedSUSE-SU-2022:0491-1Not reported
Suserustrpmlinux enterprise server 15 sp2-bcl1.53.0-22.1Not reportedSUSE-SU-2022:0491-1Not reported
Suserustrpmlinux enterprise server 15 sp2-ltss1.53.0-22.1Not reportedSUSE-SU-2022:0491-1Not reported
Suserustrpmlinux enterprise server for sap applications 15 sp11.53.0-22.1Not reportedSUSE-SU-2022:0491-1Not reported
Suserustrpmlinux enterprise server for sap applications 15 sp21.53.0-22.1Not reportedSUSE-SU-2022:0491-1Not reported
Suserustrpmmanager proxy 4.11.53.0-22.1Not reportedSUSE-SU-2022:0491-1Not reported
Suserustrpmmanager retail branch server 4.11.53.0-22.1Not reportedSUSE-SU-2022:0491-1Not reported
Suserustrpmmanager server 4.11.53.0-22.1Not reportedSUSE-SU-2022:0491-1Not reported
Suserustrpmenterprise storage 61.53.0-22.1Not reportedSUSE-SU-2022:0491-1Not reported
Suserustrpmenterprise storage 71.53.0-22.1Not reportedSUSE-SU-2022:0491-1Not reported
Suserust1.56rpmlinux enterprise module for development tools 15 sp31.56.1-150300.7.6.1Not reportedSUSE-SU-2022:0149-1Not reported
Opensuserust1.55rpmleap 15.31.55.0-150300.7.6.1Not reportedOPENSUSE-SU-2022:0171-1Not reported
Suserust1.55rpmlinux enterprise module for development tools 15 sp31.55.0-150300.7.6.1Not reportedSUSE-SU-2022:0171-1Not reported

OpenFactory catalog packages

[Debian 12 (Bookworm)]

  • Source package: [rustc]

    Details (2)
    • 1.63.0+dfsg1-2 · amd64 · bookworm

      Fixed · Fixed: 1.57.0+dfsg1-1

      dsa · rustc · debian · bookworm

    • 1.63.0+dfsg1-2 · arm64 · bookworm

      Fixed · Fixed: 1.57.0+dfsg1-1

      dsa · rustc · debian · bookworm

  • Source package: [rustc]

    Details (2)
    • 1.63.0+dfsg1-2 · amd64 · bookworm

      Fixed · Fixed: 1.57.0+dfsg1-1

      dsa · rustc · debian · bookworm

    • 1.63.0+dfsg1-2 · arm64 · bookworm

      Fixed · Fixed: 1.57.0+dfsg1-1

      dsa · rustc · debian · bookworm

  • Source package: [rustc]

    Details (2)
    • 1.63.0+dfsg1-2 · all · bookworm

      Fixed · Fixed: 1.57.0+dfsg1-1

      dsa · rustc · debian · bookworm

    • 1.63.0+dfsg1-2 · all · bookworm

      Fixed · Fixed: 1.57.0+dfsg1-1

      dsa · rustc · debian · bookworm

  • Source package: [rustc]

    Details (1)
    • 1.63.0+dfsg1-2 · amd64 · bookworm

      Fixed · Fixed: 1.57.0+dfsg1-1

      dsa · rustc · debian · bookworm

  • [rust-all]Fixed

    Source package: [rustc]

    Details (2)
    • 1.63.0+dfsg1-2 · all · bookworm

      Fixed · Fixed: 1.57.0+dfsg1-1

      dsa · rustc · debian · bookworm

    • 1.63.0+dfsg1-2 · all · bookworm

      Fixed · Fixed: 1.57.0+dfsg1-1

      dsa · rustc · debian · bookworm

  • [rustc]Fixed
    Details (2)
    • 1.63.0+dfsg1-2 · amd64 · bookworm

      Fixed · Fixed: 1.57.0+dfsg1-1

      dsa · rustc · debian · bookworm

    • 1.63.0+dfsg1-2 · arm64 · bookworm

      Fixed · Fixed: 1.57.0+dfsg1-1

      dsa · rustc · debian · bookworm

  • Source package: [rustc]

    Details (2)
    • 1.63.0+dfsg1-2 · amd64 · bookworm

      Fixed · Fixed: 1.57.0+dfsg1-1

      dsa · rustc · debian · bookworm

    • 1.63.0+dfsg1-2 · arm64 · bookworm

      Fixed · Fixed: 1.57.0+dfsg1-1

      dsa · rustc · debian · bookworm

  • [rust-doc]Fixed

    Source package: [rustc]

    Details (2)
    • 1.63.0+dfsg1-2 · all · bookworm

      Fixed · Fixed: 1.57.0+dfsg1-1

      dsa · rustc · debian · bookworm

    • 1.63.0+dfsg1-2 · all · bookworm

      Fixed · Fixed: 1.57.0+dfsg1-1

      dsa · rustc · debian · bookworm

  • [rustfmt]Fixed

    Source package: [rustc]

    Details (2)
    • 1.63.0+dfsg1-2 · amd64 · bookworm

      Fixed · Fixed: 1.57.0+dfsg1-1

      dsa · rustc · debian · bookworm

    • 1.63.0+dfsg1-2 · arm64 · bookworm

      Fixed · Fixed: 1.57.0+dfsg1-1

      dsa · rustc · debian · bookworm

  • [rust-gdb]Fixed

    Source package: [rustc]

    Details (2)
    • 1.63.0+dfsg1-2 · all · bookworm

      Fixed · Fixed: 1.57.0+dfsg1-1

      dsa · rustc · debian · bookworm

    • 1.63.0+dfsg1-2 · all · bookworm

      Fixed · Fixed: 1.57.0+dfsg1-1

      dsa · rustc · debian · bookworm

  • [rust-lldb]Fixed

    Source package: [rustc]

    Details (2)
    • 1.63.0+dfsg1-2 · all · bookworm

      Fixed · Fixed: 1.57.0+dfsg1-1

      dsa · rustc · debian · bookworm

    • 1.63.0+dfsg1-2 · all · bookworm

      Fixed · Fixed: 1.57.0+dfsg1-1

      dsa · rustc · debian · bookworm

  • [rust-src]Fixed

    Source package: [rustc]

    Details (2)
    • 1.63.0+dfsg1-2 · all · bookworm

      Fixed · Fixed: 1.57.0+dfsg1-1

      dsa · rustc · debian · bookworm

    • 1.63.0+dfsg1-2 · all · bookworm

      Fixed · Fixed: 1.57.0+dfsg1-1

      dsa · rustc · debian · bookworm

Observed:

References