CVE-2023-38497
published 2023-08-04CVE-2023-38497: 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…
PriorityP336high7.3CVSS 3.1
AVLACLPRLUIRSUCHIHAH
EPSS
0.78%
52.3th percentile
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
6 ranges
| Vendor | Product | Version range | Fixed in |
|---|---|---|---|
| debian | cargo | < rust-cargo 0.76.0-1 (forky) | rust-cargo 0.76.0-1 (forky) |
| debian | rust-cargo | < rust-cargo 0.76.0-1 (forky) | rust-cargo 0.76.0-1 (forky) |
| fedoraproject | fedora | — | — |
| msrc | cbl2_rust_1.72.0-2_on_cbl_mariner_2.0 | — | — |
| rust-lang | cargo | < 0.72.2 | 0.72.2 |
| rust-lang | cargo | >= 0 < 0.72.2 | 0.72.2 |
CVSS provenance
nvdv3.17.3HIGHCVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H
ghsa7.3HIGH
osv7.3HIGH
vendor_debian7.9HIGH
vendor_redhat7.9HIGH
vendor_msrc7.3HIGH
Stop checking back — get the weekly exploitation signal.
Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.
OSV
CVE-2023-38497: Cargo downloads the Rust project’s dependencies and compiles the project
osv·2023-08-04·CVSS 7.3
CVE-2023-38497 [HIGH] CVE-2023-38497: Cargo downloads the Rust project’s dependencies and compiles the project
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`.
OSV
Cargo not respecting umask when extracting crate archives
osv·2023-08-03·CVSS 7.3
CVE-2023-38497 [HIGH] Cargo not respecting umask when extracting crate archives
Cargo not respecting umask when extracting crate archives
The Rust Security Response WG was notified that Cargo 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.
This vulnerability has been assigned CVE-2023-38497.
## Overview
In UNIX-like systems, each file has three sets of permissions: for the user owning the file, for the group owning the file, and for all other local users. The "[umask][1]" is configured on most systems to limit those permissions during file creation, removing dangerous ones. For example, the default umask on macOS and most Linux distributions only allow
GHSA
Cargo not respecting umask when extracting crate archives
ghsa·2023-08-03·CVSS 7.3
CVE-2023-38497 [HIGH] CWE-278 Cargo not respecting umask when extracting crate archives
Cargo not respecting umask when extracting crate archives
The Rust Security Response WG was notified that Cargo 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.
This vulnerability has been assigned CVE-2023-38497.
## Overview
In UNIX-like systems, each file has three sets of permissions: for the user owning the file, for the group owning the file, and for all other local users. The "[umask][1]" is configured on most systems to limit those permissions during file creation, removing dangerous ones. For example, the default umask on macOS and most Linux distributions only allow
Microsoft
Cargo not respecting umask when extracting crate archives
vendor_msrc·2023-08-08·CVSS 7.3
CVE-2023-38497 [HIGH] CWE-278 Cargo not respecting umask when extracting crate archives
Cargo not respecting umask when extracting crate archives
FAQ: Is Azure Linux the only Microsoft product that includes this open-source library and is therefore potentially affected by this vulnerability?
One of the main benefits to our customers who choose to use the Azure Linux distro is the commitment to keep it up to date with the most recent and most secure versions of the open source libraries with which the distro is composed. Microsoft is committed to transparency in this work which is why we began publishing CSAF/VEX in October 2025. See this blog post for more information. If impact to additional products is identified, we will update the CVE to reflect this.
Mariner: Mariner
GitHub_M: GitHub_M
Customer Action Required: Yes
Remediation: CBL-Mariner Releases
Reference: https
Ubuntu
Cargo vulnerability
vendor_ubuntu·2023-08-03
CVE-2023-38497 Cargo vulnerability
Title: Cargo vulnerability
Summary: Cargo could be made to run programs as your login if it
installed a specially crafted crate.
Addison Crump discovered that Cargo incorrectly set file permissions
on UNIX-like systems when extracting crate archives. If the crate would
contain files writable by any user, a local attacker could possibly use
this issue to execute code as another user.
Instructions: In general, a standard system update will make all the necessary changes.
Red Hat
rust-cargo: cargo does not respect the umask when extracting dependencies
vendor_redhat·2023-08-03·CVSS 7.9
CVE-2023-38497 [HIGH] CWE-276 rust-cargo: cargo does not respect the umask when extracting dependencies
rust-cargo: cargo does not respect the umask when extracting dependencies
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 locate
Debian
CVE-2023-38497: cargo - Cargo downloads the Rust project’s dependencies and compiles the project. Cargo ...
vendor_debian·2023·CVSS 7.9
CVE-2023-38497 [HIGH] CVE-2023-38497: cargo - Cargo downloads the Rust project’s dependencies and compiles the project. Cargo ...
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`.
Scope: local
bookworm: open
bullseye: open
No detection rules found.
No public exploits indexed.
No writeups or analysis indexed.
https://en.wikipedia.org/wiki/Umaskhttps://github.com/rust-lang/cargo/commit/d78bbf4bde3c6b95caca7512f537c6f9721426ffhttps://github.com/rust-lang/cargo/pull/12443https://github.com/rust-lang/cargo/security/advisories/GHSA-j3xp-wfr4-hx87https://github.com/rust-lang/wg-security-response/tree/main/patches/CVE-2023-38497https://lists.fedoraproject.org/archives/list/[email protected]/message/QGKE6PGM4HIQUHPJRBQAHMELINSGN4H4/https://lists.fedoraproject.org/archives/list/[email protected]/message/QMEXGUGPW5OBSQA6URTBNDSU3RAEFOZ4/https://www.rust-lang.org/policies/securityhttps://en.wikipedia.org/wiki/Umaskhttps://github.com/rust-lang/cargo/commit/d78bbf4bde3c6b95caca7512f537c6f9721426ffhttps://github.com/rust-lang/cargo/pull/12443https://github.com/rust-lang/cargo/security/advisories/GHSA-j3xp-wfr4-hx87https://github.com/rust-lang/wg-security-response/tree/main/patches/CVE-2023-38497https://lists.fedoraproject.org/archives/list/[email protected]/message/QGKE6PGM4HIQUHPJRBQAHMELINSGN4H4/https://lists.fedoraproject.org/archives/list/[email protected]/message/QMEXGUGPW5OBSQA6URTBNDSU3RAEFOZ4/https://www.rust-lang.org/policies/security
2023-08-04
Published