# CVE-2023-50711: `serde` deserialization for `FamStructWrapper` lacks bound checks that could potentially lead to out-of-bounds memory access

> Deserialization of FamStructWrapper lacks bound checks, allowing out-of-bounds memory access and potential code execution in Rust VMM components.

- **Severity:** Medium 5.7 (`CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 2 Jan 2024
- **Updated:** 13 Feb 2025
- **Also known as:** AZL-32311, DEBIAN-CVE-2023-50711, GHSA-875g-mfp6-g7f9, RUSTSEC-2024-0002, SUSE-SU-2024:0250-1, SUSE-SU-2024:1966-1, SUSE-SU-2024:1984-1, SUSE-SU-2025:20071-1, UBUNTU-CVE-2023-50711, openSUSE-SU-2024:13624-1, openSUSE-SU-2024:13645-1, openSUSE-SU-2024:13857-1

## What is CVE-2023-50711?

CVE-2023-50711 is a medium-severity unsafe deserialization vulnerability in rust-vmm vmm-sys-util, published on 2 Jan 2024. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

vmm-sys-util is a collection of modules that provides helpers and utilities used by multiple rust-vmm components. Starting in version 0.5.0 and prior to version 0.12.0, an issue in the `FamStructWrapper::deserialize` implementation provided by the crate for `vmm_sys_util::fam::FamStructWrapper` can lead to out of bounds memory accesses. The deserialization does not check that the length stored in the header matches the flexible array length. Mismatch in the lengths might allow out of bounds memory access through Rust-safe methods. The issue was corrected in version 0.12.0 by inserting a check that verifies the lengths of compared flexible arrays are equal for any deserialized header and aborting deserialization otherwise. Moreover, the API was changed so that header length can only be modified through Rust-unsafe code. This ensures that users cannot trigger out-of-bounds memory access from Rust-safe code.

Weakness: CWE-787 (Out-of-bounds Write)

## Which versions are affected by CVE-2023-50711?

3 open source packages ship an affected version, including vmm-sys-util. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `vmm-sys-util` | crates.io | From 0.5.0 | 0.12.0 |
| `vmm-sys-util` | crates.io | From 0.5.0 | 0.12.0 |
| `vmm-sys-util` | crates.io | From 0.5.0 | 0.12.0 |
| `aws-nitro-enclaves-cli` | SUSE:Linux Enterprise Module for Public Cloud 15 SP4 | All versions | 1.3.0~git1.db34c02-150400.3.6.1 |
| `aws-nitro-enclaves-cli` | SUSE:Linux Enterprise Module for Public Cloud 15 SP5 | All versions | 1.3.0~git1.db34c02-150400.3.6.1 |
| `aws-nitro-enclaves-cli` | SUSE:Linux Enterprise Module for Public Cloud 15 SP6 | All versions | 1.3.0~git1.db34c02-150600.10.3.1 |
| `sevctl` | SUSE:Linux Enterprise Module for Server Applications 15 SP5 | All versions | 0.4.3-150500.3.3.1 |
| `sevctl` | SUSE:Linux Micro 6.0 | All versions | 0.4.3-2.1 |
| `aws-nitro-enclaves-cli` | openSUSE:Leap 15.5 | All versions | 1.3.0~git1.db34c02-150400.3.6.1 |
| `sevctl` | openSUSE:Leap 15.5 | All versions | 0.4.3-150500.3.3.1 |
| `aws-nitro-enclaves-cli` | openSUSE:Leap 15.6 | All versions | 1.3.0~git1.db34c02-150600.10.3.1 |
| `sevctl` | openSUSE:Tumbleweed | All versions | 0.4.3-2.1 |
| `virtiofsd` | openSUSE:Tumbleweed | All versions | 1.10.1-1.1 |

Products: Rust-Vmm Vmm-Sys-Util.

## How do I fix CVE-2023-50711?

Upgrade vmm-sys-util to 0.12.0 or later.

## Is CVE-2023-50711 being exploited?

There is no known exploitation of CVE-2023-50711 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-50711 and fix it if it is affected.

What it is: CVE-2023-50711 is a medium-severity unsafe deserialization vulnerability in rust-vmm vmm-sys-util, published on 2 Jan 2024. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2023-50711 in the wild and no public exploit code.

Affected packages and fixed versions:
- vmm-sys-util (crates.io): affected from 0.5.0; fixed in 0.12.0
- vmm-sys-util (crates.io): affected from 0.5.0; fixed in 0.12.0
- vmm-sys-util (crates.io): affected from 0.5.0; fixed in 0.12.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2023-50711/ (Markdown: https://insights.sbomify.com/CVE-2023-50711/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2023-50711
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2023-50711
- OSV: https://osv.dev/vulnerability/CVE-2023-50711

---
From sbomify Insights: https://insights.sbomify.com/CVE-2023-50711/
Summaries are generated and may contain mistakes; the official description above is the record.
