CVEfocus › CVE database › CVE-2023-38497

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

CVSS 7.8 HighEPSS 0.6% (higher than 40% of CVEs)Published 2023-08-04Updated 2025-02-13Assigner: GitHub_M

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

CWE-278

What to do

Fixed builds are available from AlmaLinux, Alpine, Debian, Red Hat, Rocky Linux, Ubuntu, crates.io: see the table below for the fixed version per release.

Debian, Ubuntu have not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

74Fixed
11Fix pending
3Not affected

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 26.04rust-cargoNot affected
vulnerable_code_not_present
Ubuntu 25.10rust-cargoNot affected
vulnerable_code_not_present
Ubuntu 24.04rust-cargoFix pendingUBUNTU-CVE-2023-38497
Ubuntu 24.04rustcFixed1.71.1+dfsg0ubuntu2-0ubuntu1UBUNTU-CVE-2023-38497
Ubuntu 22.04cargoFix pending0.67.1+ds0ubuntu0.libgit2-0ubuntu0.22.04.2+esm1 (Ubuntu Pro)UBUNTU-CVE-2023-38497
Ubuntu 22.04rust-cargoFix pending0.57.0-1ubuntu0.1~esm1 (Ubuntu Pro)UBUNTU-CVE-2023-38497
Ubuntu 22.04rustcNot affected
vulnerable_code_not_present
Ubuntu 20.04cargoFix pending0.67.1+ds0ubuntu0.libgit2-0ubuntu0.20.04.2+esm1 (Ubuntu Pro)UBUNTU-CVE-2023-38497
Ubuntu 18.04cargoFix pending0.66.0+ds0ubuntu0.libgit2-0ubuntu0.18.04.1~esm1 (Ubuntu Pro)UBUNTU-CVE-2023-38497
Ubuntu 16.04cargoFix pending0.47.0-1~exp1ubuntu1~16.04.1+esm1 (Ubuntu Pro)UBUNTU-CVE-2023-38497
Ubuntu 16.04rustcFix pending
Ubuntu 14.04cargoFix pending
Ubuntu 14.04rustcFix pending
Debian 14rust-cargoFixed0.76.0-1DEBIAN-CVE-2023-38497
Debian 13rust-cargoFixed0.76.0-1DEBIAN-CVE-2023-38497
Debian 12cargoFix pendingDEBIAN-CVE-2023-38497
Debian 12rust-cargoFix pendingDEBIAN-CVE-2023-38497
Red Hat Enterprise Linux 9cargoFixed0:1.66.1-2.el9_2RHSA-2023:4634
Red Hat Enterprise Linux 9clippyFixed0:1.66.1-2.el9_2RHSA-2023:4634
Red Hat Enterprise Linux 9rustFixed0:1.66.1-2.el9_2RHSA-2023:4634
Red Hat Enterprise Linux 9rust-analysisFixed0:1.66.1-2.el9_2RHSA-2023:4634
Red Hat Enterprise Linux 9rust-analyzerFixed0:1.66.1-2.el9_2RHSA-2023:4634
Red Hat Enterprise Linux 9rust-debugger-commonFixed0:1.66.1-2.el9_2RHSA-2023:4634
Red Hat Enterprise Linux 9rust-docFixed0:1.66.1-2.el9_2RHSA-2023:4634
Red Hat Enterprise Linux 9rust-gdbFixed0:1.66.1-2.el9_2RHSA-2023:4634
Red Hat Enterprise Linux 9rust-lldbFixed0:1.66.1-2.el9_2RHSA-2023:4634
Red Hat Enterprise Linux 9rust-srcFixed0:1.66.1-2.el9_2RHSA-2023:4634
Red Hat Enterprise Linux 9rust-std-staticFixed0:1.66.1-2.el9_2RHSA-2023:4634
Red Hat Enterprise Linux 9rust-std-static-wasm32-unknown-unknownFixed0:1.66.1-2.el9_2RHSA-2023:4634
Red Hat Enterprise Linux 9rust-std-static-wasm32-wasiFixed0:1.66.1-2.el9_2RHSA-2023:4634
Red Hat Enterprise Linux 9rust-toolsetFixed0:1.66.1-2.el9_2RHSA-2023:4634
Red Hat Enterprise Linux 9rustfmtFixed0:1.66.1-2.el9_2RHSA-2023:4634
Red Hat Enterprise Linux 8cargoFixed0:1.66.1-2.module+el8.8.0+19613+f0bba33bRHSA-2023:4635
Red Hat Enterprise Linux 8clippyFixed0:1.66.1-2.module+el8.8.0+19613+f0bba33bRHSA-2023:4635
Red Hat Enterprise Linux 8rustFixed0:1.66.1-2.module+el8.8.0+19613+f0bba33bRHSA-2023:4635
Red Hat Enterprise Linux 8rust-analysisFixed0:1.66.1-2.module+el8.8.0+19613+f0bba33bRHSA-2023:4635
Red Hat Enterprise Linux 8rust-analyzerFixed0:1.66.1-2.module+el8.8.0+19613+f0bba33bRHSA-2023:4635
Red Hat Enterprise Linux 8rust-debugger-commonFixed0:1.66.1-2.module+el8.8.0+19613+f0bba33bRHSA-2023:4635
Red Hat Enterprise Linux 8rust-docFixed0:1.66.1-2.module+el8.8.0+19613+f0bba33bRHSA-2023:4635
Red Hat Enterprise Linux 8rust-gdbFixed0:1.66.1-2.module+el8.8.0+19613+f0bba33bRHSA-2023:4635
Red Hat Enterprise Linux 8rust-lldbFixed0:1.66.1-2.module+el8.8.0+19613+f0bba33bRHSA-2023:4635
Red Hat Enterprise Linux 8rust-srcFixed0:1.66.1-2.module+el8.8.0+19613+f0bba33bRHSA-2023:4635
Red Hat Enterprise Linux 8rust-std-staticFixed0:1.66.1-2.module+el8.8.0+19613+f0bba33bRHSA-2023:4635
Red Hat Enterprise Linux 8rust-std-static-wasm32-unknown-unknownFixed0:1.66.1-2.module+el8.8.0+19613+f0bba33bRHSA-2023:4635
Red Hat Enterprise Linux 8rust-std-static-wasm32-wasiFixed0:1.66.1-2.module+el8.8.0+19613+f0bba33bRHSA-2023:4635
Red Hat Enterprise Linux 8rust-toolsetFixed0:1.66.1-2.module+el8.8.0+19613+f0bba33bRHSA-2023:4635
Red Hat Enterprise Linux 8rustfmtFixed0:1.66.1-2.module+el8.8.0+19613+f0bba33bRHSA-2023:4635
AlmaLinux 9cargoFixed1.66.1-2.el9_2ALSA-2023:4634
AlmaLinux 9clippyFixed1.66.1-2.el9_2ALSA-2023:4634
AlmaLinux 9rustFixed1.66.1-2.el9_2ALSA-2023:4634
AlmaLinux 9rust-analysisFixed1.66.1-2.el9_2ALSA-2023:4634
AlmaLinux 9rust-analyzerFixed1.66.1-2.el9_2ALSA-2023:4634
AlmaLinux 9rust-debugger-commonFixed1.66.1-2.el9_2ALSA-2023:4634
AlmaLinux 9rust-docFixed1.66.1-2.el9_2ALSA-2023:4634
AlmaLinux 9rust-gdbFixed1.66.1-2.el9_2ALSA-2023:4634
AlmaLinux 9rust-lldbFixed1.66.1-2.el9_2ALSA-2023:4634
AlmaLinux 9rust-srcFixed1.66.1-2.el9_2ALSA-2023:4634
AlmaLinux 9rust-std-staticFixed1.66.1-2.el9_2ALSA-2023:4634
AlmaLinux 9rust-std-static-wasm32-unknown-unknownFixed1.66.1-2.el9_2ALSA-2023:4634
AlmaLinux 9rust-std-static-wasm32-wasiFixed1.66.1-2.el9_2ALSA-2023:4634
AlmaLinux 9rust-toolsetFixed1.66.1-2.el9_2ALSA-2023:4634
AlmaLinux 9rustfmtFixed1.66.1-2.el9_2ALSA-2023:4634
AlmaLinux 8cargoFixed1.66.1-2.module_el8.8.0+3604+b9bee1fcALSA-2023:4635
AlmaLinux 8clippyFixed1.66.1-2.module_el8.8.0+3604+b9bee1fcALSA-2023:4635
AlmaLinux 8rustFixed1.66.1-2.module_el8.8.0+3604+b9bee1fcALSA-2023:4635
AlmaLinux 8rust-analysisFixed1.66.1-2.module_el8.8.0+3604+b9bee1fcALSA-2023:4635
AlmaLinux 8rust-analyzerFixed1.66.1-2.module_el8.8.0+3604+b9bee1fcALSA-2023:4635
AlmaLinux 8rust-debugger-commonFixed1.66.1-2.module_el8.8.0+3604+b9bee1fcALSA-2023:4635
AlmaLinux 8rust-docFixed1.66.1-2.module_el8.8.0+3604+b9bee1fcALSA-2023:4635
AlmaLinux 8rust-gdbFixed1.66.1-2.module_el8.8.0+3604+b9bee1fcALSA-2023:4635
AlmaLinux 8rust-lldbFixed1.66.1-2.module_el8.8.0+3604+b9bee1fcALSA-2023:4635
AlmaLinux 8rust-srcFixed1.66.1-2.module_el8.8.0+3604+b9bee1fcALSA-2023:4635
AlmaLinux 8rust-std-staticFixed1.66.1-2.module_el8.8.0+3604+b9bee1fcALSA-2023:4635
AlmaLinux 8rust-std-static-wasm32-unknown-unknownFixed1.66.1-2.module_el8.8.0+3604+b9bee1fcALSA-2023:4635
AlmaLinux 8rust-std-static-wasm32-wasiFixed1.66.1-2.module_el8.8.0+3604+b9bee1fcALSA-2023:4635
AlmaLinux 8rust-toolsetFixed1.66.1-2.module_el8.8.0+3604+b9bee1fcALSA-2023:4635
AlmaLinux 8rustfmtFixed1.66.1-2.module_el8.8.0+3604+b9bee1fcALSA-2023:4635
Rocky Linux 9rustFixed0:1.66.1-2.el9_2RLSA-2023:4634
Rocky Linux 8rustFixed0:1.66.1-2.module+el8.8.0+1428+0690fceaRLSA-2023:4635
Alpine Linux 3.24chromium-rustFixed1.71.1-r0ALPINE-CVE-2023-38497
Alpine Linux 3.24rustFixed1.71.1-r0ALPINE-CVE-2023-38497
Alpine Linux 3.23rustFixed1.71.1-r0ALPINE-CVE-2023-38497
Alpine Linux 3.22rustFixed1.71.1-r0ALPINE-CVE-2023-38497
Alpine Linux 3.21rustFixed1.71.1-r0ALPINE-CVE-2023-38497
Alpine Linux 3.20rustFixed1.71.1-r0ALPINE-CVE-2023-38497
Alpine Linux 3.19rustFixed1.71.1-r0ALPINE-CVE-2023-38497
Alpine Linux 3.18rustFixed1.71.1-r0ALPINE-CVE-2023-38497
crates.io librarycargoFixed0.72.2GHSA-j3xp-wfr4-hx87

What the vendor says

As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.