{"id":"CVE-2023-41051","published":"2023-09-01T18:22:53Z","modified":"2025-02-13T17:08:47Z","title":"Default functions in VolatileMemory trait lack bounds checks in vm-memory","vendor":"rust-vmm","product":"vm-memory","tier":"tail","description":{"text":"In a typical Virtual Machine Monitor (VMM) there are several components, such as boot loader, virtual device drivers, virtio backend drivers and vhost drivers, that need to access the VM physical memory. The vm-memory rust crate provides a set of traits to decouple VM memory consumers from VM memory providers. 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. Users are advised to upgrade. There are no known workarounds for this issue.","provenance":"source","from":"CVE.org"},"cvss":{"score":2.5,"severity":"LOW","version":"3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:L","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00309,"percentile":0.16188,"provenance":"source"},"cwes":[{"id":"CWE-125","name":"Out-of-bounds Read"}],"references":[{"url":"https://github.com/rust-vmm/vm-memory/security/advisories/GHSA-49hh-fprx-m68g","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/rust-vmm/vm-memory/commit/aff1dd4a5259f7deba56692840f7a2d9ca34c9c8","tags":["x_refsource_MISC"]},{"url":"https://crates.io/crates/vm-memory/0.12.2","tags":["x_refsource_MISC"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XZGJL6BQLU4XCPQLLTW4GSSBTNQXB3TI/","tags":[]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/IPXRXD5VXBZHBGMUM77B52CJJMG7EJGI/","tags":[]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/SYM6CYW2DWRHRAVL2HYTQPXC3J2V77J4/","tags":[]}],"priority":{"score":5.0,"factors":[{"name":"EPSS percentile","points":3.24},{"name":"CVSS severity","points":1.75}]},"vendorSlug":"rust-vmm","affectedVersions":[{"vendor":"rust-vmm","product":"vm-memory","versions":[">= 0.1.0, < 0.12.2"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2024-09-27T15:00:41.219797Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"crates.io","package":"vm-memory","vulnerableRanges":["<0.12.2",">=0.0.0-0, <0.12.2"],"patched":["0.12.2"],"from":["GHSA-49hh-fprx-m68g","RUSTSEC-2023-0056"],"provenance":"source"}],"summary":{"text":"The flaw is in the default implementations of the VolatileMemory trait functions (get_atomic_ref, aligned_as_ref, aligned_as_mut, get_ref and get_array_ref) in the vm-memory Rust crate from rust-vmm, which lack bounds checks when a custom get_slice implementation returns a slice shorter than requested. An attacker can cause out-of-bounds memory access only when a custom VolatileMemory implementation violates get_slice's documented contract, since no get_slice implementations provided in vm-memory are affected; this requires local access and user interaction, with no authentication needed.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:21:25Z"},"euvd":{"id":"EUVD-2023-2414","exploited":false,"provenance":"source"}}