# CVE-2024-31144: Xapi: Metadata injection attack against backup/restore functionality

> A malicious guest VM can spoof metadata backups to achieve privilege escalation or code execution on the Xen host during restore operations.

- **Severity:** Low 3.8 (`CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:L/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 14 Feb 2025
- **Updated:** 26 Apr 2025
- **Also known as:** GHSA-fg38-pgj3-5w5f, UBUNTU-CVE-2024-31144

## What is CVE-2024-31144?

CVE-2024-31144 is a low-severity unsafe deserialization vulnerability in Xen, published on 14 Feb 2025. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

For a brief summary of Xapi terminology, see:

   https://xapi-project.github.io/xen-api/overview.html#object-model-overview 

Xapi contains functionality to backup and restore metadata about Virtual
Machines and Storage Repositories (SRs).

The metadata itself is stored in a Virtual Disk Image (VDI) inside an
SR.  This is used for two purposes; a general backup of metadata
(e.g. to recover from a host failure if the filer is still good), and
Portable SRs (e.g. using an external hard drive to move VMs to another
host).

Metadata is only restored as an explicit administrator action, but
occurs in cases where the host has no information about the SR, and must
locate the metadata VDI in order to retrieve the metadata.

The metadata VDI is located by searching (in UUID alphanumeric order)
each VDI, mounting it, and seeing if there is a suitable metadata file
present.  The first matching VDI is deemed to be the metadata VDI, and
is restored from.

In the general case, the content of VDIs are controlled by the VM owner,
and should not be trusted by the host administrator.

A malicious guest can manipulate its disk to appear to be a metadata
backup.

A guest cannot choose the UUIDs of its VDIs, but a guest with one disk
has a 50% chance of sorting ahead of the legitimate metadata backup.  A
guest with two disks has a 75% chance, etc.

Weakness: CWE-829 (Inclusion of Functionality from Untrusted Control Sphere)

## Which versions are affected by CVE-2024-31144?

It affects 1 product.


Products: Xen Xapi.

## How do I fix CVE-2024-31144?

Apply the vendor's patch.

## Is CVE-2024-31144 being exploited?

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

## Other vulnerabilities in Xen

- [CVE-2020-29487](https://insights.sbomify.com/CVE-2020-29487/): Denial of service in n/a (high 7.5)
- [CVE-2022-33749](https://insights.sbomify.com/CVE-2022-33749/): Denial of service in Xapi (medium 5.3)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-31144 and fix it if it is affected.

What it is: CVE-2024-31144 is a low-severity unsafe deserialization vulnerability in Xen, published on 14 Feb 2025. 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-2024-31144 in the wild and no public exploit code.

Affected product: Xen. No package-level version data is available, so check the vendor advisory linked from the reference page.

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-2024-31144/ (Markdown: https://insights.sbomify.com/CVE-2024-31144/index.md)
```

## Sources

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

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