Email me

Rust advisories / vm-memory

Unsound LowRUSTSEC-2023-0056 · vm-memory

RUSTSEC-2023-0056: Default functions in VolatileMemory trait lack bounds checks, potentially leading to out-of-bounds memory accesses

Short answervm-memory has an API that can cause undefined behaviour from safe code: Default functions in VolatileMemory trait lack bounds checks, potentially leading to out-of-bounds memory accesses. Fixed in 0.12.2.

Cratevm-memory
TypeUnsound (memory-exposure)
Affected versionsBefore 0.12.2.
Fixed in0.12.2
SeverityLow, CVSS 2.5
CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:L
Published2023-09-01
Last changed2023-11-08
Also known asCVE-2023-41051, GHSA-49hh-fprx-m68g
Affected functionsvm_memory::volatile_memory::VolatileMemory::aligned_as_mut, vm_memory::volatile_memory::VolatileMemory::aligned_as_ref, vm_memory::volatile_memory::VolatileMemory::get_array_ref, vm_memory::volatile_memory::VolatileMemory::get_atomic_ref, vm_memory::volatile_memory::VolatileMemory::get_ref

What to do

  1. See which version you have: cargo tree -i vm-memory (it also shows which of your dependencies pulls it in).
  2. Update within your version requirement: cargo update -p vm-memory. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for example vm-memory = "0.12.2") 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

An issue was discovered in the default implementations of the VolatileMemory::{get_atomic_ref, aligned_as_ref, aligned_as_mut, get_ref, get_array_ref} trait functions, which allows out-of-bounds memory access if the VolatileMemory::get_slice function returns a VolatileSlice whose length is less than the function’s count argument. No implementations of get_slice provided in vm_memory are affected. Users of custom VolatileMemory implementations may be impacted if the custom implementation does not adhere to get_slice's documentation.

The issue started in version 0.1.0 but was fixed in version 0.12.2 by inserting a check that verifies that the VolatileSlice returned by get_slice is of the correct length.

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.

Other advisories for vm-memory

Full security history of vm-memory

Up next

Same cratevm-memory: security historyEvery advisory for this crate, and whether it is safe to use today.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