CVE-2023-38497

HIGH

Cargo < 0.72.2 - Incorrect Permission Assignment for Critical Resource

Title source: llm
STIX 2.1

Exploitation Summary

EIP tracks 1 public exploit for CVE-2023-38497. PoCs published by lucas-cauhe.

AI-analyzed exploit summary This repository demonstrates a proof-of-concept exploit for CVE-2023-38497, which leverages improper file permissions in Rust's Cargo package manager to inject malicious code into locally cached crate source files. The exploit modifies a method in a vulnerable crate to execute a reverse shell when the target project is recompiled.

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

Exploits (1)

nomisec WORKING POC 1 stars
by lucas-cauhe · poc
https://github.com/lucas-cauhe/cargo-perm

This repository demonstrates a proof-of-concept exploit for CVE-2023-38497, which leverages improper file permissions in Rust's Cargo package manager to inject malicious code into locally cached crate source files. The exploit modifies a method in a vulnerable crate to execute a reverse shell when the target project is recompiled.

Classification
Working Poc 95%
Attack Type
Rce
Complexity
Moderate
Reliability
Reliable
Target: Rust Cargo (versions prior to fix for CVE-2023-38497)
No auth needed
Prerequisites: Access to a system with vulnerable Cargo installation · Write permissions to locally cached crate source files · Target project using a vulnerable crate
devstral-2 · analyzed Feb 18, 2026 Full analysis →

Scores

CVSS v3 7.9
EPSS 0.0566
EPSS Percentile 90.6%
Attack Vector LOCAL
CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N

CISA SSVC

Vulnrichment
Exploitation none
Automatable no
Technical Impact total

Details

CWE
CWE-732 CWE-278
Status published
Products (3)
crates.io/cargo 0 - 0.72.2crates.io
fedoraproject/fedora 38
rust-lang/cargo < 0.72.2
Published Aug 04, 2023
Tracked Since Feb 18, 2026