Advisory Database
  • Advisories
  • Dependency Scanning
  1. cargo
  2. ›
  3. array-macro
  4. ›
  5. GHSA-7v4j-8wvr-v55r

GHSA-7v4j-8wvr-v55r: `array!` macro is unsound when its length is impure constant

June 16, 2022 (updated June 20, 2022)

Affected versions of this crate did substitute the array length provided by an user at compile-time multiple times.

When an impure constant expression is passed as an array length (such as a result of an impure procedural macro), this can result in the initialization of an array with uninitialized types, which in turn can allow an attacker to execute arbitrary code.

The flaw was corrected in commit d5b63f72 by making sure that array length is substituted just once.

References

  • github.com/advisories/GHSA-7v4j-8wvr-v55r
  • github.com/rustsec/advisory-db/blob/main/crates/array-macro/RUSTSEC-2022-0017.md
  • github.com/xfix/array-macro
  • github.com/xfix/array-macro/commit/d5b63f72090f3809c21ac28f9cfd84f12559bf7d
  • gitlab.com/KonradBorowski/array-macro/-/issues/5
  • rustsec.org/advisories/RUSTSEC-2022-0017.html

Code Behaviors & Features

Detect and mitigate GHSA-7v4j-8wvr-v55r with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 2.1.0 before 2.1.2

Fixed versions

  • 2.1.2

Solution

Upgrade to version 2.1.2 or above.

Source file

cargo/array-macro/GHSA-7v4j-8wvr-v55r.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:15:20 +0000.