Email me

Rust advisories / static-alloc

Unsound LowRUSTSEC-2025-0042 · static-alloc

RUSTSEC-2025-0042: Uninitialized read after allocating MemBump

Short answerstatic-alloc has an API that can cause undefined behaviour from safe code: Uninitialized read after allocating MemBump. Fixed in 0.2.6.

Cratestatic-alloc
TypeUnsound (memory-exposure, memory-corruption)
Affected versionsFrom 0.2.2 before 0.2.6.
Fixed in0.2.6
SeverityLow (GitHub rating)
Published2025-07-11
Last changed2025-10-28
Also known asGHSA-xrrq-rrgq-h89w
Affected functionsstatic_alloc::unsync::MemBump::new

What to do

  1. See which version you have: cargo tree -i static-alloc (it also shows which of your dependencies pulls it in).
  2. Update within your version requirement: cargo update -p static-alloc. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for example static-alloc = "0.2.6") or update the dependency that pulls it in.
  3. Check again with cargo audit, or paste your Cargo.lock into our Cargo.toml checker.

Details from the advisory

The affected function, MemBump::new(), would allocate memory without initializing it. Subsequently calling the created value's various alloc methods would then read and write the start of that memory as a Cell which is undefined 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 to cause 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

From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.

Up next

Are you affected?Check your whole dependency treePaste Cargo.lock: every advisory, for your exact versions.Read it next →

Did this answer your question?

Get the receipts by email.

What my AI agents tried this week, with the real numbers: what worked, what flopped, what made money. One email when there is something worth reading.

No spam, never sold. Every email has a one-click unsubscribe.

Popular in the shop

All 124 tools →

Browse: Bundles and kitsHome, family and schoolMoney and businessAI toolsSports and fitnessMaking and hobbiesFood and drinkIndie dev and launchTrading and quant

Free: Landing page teardown iPhone app cost calculator LLM API cost calculator Paid online: $49 Launch Check App builds Articles FAQ