Skip to main content
Menu
Advisories

Restricted projects can inject QEMU configuration through a virtual machine disk device path

GHSA-4QMM-CJ9M-MMWRPublished Updated GitHub

Description

Reported from github.com/lxc/incus/security/advisories/GHSA-r69f-pwfc-cwrr

A virtual machine disk device's guest path is accepted without restriction and becomes part of a server-generated device pathname, which is written into the virtual machine's QEMU configuration file as a quoted value. The configuration format has no escaping, so a path containing a quote and a line break ends the quoted value early and adds configuration entries and sections of the client's choosing.

Details

A client able to create a virtual machine in a restricted project can add QEMU configuration that Incus never generated, including a control monitor for the virtual machine's QEMU process, which runs as root. This bypasses restricted.virtual-machines.lowlevel, whose purpose is to deny exactly this kind of low-level control (raw.qemu, raw.qemu.conf and related keys).

Proof of concept

A client able to create a virtual machine in a restricted project can add QEMU configuration that Incus never generated, including a control monitor for the virtual machine's QEMU process, which runs as root. This bypasses restricted.virtual-machines.lowlevel, whose purpose is to deny exactly this kind of low-level control (raw.qemu, raw.qemu.conf and related keys).

Impact

Workarounds

Deny virtual machine creation to untrusted clients, or allow it only in projects whose users you would trust with raw.qemu. A host-side control monitor reachable through this was demonstrated. What can be done from it depends on the QEMU build and on the confinement applied to the QEMU process.

Only projects in which untrusted clients may create virtual machines are affected. Server administrators can set the low-level keys directly and gain nothing from this.

References

GitHub · canonical/lxd