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

Medium 5.7 Published Updated

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

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

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

Which versions are affected by CVE-2023-50711?

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

PackageAffectedFixed in
vmm-sys-util crates.ioFrom 0.5.00.12.0
vmm-sys-util crates.ioFrom 0.5.00.12.0
vmm-sys-util crates.ioFrom 0.5.00.12.0
Linux distribution packages (10)
aws-nitro-enclaves-cli SUSE:Linux Enterprise Module for Public Cloud 15 SP4All versions1.3.0~git1.db34c02-150400.3.6.1
aws-nitro-enclaves-cli SUSE:Linux Enterprise Module for Public Cloud 15 SP5All versions1.3.0~git1.db34c02-150400.3.6.1
aws-nitro-enclaves-cli SUSE:Linux Enterprise Module for Public Cloud 15 SP6All versions1.3.0~git1.db34c02-150600.10.3.1
sevctl SUSE:Linux Enterprise Module for Server Applications 15 SP5All versions0.4.3-150500.3.3.1
sevctl SUSE:Linux Micro 6.0All versions0.4.3-2.1
aws-nitro-enclaves-cli openSUSE:Leap 15.5All versions1.3.0~git1.db34c02-150400.3.6.1
sevctl openSUSE:Leap 15.5All versions0.4.3-150500.3.3.1
aws-nitro-enclaves-cli openSUSE:Leap 15.6All versions1.3.0~git1.db34c02-150600.10.3.1
sevctl openSUSE:TumbleweedAll versions0.4.3-2.1
virtiofsd openSUSE:TumbleweedAll versions1.10.1-1.1

Products include Rust-Vmm Vmm-Sys-Util.

How do I fix CVE-2023-50711?

Upgrade vmm-sys-util to 0.12.0 or later.

Upgrade, and only deserialise data from trusted sources or with an allow-list of types. More about Unsafe deserialization.

Is CVE-2023-50711 being exploited?

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

Sources

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 and 6 more.

Is CVE-2023-50711 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free