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 package | Versions | Reported by |
|---|---|---|
| rust-vmm vm-memory | >= 0.1.0, < 0.12.2 | CVE List |
| vm-memory (crates.io) | before 0.12.2, from 0.0.0-0 before 0.12.2 | GitHub Advisory Database, RustSec Advisory Database |
| vm-memory_project vm-memory | from 0.1.0 before 0.12.2 | NVD |
All scores
| GitHub_M | 2.5low CVSS:3.1 | CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:L |
| GitHub | 2.5low CVSS:3.1 | CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:L |
| RustSec Advisory Database | 2.5low CVSS:3.1 | CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:L |
| NVD | 4.7medium CVSS:3.1 | CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:H |
Classification
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
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2023-41051 changed 2025-02-13 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-49hh-fprx-m68g changed 2026-09-10 | CC-BY-4.0 |
| RustSec Advisory Database | RUSTSEC-2023-0056 changed 2023-11-08 | CC0-1.0 |
| NVD | CVE-2023-41051 changed 2026-06-17 | Public domain |