CVE-2023-41051: Vm memory Default Functions Vulnerability

LOW
Advisory Identifier: GHSA-49hh-fprx-m68g
CVSS 2.5
CWE-125
Published
Advisory Summary

CVE-2023-41051 is a LOW (CVSS 2.5) default functions vulnerability (CWE-125: Out-of-bounds Read) affecting Vm memory libraries in the crates.io ecosystem. The issue involves default functions in volatilememory trait lack bounds checks, potentially leading to out-of-bounds memory accesses. Remediation is available by upgrading affected packages to version 0.12.2.

CVE-2023-41051 at a Glance

CVE Identifier CVE-2023-41051
GHSA Identifier GHSA-49hh-fprx-m68g
Severity LOW
CVSS v3.1 Base Score 2.5
CWE Classification CWE-125: Out-of-bounds Read
Affected Product Vm memory
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 2.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:L).

Attack Vector Local (AV:L)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability Low (A:L)

How to Fix CVE-2023-41051

To remediate this vulnerability, upgrade all affected Vm memory dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

vm-memory fixed: 0.12.2
Upgrade vm-memory to 0.12.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for vm-memory

How to Check if You Are Affected

To determine whether your application is affected by CVE-2023-41051, inspect your project dependencies for Vm memory:

inspect dependencies for vm-memory

Analyze the terminal output to locate any version of Vm memory in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.12.2), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-125: Out-of-bounds Read, where the product reads data past the end, or before the beginning, of the intended buffer. In Vm memory, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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

CVE-2023-41051 Affected Vm memory Versions

1 component(s)
Fixed Versions:
0.12.2
Product / Package Ecosystem Affected Versions Fixed Version
vm-memory
crates.io
< 0.12.2
0.12.2

References

Frequently Asked Questions

What is CVE-2023-41051?
CVE-2023-41051 is a security vulnerability in Vm memory involving Default functions in VolatileMemory trait lack bounds checks, potentially leading to out-of-bounds memory accesses under CWE-125: Out-of-bounds Read.
Which Vm memory versions are affected?
Affected versions include releases prior to 0.12.2 across affected packages: vm-memory.
What version fixes CVE-2023-41051?
Upgrading to 0.12.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is vm-memory affected?
Yes, vm-memory is affected in releases prior to 0.12.2. Upgrade your dependency to 0.12.2 or later.
What is the CVSS score of CVE-2023-41051?
CVE-2023-41051 has a CVSS v3.1 base score of 2.5 (LOW) with vector string CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:L.
What CWE is associated with CVE-2023-41051?
CVE-2023-41051 is classified under CWE-125: Out-of-bounds Read (The product reads data past the end, or before the beginning, of the intended buffer.).
How can I check crates.io dependencies for CVE-2023-41051?
Run the dependency tree command: 'inspect dependencies for vm-memory'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-49hh-fprx-m68g",
  "modified" : "2025-02-13T19:11:48Z",
  "published" : "2023-09-04T16:35:37Z",
  "aliases" : [ "CVE-2023-41051" ],
  "summary" : "Default functions in VolatileMemory trait lack bounds checks, potentially leading to out-of-bounds memory accesses",
  "details" : "### Impact\nAn 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.\n\n### Patches\nThe 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.\n\n### Workarounds\nNot Required\n\n### References\nhttps://github.com/rust-vmm/vm-memory/commit/aff1dd4a5259f7deba56692840f7a2d9ca34c9c8\nhttps://crates.io/crates/vm-memory/0.12.2",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "vm-memory"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.12.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/rust-vmm/vm-memory/security/advisories/GHSA-49hh-fprx-m68g"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-41051"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rust-vmm/vm-memory/issues/250"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rust-vmm/vm-memory/commit/aff1dd4a5259f7deba56692840f7a2d9ca34c9c8"
  }, {
    "type" : "WEB",
    "url" : "https://crates.io/crates/vm-memory/0.12.2"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/rust-vmm/vm-memory"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/IPXRXD5VXBZHBGMUM77B52CJJMG7EJGI"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/SYM6CYW2DWRHRAVL2HYTQPXC3J2V77J4"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XZGJL6BQLU4XCPQLLTW4GSSBTNQXB3TI"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2023-0056.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-125" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-09-04T16:35:37Z",
    "nvd_published_at" : "2023-09-01T19:15:42Z"
  }
}