Read the docs
TI-2022-26549 Aliases GHSA-83gg-pwxf-jr89

`array!` macro is unsound in presence of traits that implement methods it calls internally

Priority LOW 38Published · Updated

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 called some methods using auto-ref. The affected code looked like this. ```rust let mut arr = $crate::__core::mem::MaybeUninit::uninit(); let mut vec = $crate::__ArrayVec::<T>::new(arr.as_mut_ptr() as *mut T); ``` In this case, the problem is that `as_mut_ptr` is a method of `&mut MaybeUninit`, not `MaybeUninit`. This made it possible for traits to hijack the method calls in order to cause unsoundness. ```rust trait AsMutPtr<T> { fn as_mut_ptr(&self) -> *mut T; } impl<T> AsMutPtr<T> for std::mem::MaybeUninit<T> { fn as_mut_ptr(&self) -> *mut T { std::ptr::null_mut() } } array![0; 1]; ``` The flaw was corrected by explicitly referencing variables in macro body in order to avoid auto-ref.

Why it matters now

Fix Fixed array-macro (crates.io): 1.0.5

SSVC decision points

Not available: CISA has not published SSVC decision points for this record.

Affected products

VendorProductAffected versionsFixed inStatusSource
—array-macro (crates.io)0.1.2 to before 1.0.51.0.5Patch availableGHSA-83gg-pwxf-jr89
  • array-macro (crates.io) Vendor— Affected 0.1.2 to before 1.0.5 Fixed in 1.0.5 Patch available GHSA-83gg-pwxf-jr89

Remediation

  • Fix · GHSA-83gg-pwxf-jr89 array-macro (crates.io) Fixed in 1.0.5 Advisory →

Timeline

  1. 2026-10-03 Threatist record created from GHSA-83gg-pwxf-jr89

References

Sources

This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences