# CVE-2023-38497: Cargo not respecting umask when extracting crate archives

- Severity: High 7.8 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.70%, higher than 54% of CVEs (2026-12-01)
- Published: 2023-08-03T16:30:52.000Z
- Modified: 2026-06-17T06:10:34.340Z
- Also known as: GHSA-j3xp-wfr4-hx87
- Weaknesses: CWE-278, CWE-732
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: GitHub_M

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

(As written by CVE List.)

## Affected

- rust-lang cargo: < 0.72.2; before 0.72.2
- cargo (crates.io): before 0.72.2
- fedoraproject fedora: 38

## Every score

- GitHub_M: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N`
- GitHub: CVSS:3.1 7.9 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N`
- NVD: CVSS:3.1 7.3 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H`

## References

- <https://github.com/rust-lang/cargo/security/advisories/GHSA-j3xp-wfr4-hx87> (vendor-advisory, web)
- <https://github.com/rust-lang/cargo/pull/12443> (mailing-list, patch, web)
- <https://github.com/rust-lang/cargo/commit/d78bbf4bde3c6b95caca7512f537c6f9721426ff> (patch, web)
- <https://en.wikipedia.org/wiki/Umask> (not-applicable, web)
- <https://github.com/rust-lang/wg-security-response/tree/main/patches/CVE-2023-38497> (third-party-advisory, web)
- <https://www.rust-lang.org/policies/security> (product, web)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/QGKE6PGM4HIQUHPJRBQAHMELINSGN4H4/> (mailing-list, third-party-advisory)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/QMEXGUGPW5OBSQA6URTBNDSU3RAEFOZ4/>
- <https://nvd.nist.gov/vuln/detail/CVE-2023-38497> (advisory)
- <https://github.com/rust-lang/cargo> (package)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/QGKE6PGM4HIQUHPJRBQAHMELINSGN4H4> (web)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/QMEXGUGPW5OBSQA6URTBNDSU3RAEFOZ4> (web)

## Sources

- CVE List: [CVE-2023-38497](https://www.cve.org/CVERecord?id=CVE-2023-38497), CVE Terms of Use, modified 2025-02-13
- GitHub Advisory Database: [GHSA-j3xp-wfr4-hx87](https://github.com/advisories/GHSA-j3xp-wfr4-hx87), CC-BY-4.0, modified 2023-11-08
- NVD: [CVE-2023-38497](https://nvd.nist.gov/vuln/detail/CVE-2023-38497), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2023-38497 · Whole record: https://cve.day/CVE-2023-38497.json · Rebuilt by cve.day 2026-11-25T22:58:26.756Z
