Canonical LXD versions 4.12 through 6.7 contain an incomplete denylist in isVMLowLevelOptionForbidden (lxd/project/limits/permissions.go), which omits raw.apparmor and raw.qemu.conf from the set of keys blocked under the restricted.virtual-machines.lowlevel=block project restriction. A remote attacker with can_edit permission on a VM instance in a restricted project can inject an AppArmor rule and a QEMU chardev configuration that bridges the LXD Unix socket into the guest VM, enabling privilege escalation to LXD cluster administrator and subsequently to host root.
The isVMLowLevelOptionForbidden function in lxd/project/limits/permissions.go does not include raw.apparmor and raw.qemu.conf keys in the list of options blocked by the restricted.virtual-machines.lowlevel=block restriction. An attacker with can_edit permission on a VM instance in a restricted project can inject custom AppArmor rules and QEMU chardev configuration that creates a bridge between the LXD Unix socket and the guest machine. The access obtained to the LXD socket enables issuing commands with cluster administrator privilege level, ultimately leading to root escalation on the host.
An attacker can obtain full administrator privileges of the LXD cluster and subsequently take control of the host system with root privileges, resulting in complete infrastructure compromise.
Apply patches available from the vendor according to references (pull request #17909 in canonical/lxd repository and advisory GHSA-fm2x-c5qw-4h6f). An upgrade to version higher than 6.7 is recommended. Temporarily, consider restricting can_edit permissions on VM instances in projects with lowlevel=block restriction enabled.
Canonical LXD in versions 4.12 through 6.7 inclusive, when configured with restricted.virtual-machines.lowlevel=block restriction in projects with virtual machines.
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:HCanonical Lxd
APPCanonical4.12 – 5.0.65.21.0 – 5.21.46.0 – 6.7
Related vulnerabilities
Canonical LXD: pominięcie ograniczeń projektu przy imporcie backupu
Canonical LXD: privilege escalation do admina klastra przez brak walidacji pola Type
LXD: privilege escalation przez przywracanie snapshotów z pominięciem polityk
Canonical LXD: nieuprawniony dostęp do woluminów innych gości przez /dev/lxd
Privilege Escalation in operations API in Canonical LXD <6.5 on multiple platforms allows attacker with read p...