ALAS2-2023-1959
Active ModerateALAS2-2023-1959 (medium): rust
Related CVEs
CVE identifiers linked by this publisher.
Publisher relationship details 2 records
Shared by all 2 CVE relationships
Exact relationship value
advisory_listExact field value
referencesExact evidence value
https://alas.aws.amazon.com/AL2/ALAS2-2023-1959.html| CVE |
|---|
| CVE-2022-36113 |
| CVE-2022-36114 |
Description
Cargo is a package manager for the rust programming language. After a package is downloaded, Cargo extracts its source code in the ~/.cargo folder on disk, making it available to the Rust projects it builds. To reco rd when an extraction is successful, Cargo writes "ok" to the .cargo-ok file at the root of the extracted source code once it extracted all the
Read full publisher description 4318 characters
Cargo is a package manager for the rust programming language. After a package is downloaded, Cargo extracts its source code in the ~/.cargo folder on disk, making it available to the Rust projects it builds. To reco rd when an extraction is successful, Cargo writes "ok" to the .cargo-ok file at the root of the extracted source code once it extracted all the files. It was discovered that Cargo allowed packages to contain a .cargo-ok symbolic l ink, which Cargo would extract. Then, when Cargo attempted to write "ok" into .cargo-ok, it would actually replace the first two bytes of the file the symlink pointed to with ok. This would allow an attacker to corrupt one file on the machine using Cargo to extract the package. Note that by design Cargo allows code execution at build time, due to build scripts and procedural macros. The vulnerabilities in this advisory allow performing a subset of the poss ible damage in a harder to track down way. Your dependencies must still be trusted if you want to be protected from attacks, as its possible to perform the same attacks with build scripts and procedural macros. The vulnerability is present in all versions of Cargo. Rust 1.64, to be released on September 22nd, will include a fix for it. Since the vulnerability is just a more limited way to accomplish what a malicious build scripts or procedural macros can do, we decided not to publish Rust point releases backporting the security fix. Patch files are available for Rust 1.63.0 are available in the wg-security-response repository for people building their own toolchain. Mitigations We recommend users of alternate registries to exercise care in which package they download, by only including trusted dependencies in their projects. Please note that even with these vulnerabilities fixed, by design Cargo allows arb itrary code execution at build time thanks to build scripts and procedural macros: a malicious dependency will be able to cause damage regardless of these vulnerabilities. crates.io implemented server-side checks to reject these k inds of packages years ago, and there are no packages on crates.io exploiting these vulnerabilities. crates.io users still need to exercise care in choosing their dependencies though, as remote code execution is allowed by design there as well. (CVE-2022-36113) Cargo is a package manager for the rust programming language. It was discovered that Cargo did not limit the amount of data extracted from compressed archives. An attacker could upload to an alternate registry a spe cially crafted package that extracts way more data than its size (also known as a "zip bomb"), exhausting the disk space on the machine using Cargo to download the package. Note that by design Cargo allows code execution at build time, due to build scripts and procedural macros. The vulnerabilities in this advisory allow performing a subset of the possible damage in a harder to track down way. Your dependencies must still be trusted if you want to be prote cted from attacks, as its possible to perform the same attacks with build scripts and procedural macros. The vulnerability is present in all versions of Cargo. Rust 1.64, to be released on September 22nd, will include a fix for i t. Since the vulnerability is just a more limited way to accomplish what a malicious build scripts or procedural macros can do, we decided not to publish Rust point releases backporting the security fix. Patch files are available for Rust 1.63.0 are available in the wg-security-response repository for people building their own toolchain. We recommend users of alternate registries to excercise care in which package they download, by only including trusted d ependencies in their projects. Please note that even with these vulnerabilities fixed, by design Cargo allows arbitrary code execution at build time thanks to build scripts and procedural macros: a malicious dependency will be abl e to cause damage regardless of these vulnerabilities. crates.io implemented server-side checks to reject these kinds of packages years ago, and there are no packages on crates.io exploiting these vulnerabilities. crates.io users still need to excercise care in choosing their dependencies though, as the same concerns about build scripts and procedural macros apply here. (CVE-2022-36114)
Solution
Run yum update rust or yum update --advisory ALAS2-2023-1959 to update your system.
Affected packages
Each item is one publisher package occurrence. Shared details are shown once; differences stay with the occurrence.
Shared package data
Applies to all 4 occurrences-
1rust
Occurrence-specific details
- Architecture
- aarch64
Replacement RPMs
- rust-1.66.1-1.amzn2.0.1.aarch64
- rust-std-static-1.66.1-1.amzn2.0.1.aarch64
- rust-doc-1.66.1-1.amzn2.0.1.aarch64
- cargo-1.66.1-1.amzn2.0.1.aarch64
- rustfmt-1.66.1-1.amzn2.0.1.aarch64
- rust-analyzer-1.66.1-1.amzn2.0.1.aarch64
- clippy-1.66.1-1.amzn2.0.1.aarch64
- rust-analysis-1.66.1-1.amzn2.0.1.aarch64
- rust-debuginfo-1.66.1-1.amzn2.0.1.aarch64
-
2rust
Occurrence-specific details
- Architecture
- noarch
Replacement RPMs
- rust-debugger-common-1.66.1-1.amzn2.0.1.noarch
- rust-gdb-1.66.1-1.amzn2.0.1.noarch
- rust-src-1.66.1-1.amzn2.0.1.noarch
-
3rust
Occurrence-specific details
- Architecture
- src
Replacement RPMs
- rust-1.66.1-1.amzn2.0.1.src
-
4rust
Occurrence-specific details
- Architecture
- x86_64
Replacement RPMs
- rust-1.66.1-1.amzn2.0.1.x86_64
- rust-std-static-1.66.1-1.amzn2.0.1.x86_64
- rust-doc-1.66.1-1.amzn2.0.1.x86_64
- cargo-1.66.1-1.amzn2.0.1.x86_64
- rustfmt-1.66.1-1.amzn2.0.1.x86_64
- rust-analyzer-1.66.1-1.amzn2.0.1.x86_64
- clippy-1.66.1-1.amzn2.0.1.x86_64
- rust-analysis-1.66.1-1.amzn2.0.1.x86_64
- rust-debuginfo-1.66.1-1.amzn2.0.1.x86_64
CVSS assessments
Publisher supplied scores and vectors; these do not replace the advisory severity above.
No CVSS assessments were provided.
Publisher references
4- CVE-2022-36113 https://access.redhat.com/security/cve/CVE-2022-36113
- CVE-2022-36114 https://access.redhat.com/security/cve/CVE-2022-36114
- CVE-2022-36113 https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-36113
- CVE-2022-36114 https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-36114
Provenance
- Schema version
- Unknown
- Parser version
- amazon-alas/1
- Severity origin
- publisher
| Kind | Locator | Source commit | Document hash | Parser | Fetched |
|---|---|---|---|---|---|
| html_page | https://alas.aws.amazon.com/AL2/ALAS2-2023-1959.html | Unknown | b8541ae46a252115b60872eb1603df5b4e4d457b9f55114dc32553d2e1d55dd7 | amazon-alas/1 | 2026-11-16T08:26:43Z |
| rss_entry | https://alas.aws.amazon.com/AL2/ALAS2-2023-1959.html | Unknown | Unknown | amazon-alas/1 | 2026-11-16T08:26:43Z |
| catalog_entry | https://alas.aws.amazon.com/AL2/ALAS2-2023-1959.html | Unknown | Unknown | amazon-alas/1 | 2026-11-16T08:26:43Z |