CVE-2023-38497 json
Cargo not respecting umask when extracting crate archives
published 2023-08-03 3 y ago modified 2026-06-17 4 mo ago also GHSA-j3xp-wfr4-hx87 , EUVD-2023-2308
- cvss
- 7.9
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.7%
- EPSS 0.7% chance of exploitation in 30 days, percentile 53%
- public exploits
- 0
- none known
Summary
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`.
Patch / fix
- crates.io cargo 0.72.2
- rust-lang cargo 0.72.2
- rust-cargo Debian 14, Debian 13 0.76.0-1
debian advisories DEBIAN-CVE-2023-38497
- rustc Ubuntu 24.04 LTS 1.71.1+dfsg0ubuntu2-0ubuntu1
- cargo Ubuntu Pro 16.04 LTS 0.47.0-1~exp1ubuntu1~16.04.1+esm1
- cargo Ubuntu Pro 18.04 LTS 0.66.0+ds0ubuntu0.libgit2-0ubuntu0.18.04.1~esm1
- cargo Ubuntu Pro 20.04 LTS 0.67.1+ds0ubuntu0.libgit2-0ubuntu0.20.04.2+esm1
- cargo Ubuntu Pro 22.04 LTS 0.67.1+ds0ubuntu0.libgit2-0ubuntu0.22.04.2+esm1
- rust-cargo Ubuntu Pro 22.04 LTS 0.57.0-1ubuntu0.1~esm1
ubuntu advisories UBUNTU-CVE-2023-38497
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- rust-toolset-1.66-rust devtools 2023 1.66.1-2.el7_9
- rust-toolset-1.66-cargo devtools 2023 1.66.1-2.el7_9
- rust-toolset-1.66-clippy devtools 2023 1.66.1-2.el7_9
- rust-toolset-1.66-rustfmt devtools 2023 1.66.1-2.el7_9
- rust-toolset-1.66-rust-gdb devtools 2023 1.66.1-2.el7_9
- rust-toolset-1.66-rust-src devtools 2023 1.66.1-2.el7_9
- rust-toolset-1.66-rust-lldb devtools 2023 1.66.1-2.el7_9
- rust-toolset-1.66-rust-analysis devtools 2023 1.66.1-2.el7_9
red hat advisories RHSA-2024:3418RHSA-2024:3428RHSA-2023:4651RHSA-2023:4635RHSA-2023:4634
- rust1.71 SLE Module for Development Tools 15 SP5, SLE Module for Development Tools 15 SP4, openSUSE Leap 15.5 +1 more 1.71.1-150400.9.6.1
suse advisories SUSE-SU-2023:3251-1
- rust1.71 openSUSE Tumbleweed 1.71.1-1.1
opensuse advisories openSUSE-SU-2024:13101-1
- rust AlmaLinux 9 1.66.1-2.el9_2
- cargo AlmaLinux 9 1.66.1-2.el9_2
- clippy AlmaLinux 9 1.66.1-2.el9_2
- rustfmt AlmaLinux 9 1.66.1-2.el9_2
- rust-gdb AlmaLinux 9 1.66.1-2.el9_2
- rust-src AlmaLinux 9 1.66.1-2.el9_2
- rust-lldb AlmaLinux 9 1.66.1-2.el9_2
- rust-toolset AlmaLinux 9 1.66.1-2.el9_2
almalinux advisories ALSA-2023:4634ALSA-2023:4635
- rust Rocky Linux 9 1.66.1-2.el9_2
- rust Rocky Linux 8 1.66.1-2.module+el8.8.0+1428+0690fcea
rocky linux advisories RLSA-2023:4634RLSA-2023:4635
- rust Alpine 3.24, Alpine 3.23, Alpine 3.22 +4 more 1.71.1-r0
- chromium-rust Alpine 3.24 1.71.1-r0
alpine advisories ALPINE-CVE-2023-38497
Alpine secdb © Alpine Linux, from https://secdb.alpinelinux.org via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- github.com/rust-lang/cargo@d78bbf4 commit
- github.com/rust-lang/cargo#12443 pull request
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2023-38497 updated cvss 6.7
rust-cargo: cargo does not respect the umask when extracting dependencies
-
Red Hat Developer Tools for Red Hat Enterprise Linux Server (v. 7) rust-toolset-1.66-rust 1.66.1-2.el7_9, rust-toolset-1.66-cargo 1.66.1-2.el7_9, rust-toolset-1.66-clippy 1.66.1-2.el7_9, rust-toolset-1.66-rustfmt 1.66.1-2.el7_9, rust-toolset-1.66-rust-gdb 1.66.1-2.el7_9, rust-toolset-1.66-rust-src 1.66.1-2.el7_9, +4 more Red Hat Developer Tools for Red Hat Enterprise Linux Workstation (v. 7) rust-toolset-1.66-rust 1.66.1-2.el7_9, rust-toolset-1.66-cargo 1.66.1-2.el7_9, rust-toolset-1.66-clippy 1.66.1-2.el7_9, rust-toolset-1.66-rustfmt 1.66.1-2.el7_9, rust-toolset-1.66-rust-gdb 1.66.1-2.el7_9, rust-toolset-1.66-rust-src 1.66.1-2.el7_9, +4 morefixed: vendor fix “We recommend configuring your system to prevent other local users from accessing the Cargo directory, usually located in `~/.cargo`.” RHSA-2023:4651
-
Red Hat Enterprise Linux AppStream (v. 8) rust 1.66.1-2.module+el8.8.0+19613+f0bba33b, cargo 1.66.1-2.module+el8.8.0+19613+f0bba33b, clippy 1.66.1-2.module+el8.8.0+19613+f0bba33b, rustfmt 1.66.1-2.module+el8.8.0+19613+f0bba33b, rust-gdb 1.66.1-2.module+el8.8.0+19613+f0bba33b, rust-src 1.66.1-2.module+el8.8.0+19613+f0bba33b, +7 morefixed: vendor fix “We recommend configuring your system to prevent other local users from accessing the Cargo directory, usually located in `~/.cargo`.” RHSA-2023:4635
-
Red Hat Enterprise Linux AppStream (v. 9) rust 1.66.1-2.el9_2, cargo 1.66.1-2.el9_2, clippy 1.66.1-2.el9_2, rustfmt 1.66.1-2.el9_2, rust-gdb 1.66.1-2.el9_2, rust-src 1.66.1-2.el9_2, +7 morefixed: vendor fix “We recommend configuring your system to prevent other local users from accessing the Cargo directory, usually located in `~/.cargo`.” RHSA-2023:4634
-
Red Hat Enterprise Linux AppStream EUS (v.8.6) rls 1.58.1-1.module+el8.6.0+21522+a4bc17c1.1, rust 1.58.1-1.module+el8.6.0+21522+a4bc17c1.1, cargo 1.58.1-1.module+el8.6.0+21522+a4bc17c1.1, clippy 1.58.1-1.module+el8.6.0+21522+a4bc17c1.1, rustfmt 1.58.1-1.module+el8.6.0+21522+a4bc17c1.1, rust-gdb 1.58.1-1.module+el8.6.0+21522+a4bc17c1.1, +7 morefixed: vendor fix “We recommend configuring your system to prevent other local users from accessing the Cargo directory, usually located in `~/.cargo`.” RHSA-2024:3428
-
Red Hat Enterprise Linux AppStream EUS (v.9.0) rls 1.58.1-1.el9_0.1, rust 1.58.1-1.el9_0.1, cargo 1.58.1-1.el9_0.1, clippy 1.58.1-1.el9_0.1, rustfmt 1.58.1-1.el9_0.1, rust-gdb 1.58.1-1.el9_0.1, +6 morefixed: vendor fix “We recommend configuring your system to prevent other local users from accessing the Cargo directory, usually located in `~/.cargo`.” RHSA-2024:3418
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- no
- Technical impact
- total
- Assessed
- 2 y ago
Exploit prediction
0.70% chance of exploitation in the next 30 days, higher than 53% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 7.8 | CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N |
| NVD | 3.1 | 7.3 | CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H |
| GitHub | 3.1 | 7.9 | CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| crates.io | cargo | <0.72.2 |
0.72.2 |
Affected products
- rust-lang cargo
Classification
References
-
github.com
/rust-lang/cargo/pull/12443
web, mailing-list, patch
-
github.com
/rust-lang/cargo/commit/d78bbf4bde3c6b95caca7512f537c6f9721426ff
web, patch
-
github.com
/rust-lang/cargo/security/advisories/GHSA-j3xp-wfr4-hx87
web, vendor-advisory
-
en.wikipedia.org
/wiki/Umask
web, not-applicable
-
github.com
/rust-lang/wg-security-response/tree/main/patches/CVE-2023-38497
web, third-party-advisory
-
rust-lang.org
/policies/security
web, product
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/QGKE6PGM4HIQUHPJRBQAHMELINSGN4H4/
mailing-list, third-party-advisory
- lists.fedoraproject.org /archives/list/package-announce@lists.fedoraproject.org/message/QMEXGUGPW5OBSQA6URTBNDSU3RAEFOZ4/
-
nvd.nist.gov
/vuln/detail/CVE-2023-38497
advisory
-
github.com
/rust-lang/cargo
package
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/QGKE6PGM4HIQUHPJRBQAHMELINSGN4H4
web
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/QMEXGUGPW5OBSQA6URTBNDSU3RAEFOZ4
web
Sources
- CVE List CVE-2023-38497
- GitHub Advisory GHSA-j3xp-wfr4-hx87
- NVD CVE-2023-38497
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.