Advisory Database
  • Advisories
  • Dependency Scanning
  1. cargo
  2. ›
  3. static-alloc
  4. ›
  5. GHSA-xrrq-rrgq-h89w

GHSA-xrrq-rrgq-h89w: static-alloc vulnerability leads to uninitialized read after allocating MemBump

July 11, 2025

The affected function, MemBump::new(), would allocate memory without initializing it. Subsequently calling the created value’s various allocmethods would then read and write the start of that memory as a Cell which isundefined behavior. Instead, it should zero initialize the start of the allocated memory.

For instance, some values could violate the internal invariants of the type and cause an assertion failure. Nevertheless, no deterministic read is known tocause further uninitialized memory to be exposed.

Affected downstream users that can not upgrade are advised to call MemBump::reset immediately after allocation to manually perform the missing write of the counter best-as-possible.

The flaw was corrected in commit d8d6a7d096d3aaafd963b356a8f1bbd8d26fd967 by zeroing the Cell at the start of the allocated memory.

References

  • github.com/197g/static-alloc
  • github.com/197g/static-alloc/issues/81
  • github.com/197g/static-alloc/pull/82/commits/d8d6a7d096d3aaafd963b356a8f1bbd8d26fd967
  • github.com/advisories/GHSA-xrrq-rrgq-h89w
  • rustsec.org/advisories/RUSTSEC-2025-0042.html

Code Behaviors & Features

Detect and mitigate GHSA-xrrq-rrgq-h89w with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 0.2.2 before 0.2.6

Fixed versions

  • 0.2.6

Solution

Upgrade to version 0.2.6 or above.

Weakness

  • CWE-908: Use of Uninitialized Resource

Source file

cargo/static-alloc/GHSA-xrrq-rrgq-h89w.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Tue, 19 Aug 2025 12:18:31 +0000.