medium
`array!` macro is unsound when its length is impure constant
- Severity
- medium rating by GitHub
- Published
- Last changed
- Also known as
- RUSTSEC-2022-0017
Description
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| array-macro (crates.io) | from 2.1.0 before 2.1.2 | GitHub Advisory Database, RustSec Advisory Database |
What each source says
GitHub Advisory Database
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.
RustSec Advisory Database
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
Sources
| Source | Record | Licence |
|---|---|---|
| GitHub Advisory Database | GHSA-7v4j-8wvr-v55r changed 2023-11-08 | CC-BY-4.0 |
| RustSec Advisory Database | RUSTSEC-2022-0017 changed 2023-11-08 | CC0-1.0 |