Description
Cargo downloads the Rust project’s dependencies and compiles the project. Cargo prior to version 0.72.2, bundled with Rust prior to version 1.71.1, did not respect the umask when extracting crate archives on UNIX-like systems. If the user downloaded a crate containing files writeable by any local user, another local user could exploit this to change the source code compiled and executed by the current user. To prevent existing cached extractions from being exploitable, the Cargo binary version 0.72.2 included in Rust 1.71.1 or later will purge caches generated by older Cargo versions automatically. As a workaround, configure one's system to prevent other local users from accessing the Cargo directory, usually located in `~/.cargo`.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| rust-lang | cargo | < 0.72.2 | — |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | rust-cargo | 0.76.0-1 | — |
| Debian 13 | rust-cargo | 0.76.0-1 | — |
| Debian 12 | cargo +1 | No fix yet | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 24.04 LTS | rust-cargo | No fix yet | — |
| Ubuntu 24.04 LTS | rustc | 1.71.1+dfsg0ubuntu2-0ubuntu1 | — |
Show 4 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu Pro 22.04 LTS | cargo | 0.67.1+ds0ubuntu0.libgit2-0ubuntu0.22.04.2+esm1 | USN-6275-1 |
| Ubuntu Pro 22.04 LTS | rust-cargo | 0.57.0-1ubuntu0.1~esm1 | USN-6275-1 |
| Ubuntu Pro 20.04 LTS | cargo | 0.67.1+ds0ubuntu0.libgit2-0ubuntu0.20.04.2+esm1 | USN-6275-1 |
| Ubuntu Pro 18.04 LTS | cargo | 0.66.0+ds0ubuntu0.libgit2-0ubuntu0.18.04.1~esm1 | USN-6275-1 |
| Ubuntu Pro 16.04 LTS | cargo | 0.47.0-1~exp1ubuntu1~16.04.1+esm1 | USN-6275-1 |
Red Hat
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| RHEL 9 | rust +14 | 1.66.1-2.el9_2 | RHSA-2023:4634 |
| RHEL 8 | rust +14 | 1.66.1-2.module+el8.8.0+19613+f0bba33b | RHSA-2023:4635 |
Show 3 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| RHEL 9.0 EUS | rls +14 | 1.58.1-1.el9_0.1 | RHSA-2024:3418 |
| RHEL 8.6 EUS | rls +14 | 1.58.1-1.module+el8.6.0+21522+a4bc17c1.1 | RHSA-2024:3428 |
| RHEL 8.6 EUS | rust-toolset | 1.58.1-1.module+el8.6.0+14021+586eff1a | RHSA-2024:3428 |
| Red Hat Devtools 2023 | rust-toolset-1.66-rust +11 | 1.66.1-2.el7_9 | RHSA-2023:4651 |
AlmaLinux
Errata ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| AlmaLinux 9 | rust +14 | 1.66.1-2.el9_2 | ALSA-2023:4634 |
| AlmaLinux 8 | rust +14 | 1.66.1-2.module_el8.8.0+3604+b9bee1fc | ALSA-2023:4635 |
Rocky Linux
Errata ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Rocky Linux 9 | rust | 1.66.1-2.el9_2 | RLSA-2023:4634 |
| Rocky Linux 8 | rust | 1.66.1-2.module+el8.8.0+1428+0690fcea | RLSA-2023:4635 |
SUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES 15 SP5 | rust1.71 | 1.71.1-150400.9.6.1 | SUSE-SU-2023:3251-1 |
| SLES 15 SP4 | rust1.71 | 1.71.1-150400.9.6.1 | SUSE-SU-2023:3251-1 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Tumbleweed | rust1.71 | 1.71.1-1.1 | openSUSE-SU-2024:13101-1 |
| openSUSE Leap 15.5 | rust1.71 | 1.71.1-150400.9.6.1 | SUSE-SU-2023:3251-1 |
| openSUSE Leap 15.4 | rust1.71 | 1.71.1-150400.9.6.1 | SUSE-SU-2023:3251-1 |
Alpine
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine v3.24 | rust +1 | 1.71.1-r0 | — |
| Alpine v3.23 | rust | 1.71.1-r0 | — |
| Alpine v3.22 | rust | 1.71.1-r0 | — |
| Alpine v3.21 | rust | 1.71.1-r0 | — |
| Alpine v3.20 | rust | 1.71.1-r0 | — |
Show 2 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine v3.19 | rust | 1.71.1-r0 | — |
| Alpine v3.18 | rust | 1.71.1-r0 | — |
Amazon Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Amazon Linux 2023 | rust +13 | 1.68.2-1.amzn2023.0.2 | ALAS2023-2023-323 |
| Amazon Linux 2 | rust +11 | 1.68.2-1.amzn2.0.3 | ALAS2-2023-2223 |
Azure Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Azure Linux 2 (CBL-Mariner) | rust | 1.72.0-2 | — |
Oracle Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Oracle Linux 9 | rust +14 | 1.66.1-2.el9_2 | ELSA-2023-4634 |
| Oracle Linux 8 | rust +14 | 1.66.1-2.module+el8.8.0+21152+49720d82 | ELSA-2023-4635 |
Public exploits
Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.
GitHub 1 repository
-
lucas-cauhe/cargo-perm ★ 1 · Aug 4, 2023
Cargo exploit from CVE-2023-38497
Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| crates.io | cargo | < 0.72.2 | 0.72.2 | GHSA-j3xp-wfr4-hx87 |
Advisories 17
- ALSA-2023:4634 Important: rust security update AlmaLinux Security Advisories · Oct 29, 2026
- ALSA-2023:4635 Important: rust-toolset:rhel8 security update AlmaLinux Security Advisories · Oct 29, 2026
- RHSA-2023:4651 Red Hat Security Advisory: rust-toolset-1.66-rust security update Red Hat Security Advisories (RHSA) · Jun 26, 2026
- USN-6275-1 cargo, rust-cargo vulnerability Ubuntu Security Notices (USN) · Jun 25, 2026
- RHSA-2024:3428 Red Hat Security Advisory: rust-toolset:rhel8 security update Red Hat Security Advisories (RHSA) · Mar 18, 2026
- RHSA-2024:3418 Red Hat Security Advisory: rust security update Red Hat Security Advisories (RHSA) · Mar 18, 2026
- RHSA-2023:4634 Red Hat Security Advisory: rust security update Red Hat Security Advisories (RHSA) · Feb 26, 2026
- RHSA-2023:4635 Red Hat Security Advisory: rust-toolset:rhel8 security update Red Hat Security Advisories (RHSA) · Feb 26, 2026
- RLSA-2023:4635 Important: rust-toolset:rhel8 security update Rocky Linux Security Advisories · Feb 5, 2026
- RLSA-2023:4634 Important: rust security update Rocky Linux Security Advisories · Feb 4, 2026
- openSUSE-SU-2024:13101-1 cargo1.71-1.71.1-1.1 on GA media SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2023:3251-1 Security update for rust1.71 SUSE / openSUSE Security Updates · Feb 4, 2026
- WID-SEC-2023-2062 Red Hat Enterprise Linux (Rust): Schwachstelle ermöglicht Ausführen von beliebigem Programmcode mit den Rechten des Dienstes BSI CERT-Bund (WID) · Sep 22, 2024
- ALAS2023-2023-323 Important: rust security update (Amazon Linux 2023) Amazon Linux Security Center (ALAS) · Sep 7, 2023
- ALAS2-2023-2223 Important: rust security update (Amazon Linux 2) Amazon Linux Security Center (ALAS) · Sep 7, 2023
- ELSA-2023-4635 Important: rust-toolset:ol8 security update (Oracle Linux 8) Oracle Linux Security Advisories (ELSA) · Aug 28, 2023
- ELSA-2023-4634 Important: rust security update (Oracle Linux 9) Oracle Linux Security Advisories (ELSA) · Aug 25, 2023
References
- https://github.com/rust-lang/cargo/security/advisories/GHSA-j3xp-wfr4-hx87
- https://github.com/rust-lang/cargo/pull/12443
- https://github.com/rust-lang/cargo/commit/d78bbf4bde3c6b95caca7512f537c6f9721426ff
- https://en.wikipedia.org/wiki/Umask
- https://github.com/rust-lang/wg-security-response/tree/main/patches/CVE-2023-38497
- https://www.rust-lang.org/policies/security
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/QGKE6PGM4HIQUHPJRBQAHMELINSGN4H4/
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/QMEXGUGPW5OBSQA6URTBNDSU3RAEFOZ4/