CVE-2023-38497Cargo not respecting umask when extracting crate archives
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`.
What to do
Fixed builds are available from AlmaLinux, Alpine, Debian, Red Hat, Rocky Linux, Ubuntu, crates.io: see the table below for the fixed version per release.
Debian, Ubuntu have not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.04 | rust-cargo | Not affected vulnerable_code_not_present | ||
| Ubuntu 25.10 | rust-cargo | Not affected vulnerable_code_not_present | ||
| Ubuntu 24.04 | rust-cargo | Fix pending | UBUNTU-CVE-2023-38497 | |
| Ubuntu 24.04 | rustc | Fixed | 1.71.1+dfsg0ubuntu2-0ubuntu1 | UBUNTU-CVE-2023-38497 |
| Ubuntu 22.04 | cargo | Fix pending | 0.67.1+ds0ubuntu0.libgit2-0ubuntu0.22.04.2+esm1 (Ubuntu Pro) | UBUNTU-CVE-2023-38497 |
| Ubuntu 22.04 | rust-cargo | Fix pending | 0.57.0-1ubuntu0.1~esm1 (Ubuntu Pro) | UBUNTU-CVE-2023-38497 |
| Ubuntu 22.04 | rustc | Not affected vulnerable_code_not_present | ||
| Ubuntu 20.04 | cargo | Fix pending | 0.67.1+ds0ubuntu0.libgit2-0ubuntu0.20.04.2+esm1 (Ubuntu Pro) | UBUNTU-CVE-2023-38497 |
| Ubuntu 18.04 | cargo | Fix pending | 0.66.0+ds0ubuntu0.libgit2-0ubuntu0.18.04.1~esm1 (Ubuntu Pro) | UBUNTU-CVE-2023-38497 |
| Ubuntu 16.04 | cargo | Fix pending | 0.47.0-1~exp1ubuntu1~16.04.1+esm1 (Ubuntu Pro) | UBUNTU-CVE-2023-38497 |
| Ubuntu 16.04 | rustc | Fix pending | ||
| Ubuntu 14.04 | cargo | Fix pending | ||
| Ubuntu 14.04 | rustc | Fix pending | ||
| Debian 14 | rust-cargo | Fixed | 0.76.0-1 | DEBIAN-CVE-2023-38497 |
| Debian 13 | rust-cargo | Fixed | 0.76.0-1 | DEBIAN-CVE-2023-38497 |
| Debian 12 | cargo | Fix pending | DEBIAN-CVE-2023-38497 | |
| Debian 12 | rust-cargo | Fix pending | DEBIAN-CVE-2023-38497 | |
| Red Hat Enterprise Linux 9 | cargo | Fixed | 0:1.66.1-2.el9_2 | RHSA-2023:4634 |
| Red Hat Enterprise Linux 9 | clippy | Fixed | 0:1.66.1-2.el9_2 | RHSA-2023:4634 |
| Red Hat Enterprise Linux 9 | rust | Fixed | 0:1.66.1-2.el9_2 | RHSA-2023:4634 |
| Red Hat Enterprise Linux 9 | rust-analysis | Fixed | 0:1.66.1-2.el9_2 | RHSA-2023:4634 |
| Red Hat Enterprise Linux 9 | rust-analyzer | Fixed | 0:1.66.1-2.el9_2 | RHSA-2023:4634 |
| Red Hat Enterprise Linux 9 | rust-debugger-common | Fixed | 0:1.66.1-2.el9_2 | RHSA-2023:4634 |
| Red Hat Enterprise Linux 9 | rust-doc | Fixed | 0:1.66.1-2.el9_2 | RHSA-2023:4634 |
| Red Hat Enterprise Linux 9 | rust-gdb | Fixed | 0:1.66.1-2.el9_2 | RHSA-2023:4634 |
| Red Hat Enterprise Linux 9 | rust-lldb | Fixed | 0:1.66.1-2.el9_2 | RHSA-2023:4634 |
| Red Hat Enterprise Linux 9 | rust-src | Fixed | 0:1.66.1-2.el9_2 | RHSA-2023:4634 |
| Red Hat Enterprise Linux 9 | rust-std-static | Fixed | 0:1.66.1-2.el9_2 | RHSA-2023:4634 |
| Red Hat Enterprise Linux 9 | rust-std-static-wasm32-unknown-unknown | Fixed | 0:1.66.1-2.el9_2 | RHSA-2023:4634 |
| Red Hat Enterprise Linux 9 | rust-std-static-wasm32-wasi | Fixed | 0:1.66.1-2.el9_2 | RHSA-2023:4634 |
| Red Hat Enterprise Linux 9 | rust-toolset | Fixed | 0:1.66.1-2.el9_2 | RHSA-2023:4634 |
| Red Hat Enterprise Linux 9 | rustfmt | Fixed | 0:1.66.1-2.el9_2 | RHSA-2023:4634 |
| Red Hat Enterprise Linux 8 | cargo | Fixed | 0:1.66.1-2.module+el8.8.0+19613+f0bba33b | RHSA-2023:4635 |
| Red Hat Enterprise Linux 8 | clippy | Fixed | 0:1.66.1-2.module+el8.8.0+19613+f0bba33b | RHSA-2023:4635 |
| Red Hat Enterprise Linux 8 | rust | Fixed | 0:1.66.1-2.module+el8.8.0+19613+f0bba33b | RHSA-2023:4635 |
| Red Hat Enterprise Linux 8 | rust-analysis | Fixed | 0:1.66.1-2.module+el8.8.0+19613+f0bba33b | RHSA-2023:4635 |
| Red Hat Enterprise Linux 8 | rust-analyzer | Fixed | 0:1.66.1-2.module+el8.8.0+19613+f0bba33b | RHSA-2023:4635 |
| Red Hat Enterprise Linux 8 | rust-debugger-common | Fixed | 0:1.66.1-2.module+el8.8.0+19613+f0bba33b | RHSA-2023:4635 |
| Red Hat Enterprise Linux 8 | rust-doc | Fixed | 0:1.66.1-2.module+el8.8.0+19613+f0bba33b | RHSA-2023:4635 |
| Red Hat Enterprise Linux 8 | rust-gdb | Fixed | 0:1.66.1-2.module+el8.8.0+19613+f0bba33b | RHSA-2023:4635 |
| Red Hat Enterprise Linux 8 | rust-lldb | Fixed | 0:1.66.1-2.module+el8.8.0+19613+f0bba33b | RHSA-2023:4635 |
| Red Hat Enterprise Linux 8 | rust-src | Fixed | 0:1.66.1-2.module+el8.8.0+19613+f0bba33b | RHSA-2023:4635 |
| Red Hat Enterprise Linux 8 | rust-std-static | Fixed | 0:1.66.1-2.module+el8.8.0+19613+f0bba33b | RHSA-2023:4635 |
| Red Hat Enterprise Linux 8 | rust-std-static-wasm32-unknown-unknown | Fixed | 0:1.66.1-2.module+el8.8.0+19613+f0bba33b | RHSA-2023:4635 |
| Red Hat Enterprise Linux 8 | rust-std-static-wasm32-wasi | Fixed | 0:1.66.1-2.module+el8.8.0+19613+f0bba33b | RHSA-2023:4635 |
| Red Hat Enterprise Linux 8 | rust-toolset | Fixed | 0:1.66.1-2.module+el8.8.0+19613+f0bba33b | RHSA-2023:4635 |
| Red Hat Enterprise Linux 8 | rustfmt | Fixed | 0:1.66.1-2.module+el8.8.0+19613+f0bba33b | RHSA-2023:4635 |
| AlmaLinux 9 | cargo | Fixed | 1.66.1-2.el9_2 | ALSA-2023:4634 |
| AlmaLinux 9 | clippy | Fixed | 1.66.1-2.el9_2 | ALSA-2023:4634 |
| AlmaLinux 9 | rust | Fixed | 1.66.1-2.el9_2 | ALSA-2023:4634 |
| AlmaLinux 9 | rust-analysis | Fixed | 1.66.1-2.el9_2 | ALSA-2023:4634 |
| AlmaLinux 9 | rust-analyzer | Fixed | 1.66.1-2.el9_2 | ALSA-2023:4634 |
| AlmaLinux 9 | rust-debugger-common | Fixed | 1.66.1-2.el9_2 | ALSA-2023:4634 |
| AlmaLinux 9 | rust-doc | Fixed | 1.66.1-2.el9_2 | ALSA-2023:4634 |
| AlmaLinux 9 | rust-gdb | Fixed | 1.66.1-2.el9_2 | ALSA-2023:4634 |
| AlmaLinux 9 | rust-lldb | Fixed | 1.66.1-2.el9_2 | ALSA-2023:4634 |
| AlmaLinux 9 | rust-src | Fixed | 1.66.1-2.el9_2 | ALSA-2023:4634 |
| AlmaLinux 9 | rust-std-static | Fixed | 1.66.1-2.el9_2 | ALSA-2023:4634 |
| AlmaLinux 9 | rust-std-static-wasm32-unknown-unknown | Fixed | 1.66.1-2.el9_2 | ALSA-2023:4634 |
| AlmaLinux 9 | rust-std-static-wasm32-wasi | Fixed | 1.66.1-2.el9_2 | ALSA-2023:4634 |
| AlmaLinux 9 | rust-toolset | Fixed | 1.66.1-2.el9_2 | ALSA-2023:4634 |
| AlmaLinux 9 | rustfmt | Fixed | 1.66.1-2.el9_2 | ALSA-2023:4634 |
| AlmaLinux 8 | cargo | Fixed | 1.66.1-2.module_el8.8.0+3604+b9bee1fc | ALSA-2023:4635 |
| AlmaLinux 8 | clippy | Fixed | 1.66.1-2.module_el8.8.0+3604+b9bee1fc | ALSA-2023:4635 |
| AlmaLinux 8 | rust | Fixed | 1.66.1-2.module_el8.8.0+3604+b9bee1fc | ALSA-2023:4635 |
| AlmaLinux 8 | rust-analysis | Fixed | 1.66.1-2.module_el8.8.0+3604+b9bee1fc | ALSA-2023:4635 |
| AlmaLinux 8 | rust-analyzer | Fixed | 1.66.1-2.module_el8.8.0+3604+b9bee1fc | ALSA-2023:4635 |
| AlmaLinux 8 | rust-debugger-common | Fixed | 1.66.1-2.module_el8.8.0+3604+b9bee1fc | ALSA-2023:4635 |
| AlmaLinux 8 | rust-doc | Fixed | 1.66.1-2.module_el8.8.0+3604+b9bee1fc | ALSA-2023:4635 |
| AlmaLinux 8 | rust-gdb | Fixed | 1.66.1-2.module_el8.8.0+3604+b9bee1fc | ALSA-2023:4635 |
| AlmaLinux 8 | rust-lldb | Fixed | 1.66.1-2.module_el8.8.0+3604+b9bee1fc | ALSA-2023:4635 |
| AlmaLinux 8 | rust-src | Fixed | 1.66.1-2.module_el8.8.0+3604+b9bee1fc | ALSA-2023:4635 |
| AlmaLinux 8 | rust-std-static | Fixed | 1.66.1-2.module_el8.8.0+3604+b9bee1fc | ALSA-2023:4635 |
| AlmaLinux 8 | rust-std-static-wasm32-unknown-unknown | Fixed | 1.66.1-2.module_el8.8.0+3604+b9bee1fc | ALSA-2023:4635 |
| AlmaLinux 8 | rust-std-static-wasm32-wasi | Fixed | 1.66.1-2.module_el8.8.0+3604+b9bee1fc | ALSA-2023:4635 |
| AlmaLinux 8 | rust-toolset | Fixed | 1.66.1-2.module_el8.8.0+3604+b9bee1fc | ALSA-2023:4635 |
| AlmaLinux 8 | rustfmt | Fixed | 1.66.1-2.module_el8.8.0+3604+b9bee1fc | ALSA-2023:4635 |
| Rocky Linux 9 | rust | Fixed | 0:1.66.1-2.el9_2 | RLSA-2023:4634 |
| Rocky Linux 8 | rust | Fixed | 0:1.66.1-2.module+el8.8.0+1428+0690fcea | RLSA-2023:4635 |
| Alpine Linux 3.24 | chromium-rust | Fixed | 1.71.1-r0 | ALPINE-CVE-2023-38497 |
| Alpine Linux 3.24 | rust | Fixed | 1.71.1-r0 | ALPINE-CVE-2023-38497 |
| Alpine Linux 3.23 | rust | Fixed | 1.71.1-r0 | ALPINE-CVE-2023-38497 |
| Alpine Linux 3.22 | rust | Fixed | 1.71.1-r0 | ALPINE-CVE-2023-38497 |
| Alpine Linux 3.21 | rust | Fixed | 1.71.1-r0 | ALPINE-CVE-2023-38497 |
| Alpine Linux 3.20 | rust | Fixed | 1.71.1-r0 | ALPINE-CVE-2023-38497 |
| Alpine Linux 3.19 | rust | Fixed | 1.71.1-r0 | ALPINE-CVE-2023-38497 |
| Alpine Linux 3.18 | rust | Fixed | 1.71.1-r0 | ALPINE-CVE-2023-38497 |
| crates.io library | cargo | Fixed | 0.72.2 | GHSA-j3xp-wfr4-hx87 |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- rust-lang cargo: affected: < 0.72.2
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/
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.