GHSA-7v4j-8wvr-v55r
`array!` macro is unsound when its length is impure constant
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.
What each source reports
GitHub AdvisoriesNo score
`array!` macro is unsound when its length is impure constant
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.
- Record
GHSA-7v4j-8wvr-v55r- Updated
- 2026-11-02
OSVNo score
`array!` macro is unsound when its length is impure constant
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.
- Record
GHSA-7v4j-8wvr-v55r- Updated
- 2026-11-02
OSVRUSTSEC-2022-0017No score
`array!` macro is unsound when its length is impure constant
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.
- Record
RUSTSEC-2022-0017- Updated
- 2026-11-02
Affected packages
| Package | Affected | Fixed |
|---|---|---|
array-macrocrates.io | 2.1.0 up to 2.1.2 | 2.1.2 |
History
| Recorded | Changed | Sources |
|---|---|---|
| first indexed | GitHub Advisories, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
GHSA-7v4j-8wvr-v55r is a vulnerability with no CVSS score yet in array-macro, published April 27, 2022. No source lists public exploit code. Fixed in array-macro 2.1.2.
References
github.com/rustsec/advisory-db/blob/main/crates/array-macro/RUSTSEC-2022-0017.md
gitlab.com/KonradBorowski/array-macro/-/issues/5
rustsec.org/advisories/RUSTSEC-2022-0017.html
github.com/xfix/array-macro/commit/d5b63f72090f3809c21ac28f9cfd84f12559bf7d
github.com/advisories/GHSA-7v4j-8wvr-v55r
github.com/xfix/array-macro
crates.io/crates/array-macro