`array!` macro is unsound when its length is impure constant
Key facts
- Attack vector
- —
- Privileges required
- —
- User interaction
- —
- Attack complexity
- —
- Impact type
- —
- Confidentiality · integrity · availability
- —
- Fix status
- Fixed
No CVSS vector from any source. Fix status from GitHub.
Summary
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](https://github.com/xfix/array-macro/commit/d5b63f72090f3809c21ac28f9cfd84f12559bf7d) by making sure that array length is substituted just once.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | array-macro (crates.io) | 2.1.0 to before 2.1.2 | 2.1.2 | Patch available | GHSA-7v4j-8wvr-v55r |
- array-macro (crates.io) Vendor— Affected 2.1.0 to before 2.1.2 Fixed in 2.1.2 Patch available GHSA-7v4j-8wvr-v55r
Remediation
- Fix · GHSA-7v4j-8wvr-v55r array-macro (crates.io) Fixed in 2.1.2 Advisory →
Timeline
- 2026-10-03 Threatist record created from GHSA-7v4j-8wvr-v55r
References
Other 5
- https://github.com/xfix/array-macro/commit/d5b63f72090f3809c21ac28f9cfd84f12559bf7d
- https://github.com/rustsec/advisory-db/blob/main/crates/array-macro/RUSTSEC-2022-0017.md
- https://github.com/xfix/array-macro
- https://gitlab.com/KonradBorowski/array-macro/-/issues/5
- https://rustsec.org/advisories/RUSTSEC-2022-0017.html
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences