Advisory

GHSA-7v4j-8wvr-v55r

Also known as: RUSTSEC-2022-0017

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.

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.

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2022-06-16 23:40 UTC
Modified
2023-11-08 04:17 UTC

Affected packages and fixes

array-macro

crates.io · All systems

Affected

  • introduced 2.1.0, fixed 2.1.2 (semver)

Fixed versions

2.1.2

Fix

  • Fixed version 2.1.2
    cargo update -p array-macro --precise 2.1.2

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences