{"id":"RUSTSEC-2026-0186","aliases":["RUSTSEC-2026-0186"],"related":[],"kind":"vulnerability","state":"published","title":"Unchecked pointer offset in crate `memmap2`","summary":"Affected versionf of `memmap2` did not perform enough validation on the `offset` and `len` parameters of\n`Mmap::[unchecked_]advise_range()`,\n`MmapMut::[unchecked_]advise_ranage()`\nand `MmapMut::flush[_async]_range()`.\n\nThis can cause undefined behavior due to invalid values being passed to [`pointer::offset()`] and [`pointer::add()`]\nwhen passing an out-of-bounds range to any of the affected functions.\n\nThe flaw was corrected in commit [`cee7cf0`] and released in version `0.9.11`.\n\nThe invalid pointer is not dereferenced,\nbut it is passed to the `madvise` and `msync` syscalls and their Windows equivalents.\n\n[`pointer::offset()`]: https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.offset-1\n[`pointer::add()`]: https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.add-1\n[`cee7cf0`] https://github.com/RazrFalcon/memmap2-rs/pull/170/changes/cee7cf03a9ee095982a3c37b7aac8e3f68f1a00c","summaryFormat":"markdown","summarySource":"rustsec","descriptions":[{"lang":"en","text":"Affected versionf of `memmap2` did not perform enough validation on the `offset` and `len` parameters of\n`Mmap::[unchecked_]advise_range()`,\n`MmapMut::[unchecked_]advise_ranage()`\nand `MmapMut::flush[_async]_range()`.\n\nThis can cause undefined behavior due to invalid values being passed to [`pointer::offset()`] and [`pointer::add()`]\nwhen passing an out-of-bounds range to any of the affected functions.\n\nThe flaw was corrected in commit [`cee7cf0`] and released in version `0.9.11`.\n\nThe invalid pointer is not dereferenced,\nbut it is passed to the `madvise` and `msync` syscalls and their Windows equivalents.\n\n[`pointer::offset()`]: https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.offset-1\n[`pointer::add()`]: https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.add-1\n[`cee7cf0`] https://github.com/RazrFalcon/memmap2-rs/pull/170/changes/cee7cf03a9ee095982a3c37b7aac8e3f68f1a00c","format":"markdown","source":"rustsec"}],"published":"2026-06-20T12:00:00.000Z","modified":"2026-06-22T18:15:03.600Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected","fixed":"0.9.11"}],"ecosystem":"crates.io","package":"memmap2","purl":"pkg:cargo/memmap2","source":"rustsec"}],"references":[{"url":"https://crates.io/crates/memmap2","tags":["package"],"sources":["rustsec"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2026-0186.html","tags":["advisory"],"sources":["rustsec"]},{"url":"https://github.com/RazrFalcon/memmap2-rs/issues/169","tags":["report"],"sources":["rustsec"]},{"url":"https://github.com/RazrFalcon/memmap2-rs/pull/170","tags":["web"],"sources":["rustsec"]}],"credits":[],"sources":[{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2026-0186","url":"https://rustsec.org/advisories/RUSTSEC-2026-0186.html","licence":"CC0-1.0","modified":"2026-06-22T18:15:03.600Z"}],"updatedAt":"2026-11-25T22:56:43.373Z"}