Skip to main content
Menu
Advisories

Local users can hijack VM NBD migration and disk-export sockets

GHSA-9Q32-28XC-RJ2VPublished Updated GitHub

Description

Reported from github.com/lxc/incus/security/advisories/GHSA-3rgf-297m-775x

Incus runs NBD servers over unix sockets for two virtual machine operations: migrating a VM's disk to another server, and the disk export and attach path. These sockets were created as abstract unix sockets.

Abstract unix sockets live in the network namespace rather than on the filesystem and are not subject to any permission check, so any process in the host network namespace can connect to them. Their names are also visible to any local user through /proc/net/unix.

Details

While a VM migration or disk export is in progress, any local user on the host can connect to the NBD socket and read or write the virtual machine's disk as it is being transferred.

This gives full read access to the guest's disk contents and the ability to tamper with the data in flight. On the receiving side of a migration it means controlling the resulting VM's disk, and therefore code execution inside that guest. No privileges beyond a local unprivileged account are required; the attacker only needs to connect while the operation runs, which they can detect from /proc/net/unix.

Only virtual machines are affected; containers do not use these sockets.

Proof of concept

None. There is no configuration based workaround short of not running VM migrations or disk exports on hosts that have untrusted local users.

..................

Impact

There is no configuration based workaround short of not running VM migrations or disk exports on hosts that have untrusted local users.

...................

References

GitHub · canonical/lxd