Search CVEs and advisories

Search CVEs and Linux security advisories by vendor, product, package, or severity, and see which vulnerabilities each advisory addresses.

Security advisory

ALAS2-2023-1959

Active Moderate

ALAS2-2023-1959 (medium): rust

Published
21 Feb 2023
Updated
22 Feb 2023

Related CVEs

CVE identifiers linked by this publisher.

2
Publisher relationship details 2 records
Explicit publisher CVE relationships
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.

4

Shared package data

Applies to all 4 occurrences
  1. 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
  2. 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
  3. 3rust

    Occurrence-specific details
    Architecture
    src

    Replacement RPMs

    • rust-1.66.1-1.amzn2.0.1.src
  4. 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.

0

No CVSS assessments were provided.

Publisher references

4
  • CVE-2022-36113 advisory · Tags: Red Hat https://access.redhat.com/security/cve/CVE-2022-36113
  • CVE-2022-36114 advisory · Tags: Red Hat https://access.redhat.com/security/cve/CVE-2022-36114
  • CVE-2022-36113 advisory · Tags: Mitre https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-36113
  • CVE-2022-36114 advisory · Tags: Mitre https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-36114

Provenance

Schema version
Unknown
Parser version
amazon-alas/1
Severity origin
publisher
Publisher document provenance records
KindLocatorSource commitDocument hashParserFetched
html_pagehttps://alas.aws.amazon.com/AL2/ALAS2-2023-1959.htmlUnknownb8541ae46a252115b60872eb1603df5b4e4d457b9f55114dc32553d2e1d55dd7amazon-alas/12026-11-16T08:26:43Z
rss_entryhttps://alas.aws.amazon.com/AL2/ALAS2-2023-1959.htmlUnknownUnknownamazon-alas/12026-11-16T08:26:43Z
catalog_entryhttps://alas.aws.amazon.com/AL2/ALAS2-2023-1959.htmlUnknownUnknownamazon-alas/12026-11-16T08:26:43Z

Search filters

Match options apply to free text. CVE words match tokens; use contains:"…" for literal substrings.

Text

Words and phrases
buffer overflow "remote code execution"
Word prefix
auth*
Literal substring (title or description)
contains:"use-after-free"
Exclude a term or filter
-test -vendor:example

Affected product

Vendor
vendor:Example
Product
product:"Demo Widget"

Severity and score

Severity · none, low, medium, high, critical, unknown
severity:critical
CWE identifier
cwe:CWE-863
CVSS score (0–10)
cvss:>=7.0

Dates and status

Published date · comparisons, relative days
published:>=2026-01-01
Updated date · comparisons, relative days
updated:<30d
Status · published (default), rejected, unknown
status:rejected