CVE-2023-41051
JSON

2.5low

Default functions in VolatileMemory trait lack bounds checks in vm-memory

Severity
2.5low CVSS:3.1 by GitHub_M
Exploit likelihood
0.26% (higher than 18% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-49hh-fprx-m68gRUSTSEC-2023-0056

Description

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.

Affected

Product or packageVersionsReported by
rust-vmm vm-memory>= 0.1.0, < 0.12.2CVE List
vm-memory (crates.io)before 0.12.2, from 0.0.0-0 before 0.12.2GitHub Advisory Database, RustSec Advisory Database
vm-memory_project vm-memoryfrom 0.1.0 before 0.12.2NVD

All scores

GitHub_M2.5low CVSS:3.1CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:L
GitHub2.5low CVSS:3.1CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:L
RustSec Advisory Database2.5low CVSS:3.1CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:L
NVD4.7medium CVSS:3.1CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:H

Classification

CWE-125

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

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.

GitHub Advisory Database
Impact

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.

Patches

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.

Workarounds

Not Required

References

https://github.com/rust-vmm/vm-memory/commit/aff1dd4a5259f7deba56692840f7a2d9ca34c9c8 https://crates.io/crates/vm-memory/0.12.2

RustSec Advisory Database

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.

NVD (es)

En un Monitor de Máquina Virtual (VMM) típico hay varios componentes, como el cargador de arranque, los controladores de dispositivos virtuales, los controladores virtio backend y los controladores vhost, que necesitan acceder a la memoria física de la VM. La caja rust vm-memory proporciona un conjunto de rasgos para desacoplar los consumidores de memoria VM de los proveedores de memoria VM. Se ha descubierto un problema en las implementaciones por defecto de las funciones trait `VolatileMemory::{get_atomic_ref, aligned_as_ref, aligned_as_mut, get_ref, get_array_ref}`, que permite el acceso a memoria fuera de los límites si la función `VolatileMemory::get_slice` devuelve una `VolatileSlice` cuya longitud es menor que el argumento `count` de la función.No afecta a las implementaciones de `get_slice` proporcionadas en `vm_memory`.Los usuarios de implementaciones personalizadas de `VolatileMemory` pueden verse afectados si la implementación personalizada no se adhiere a la documentación de `get_slice`. El problema comenzó en la versión 0.1.0 pero se solucionó en la versión 0.12.2 insertando una comprobación que verifica que la `VolatileSlice` devuelta por `get_slice` tiene la longitud correcta. Se recomienda a los usuarios que actualicen. No se conocen soluciones para este problema.

References

https://github.com/rust-vmm/vm-memory/security/advisories/GHSA-49hh-fprx-m68gvendor-advisory, web
https://github.com/rust-vmm/vm-memory/commit/aff1dd4a5259f7deba56692840f7a2d9ca34c9c8patch, web
https://crates.io/crates/vm-memory/0.12.2product, web
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XZGJL6BQLU4XCPQLLTW4GSSBTNQXB3TI/
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/IPXRXD5VXBZHBGMUM77B52CJJMG7EJGI/
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/SYM6CYW2DWRHRAVL2HYTQPXC3J2V77J4/
https://nvd.nist.gov/vuln/detail/CVE-2023-41051advisory
https://github.com/rust-vmm/vm-memory/issues/250report, web
https://github.com/rust-vmm/vm-memorypackage
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/IPXRXD5VXBZHBGMUM77B52CJJMG7EJGIweb
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/SYM6CYW2DWRHRAVL2HYTQPXC3J2V77J4web
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XZGJL6BQLU4XCPQLLTW4GSSBTNQXB3TIweb

Sources

SourceRecordLicence
CVE ListCVE-2023-41051 changed 2025-02-13CVE Terms of Use
GitHub Advisory DatabaseGHSA-49hh-fprx-m68g changed 2026-09-10CC-BY-4.0
RustSec Advisory DatabaseRUSTSEC-2023-0056 changed 2023-11-08CC0-1.0
NVDCVE-2023-41051 changed 2026-06-17Public domain