Cyber Resilience

CVE-2023-38497

LPE in Rust-Lang Cargo ≤ 0.72.2

Published
04 August 2023
Modified
21 November 2024
Patch / advisory
CVSS Score v3.1 7.9
Click a component to see what it means
Raw vectorCVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N
EPSS Score 0.0073 51th percentile
Risk Priority 62 floored blend · peak EPSS

Summary

CVE-2023-38497 is a high-severity Insecure Preserved Inherited Permissions (CWE-278) vulnerability in Rust-Lang Cargo. Its CVSS base score is 7.9 (High).

Operationally, exploitation aligns with the MITRE ATT&CK technique Credentials In Files (T1552.001); ranked in the top 49% of CVEs by exploit likelihood; it is not currently listed in the CISA KEV catalog.

Deeper analysis AI-assisted summary

Synthesised by an AI model from the NVD description and linked references — a reading aid, not an authoritative source.

Cargo prior to version 0.72.2, bundled with Rust prior to 1.71.1, failed to respect the umask when extracting crate archives on UNIX-like systems. This flaw, tracked under CWE-278 and CWE-732, allowed downloaded crates containing files writable by any local user to retain overly permissive permissions in the local cache directory, typically ~/.cargo.

A local attacker on the same system could therefore modify source files within another user's extracted crate cache. When the victim subsequently built or ran a project depending on that crate, the attacker's changes would be compiled and executed with the victim's privileges, yielding a CVSS 7.9 impact that affects confidentiality and integrity but not availability.

The official GitHub Security Advisory and accompanying Cargo commit instruct users to upgrade to Rust 1.71.1 or later; the updated Cargo binary automatically purges caches created by older versions. As an immediate workaround, administrators can restrict permissions on the Cargo directory so that other local users cannot access it.

The associated EPSS score has remained low and stable near 0.0566 with a peak of 0.0580, indicating no significant post-disclosure exploitation interest.

OWASP Top 10 for Web (2025)

EU & UK References

Vulnerability Data

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…

more

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

CWE(s)

Related Threats

MITRE ATT&CK Enterprise Techniques

T1552.001 Credentials In Files Credential Access
Adversaries may search local file systems and remote file shares for files containing insecurely stored credentials.
T1552.004 Private Keys Credential Access
Adversaries may search for private key certificate files on compromised systems for insecurely stored credentials.
T1574.005 Executable Installer File Permissions Weakness Stealth
Adversaries may execute their own malicious payloads by hijacking the binaries used by an installer.
T1574.010 Services File Permissions Weakness Stealth
Adversaries may execute their own malicious payloads by hijacking the binaries used by services.
T1505.005 Terminal Services DLL Persistence
Adversaries may abuse components of Terminal Services to enable persistent access to systems.
T1548 Abuse Elevation Control Mechanism Privilege Escalation
Adversaries may circumvent mechanisms designed to control privilege elevation to gain higher-level permissions.
Derived from this CVE’s CWE(s) via the direct CWE→ATT&CK cross-walk.

CVEs Like This One

CVE-2026-5222Same product: Rust-Lang Cargo
CVE-2026-5223Same product: Rust-Lang Cargo
CVE-2025-46802Shared CWE-732
CVE-2026-26929Shared CWE-732
CVE-2025-27688Shared CWE-732
CVE-2025-4609Shared CWE-732
CVE-2023-42189Shared CWE-732
CVE-2024-22029Shared CWE-732
CVE-2026-35367Shared CWE-732
CVE-2025-55524Shared CWE-732

Affected Assets

rust-lang
cargo
≤ 0.72.2
fedoraproject
fedora
38

Mitigating Controls

Control response

Prevent
Stop it (NIST 800-53)

Detect
Catch it (NIST detect / respond)

Harden
Shrink the surface (DISA STIG)
  • 7 hardening rules · 4 OS baselines
Validate
Prove the fix (OWASP ASVS)

Likely Mitigating Controls AI

Per-CVE control mapping for this CVE has not run yet; the list below is derived from the weakness types (CWEs) cited in the NVD entry.

addresses: CWE-732

Procedures support proper permission assignment for critical resources through documented controls.

addresses: CWE-732

Attribute management for resources provides a mechanism to assign and maintain correct permissions based on security labels.

addresses: CWE-732

Prevents overly permissive assignments to critical resources by limiting to task needs.

addresses: CWE-732

Training policy covers correct permission assignment, reducing the ability to exploit incorrect permission assignments for critical resources.

addresses: CWE-732

Training on permission management reduces incorrect permission assignments for critical resources.

addresses: CWE-732

Audit logs and logging tools are critical resources whose protection requires correct permission assignments to block unauthorized actions.

addresses: CWE-732

Assessments review permission assignments on critical resources to confirm correctness, mitigating exploitation via incorrect permissions.

addresses: CWE-732

Certification includes checking that permissions on critical resources are correctly assigned.

Mitigating Controls (NIST CSF 2.0) AI

Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→CSF cross-walk (authority under review) — links open the control.

PR.AA-05 full match
prevents

Directly requires defining, enforcing, and reviewing access permissions and least privilege on resources.

PR.PS-01 mostly match
prevents

Hardened baselines and configuration management explicitly include correct permission settings for critical resources.

Mitigating Controls (ISO/IEC 27001:2022 Annex A) AI

Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→ISO cross-walk (authority under review) — links open the control.

prevents

By requiring owners to determine and document the exact permissions needed for each asset, the control reduces the likelihood that default or overly permissive file and resource permissions will be left in place.

prevents

Documented provisioning and revocation procedures reduce the chance that critical resources retain overly permissive default or leftover permissions after personnel changes.

prevents

Documented authorization, expiry rules, and audit logging of privileged accounts make it harder for critical resources to retain overly permissive or stale permission assignments.

prevents

Requiring explicit configuration of access controls and permissions for files, applications and services counters the assignment of overly permissive default or incorrect file-system rights.

prevents

Enforcing differentiated permissions on the source-code repository and program listings stops the assignment of overly broad default or inherited permissions to critical resources.

prevents

By defining and enforcing secure permission settings in configuration templates, the control reduces the likelihood that critical resources receive incorrect permission assignments.

Hardening callouts derived

Configuration rules from DISA STIG baselines that bear on weaknesses of the type cited by this CVE. Each rule is shown with the relationship its mapping actually records, against the CWE it was authored against. Derived via CVE→CWE over `controls_xwalks` (authoritative rows only; rows rated `none` are excluded).

Oracle Linux 8 (1 rule)
  • V-248577 OL 8 must enable kernel parameters to enforce Discretionary Access Control (DAC) on symlinks. prevents CWE-732
Windows Server 2016 (2 rules)
  • V-224972 Active Directory Group Policy objects must have proper access control permissions. prevents CWE-732
  • V-224831 Local volumes must use a format that supports NTFS attributes. prevents CWE-732
Windows Server 2019 (2 rules)
  • V-205741 Windows Server 2019 Active Directory Group Policy objects must have proper access control permissions. prevents CWE-732
  • V-205663 Windows Server 2019 local volumes must use a format that supports NTFS attributes. prevents CWE-732
Windows Server 2022 (2 rules)
  • V-254393 Windows Server 2022 Active Directory Group Policy objects must have proper access control permissions. prevents CWE-732
  • V-254250 Windows Server 2022 local volumes must use a format that supports NTFS attributes. prevents CWE-732

References