Email me

Rust advisories / memmap2

UnsoundRUSTSEC-2026-0186 · memmap2

RUSTSEC-2026-0186: Unchecked pointer offset in crate `memmap2`

Short answermemmap2 has an API that can cause undefined behaviour from safe code: Unchecked pointer offset in crate `memmap2`. Fixed in 0.9.11.

Cratememmap2
TypeUnsound
Affected versionsBefore 0.9.11.
Fixed in0.9.11
Severitynot scored
Published2026-06-20
Last changed2026-06-22
Also known asnone
Affected functionsmemmap2::Mmap::advise_range, memmap2::Mmap::unchecked_advise_range, memmap2::MmapMut::advise_range, memmap2::MmapMut::flush_async_range, memmap2::MmapMut::flush_range, memmap2::MmapMut::unchecked_advise_range

What to do

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

Affected versionf of memmap2 did not perform enough validation on the offset and len parameters of Mmap::[unchecked_]advise_range(), MmapMut::[unchecked_]advise_ranage() and MmapMut::flush[_async]_range().

This can cause undefined behavior due to invalid values being passed to pointer::offset() and pointer::add() when passing an out-of-bounds range to any of the affected functions.

The flaw was corrected in commit [cee7cf0] and released in version 0.9.11.

The invalid pointer is not dereferenced, but it is passed to the madvise and msync syscalls and their Windows equivalents.

[cee7cf0] https://github.com/RazrFalcon/memmap2-rs/pull/170/changes/cee7cf03a9ee095982a3c37b7aac8e3f68f1a00c

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

Same cratememmap2: 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