🛡️ GHSA-83gg-pwxf-jr89 — array-macro

⚪ Unknown ✅ No Known Exploit OSV
N/A
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

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

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.

Affected software

GHSA-83gg-pwxf-jr89 is recorded against 1 package.

  • array-macro

Timeline and source

Published on 16 June 2022 and last revised on 8 November 2023. No public exploit is currently recorded for this entry. Record sourced from OSV.

References

github.com (Web)
github.com (Web)
github.com (Package)
gitlab.com (Web)
rustsec.org (Web)

Details

Severity Unknown
CVSS Score N/A
CVSS Vector N/A
CWE N/A
Public Exploit ✅ No
Source OSV
Published 2022-06-16
Updated 2026-08-20
Modified 2023-11-08
Fix URL N/A

Affected Packages

Software From version Fixed in
array-macro

Similar Threats

Free Vulnerability Check

Is your site affected by GHSA-83gg-pwxf-jr89?

BotEraser helps you identify potentially vulnerable plugins and themes by checking your installation against GHSA-83gg-pwxf-jr89 and other known CVE records.

Scan My Site Free →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.

Browse related advisories

All advisoriesGitHub AdvisoryGitHub Advisory Undated