Skip to content

Commit c29b239

Browse files
authored
Add advisory for using impure constants in array-macro (#1224)
1 parent b2ba503 commit c29b239

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
```toml
2+
[advisory]
3+
id = "RUSTSEC-0000-0000"
4+
package = "array-macro"
5+
date = "2022-04-27"
6+
url = "https://gitlab.com/KonradBorowski/array-macro/-/issues/5"
7+
categories = ["code-execution", "memory-corruption", "memory-exposure"]
8+
informational = "unsound"
9+
10+
[versions]
11+
patched = [">= 2.1.2"]
12+
unaffected = ["< 2.1.0"]
13+
```
14+
15+
# `array!` macro is unsound when its length is impure constant
16+
17+
Affected versions of this crate did substitute the array length provided by an user at compile-time multiple times.
18+
19+
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.
20+
21+
The flaw was corrected in commit [d5b63f72](https://gitlab.com/KonradBorowski/array-macro/-/commit/d5b63f72090f3809c21ac28f9cfd84f12559bf7d) by making sure that array length is substituted just once.

0 commit comments

Comments
 (0)