CVE-2023-38497

Cargo not respecting umask when extracting crate archives

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`.

Categories

7.9
CVSS
Severity: High
CVSS 3.1 •
EPSS 4.94% Top 15%
Vendor Advisory github.com
Affected: rust-lang cargo
Published at:
Updated at:

References

Frequently Asked Questions

What is the severity of CVE-2023-38497?
CVE-2023-38497 has been scored as a high severity vulnerability.
How to fix CVE-2023-38497?
To fix CVE-2023-38497, make sure you are using an up-to-date version of the affected component(s) by checking the vendor release notes. As for now, there are no other specific guidelines available.
Is CVE-2023-38497 being actively exploited in the wild?
It is possible that CVE-2023-38497 is being exploited or will be exploited in a near future based on public information. According to its EPSS score, there is a ~5% probability that this vulnerability will be exploited by malicious actors in the next 30 days.
What software or system is affected by CVE-2023-38497?
CVE-2023-38497 affects rust-lang cargo.
This platform uses data from the NIST NVD, MITRE CVE, MITRE CWE, First.org and CISA KEV but is not endorsed or certified by these entities. CVE is a registred trademark of the MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. CWE is a registred trademark of the MITRE Corporation and the authoritative source of CWE content is MITRE's CWE web site.
© 2025 Under My Watch. All Rights Reserved.