Skip to main content
Menu
Advisories

Restricted project users can read and write host devices through the file transfer API

GHSA-XHF6-9XGM-CJRCPublished Updated GitHub

Description

Reported from github.com/lxc/incus/security/advisories/GHSA-xw8w-vwh3-9w5v

Incus serves file transfers for instances and custom storage volumes (incus file pull, incus file push, incus file mount and the matching incus storage volume file commands) through a helper process that opens the requested path inside the instance or volume.

For a stopped container or a custom volume, that helper runs as root on the host, outside of any user namespace or device restriction. It opened whatever the path pointed to, including block and character device nodes, which then gave access to the corresponding host device.

A user can place a device node in an instance or volume without ever running anything in it, by importing an image or a backup that already contains one. Images and instance backups only had device nodes removed from /dev, and custom volume backups were unpacked as is.

The same helper also opened named pipes (FIFOs). Opening one blocks until another process opens the other end, so a request for such a path never completed and kept the helper and its connection busy.

Workaround

There is no complete workaround. On affected versions, do not allow untrusted users to import images or backups, or to create instances from images that were not built by a trusted party.

Impact

A client restricted to a project in which it can import images or backups can read and write any block or character device of the host, by device number. This exposes all data stored on the host, including other instances' storage, and writing to the host's disks allows taking over the host.

A user of an instance can also hang file transfer requests against that instance by having them open a FIFO.

References

GitHub · canonical/lxd