CVE-2023-38497
Cargo not respecting umask when extracting crate archives
Severity Score
Exploit Likelihood
Affected Versions
Public Exploits
0Exploited in Wild
-Decision
Descriptions
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`.
Cargo descarga las dependencias del proyecto Rust y compila el proyecto. Cargo antes de la versión 0.72.2, incluido con Rust antes de la versión 1.71.1, no respetaba la umask al extraer archivos crate en sistemas tipo UNIX. Si el usuario descargaba un crate que contenía archivos escribibles por cualquier usuario local, otro usuario local podía aprovecharse de esto para cambiar el código fuente compilado y ejecutado por el usuario actual. Para evitar que las extracciones en caché existentes puedan ser explotadas, el binario Cargo versión 0.72.2 incluido en Rust 1.71.1 o posterior purgará automáticamente las cachés generadas por versiones anteriores de Cargo. Como solución, configure su sistema para evitar que otros usuarios locales accedan al directorio Cargo, normalmente ubicado en `~/.cargo`.
A flaw was found in the rust-cargo package. Cargo, as bundled with the Rust compiler, did not respect the umask when extracting dependency tarballs and caching the extraction for future builds. If a dependency contained files with 0777 permissions, another local user could edit the cache of the extracted source code, potentially executing arbitrary code with the privileges of the user running Cargo during the next build.
CVSS Scores
SSVC
- Decision:Track*
Timeline
- 2023-07-18 CVE Reserved
- 2023-08-04 CVE Published
- 2023-08-05 EPSS Updated
- 2024-10-08 CVE Updated
- ---------- Exploited in Wild
- ---------- KEV Due Date
- ---------- First Exploit
CWE
- CWE-276: Incorrect Default Permissions
- CWE-278: Insecure Preserved Inherited Permissions
- CWE-732: Incorrect Permission Assignment for Critical Resource
CAPEC
References (10)
URL | Date | SRC |
---|
URL | Date | SRC |
---|---|---|
https://github.com/rust-lang/cargo/commit/d78bbf4bde3c6b95caca7512f537c6f9721426ff | 2023-08-17 | |
https://github.com/rust-lang/cargo/pull/12443 | 2023-08-17 |
URL | Date | SRC |
---|---|---|
https://github.com/rust-lang/cargo/security/advisories/GHSA-j3xp-wfr4-hx87 | 2023-08-17 | |
https://access.redhat.com/security/cve/CVE-2023-38497 | 2024-05-28 | |
https://bugzilla.redhat.com/show_bug.cgi?id=2228038 | 2024-05-28 |
Affected Vendors, Products, and Versions
Vendor | Product | Version | Other | Status | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Vendor | Product | Version | Other | Status | <-- --> | Vendor | Product | Version | Other | Status |
Rust-lang Search vendor "Rust-lang" | Cargo Search vendor "Rust-lang" for product "Cargo" | < 0.72.2 Search vendor "Rust-lang" for product "Cargo" and version " < 0.72.2" | rust |
Affected
| ||||||
Fedoraproject Search vendor "Fedoraproject" | Fedora Search vendor "Fedoraproject" for product "Fedora" | 38 Search vendor "Fedoraproject" for product "Fedora" and version "38" | - |
Affected
|