GHSA-7v4j-8wvr-v55r: Array macro `array!` Macro Is Unsound When Vulnerability
MODERATEGHSA-7v4j-8wvr-v55r is a MODERATE `array!` macro is unsound when vulnerability (General Security Weakness) affecting Array macro libraries in the crates.io ecosystem. The issue involves `array!` macro is unsound when its length is impure constant. Remediation is available by upgrading affected packages to version 2.1.2.
GHSA-7v4j-8wvr-v55r at a Glance
How to Fix GHSA-7v4j-8wvr-v55r
To remediate this vulnerability, upgrade all affected Array macro dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade array-macro to 2.1.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for array-macro
How to Check if You Are Affected
To determine whether your application is affected by GHSA-7v4j-8wvr-v55r, inspect your project dependencies for Array macro:
inspect dependencies for array-macro
Analyze the terminal output to locate any version of Array macro in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.1.2), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under General Security Weakness. In Array macro, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
GHSA-7v4j-8wvr-v55r Affected Array macro Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
array-macro
|
crates.io |
≥ 2.1.0
< 2.1.2
|
2.1.2
|
References
Frequently Asked Questions
What is GHSA-7v4j-8wvr-v55r?
Which Array macro versions are affected?
What version fixes GHSA-7v4j-8wvr-v55r?
Is array-macro affected?
What CWE is associated with GHSA-7v4j-8wvr-v55r?
How can I check crates.io dependencies for GHSA-7v4j-8wvr-v55r?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-7v4j-8wvr-v55r",
"modified" : "2022-06-20T18:24:00Z",
"published" : "2022-06-16T23:40:38Z",
"aliases" : [ ],
"summary" : "`array!` macro is unsound when its length is impure constant",
"details" : "Affected versions of this crate did substitute the array length provided by an user at compile-time multiple times.\n\nWhen 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.\n\nThe flaw was corrected in commit [d5b63f72](https://github.com/xfix/array-macro/commit/d5b63f72090f3809c21ac28f9cfd84f12559bf7d) by making sure that array length is substituted just once.\n",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "array-macro"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.1.0"
}, {
"fixed" : "2.1.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/xfix/array-macro/commit/d5b63f72090f3809c21ac28f9cfd84f12559bf7d"
}, {
"type" : "WEB",
"url" : "https://github.com/rustsec/advisory-db/blob/main/crates/array-macro/RUSTSEC-2022-0017.md"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/xfix/array-macro"
}, {
"type" : "WEB",
"url" : "https://gitlab.com/KonradBorowski/array-macro/-/issues/5"
}, {
"type" : "WEB",
"url" : "https://rustsec.org/advisories/RUSTSEC-2022-0017.html"
} ],
"database_specific" : {
"cwe_ids" : [ ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2022-06-16T23:40:38Z",
"nvd_published_at" : null
}
}