Описание
Incus has a project restriction bypass for custom volume copy across projects
Summary
Missing authorization checks exist for custom volume copying where an attacker who knows the name of a project that they don't have access to and the name of a custom volume in that project can copy the custom volume to a new project. This issue could allow an attacker to access secrets in custom volumes they are not authorized to access.
Details
The storage volume creation handler authorizes creation in the target project, then passes req.Source.Project into the custom-volume copy path without checking that the caller can view the source volume. req.Source.Project is the attacker-controlled field. It is resolved to a storage volume project name and passed directly to CreateCustomVolumeFromCopy. No allowPermission or entitlement check (e.g. CanView on the source volume) is performed.
The copy must occur on the same server. However, once the copy has been done, nothing prevents a malicious actor from moving the volume to another server.
PoC
Setup
Assume the target server is remotely accessible and a user/certificate has been added.
Exploitation
The below script was partly generated. To copy the secret instance to the default project, the following command can be used.
Wait a bit for the custom volume to be copied, then incus storage volume ls remote:default to see the copied instance.
Impact
An attacker can copy instances they don't normally have access to, possibly leading to information disclosure.
Пакеты
github.com/lxc/incus/v7
< 7.2.0
7.2.0
github.com/lxc/incus/v6
<= 6.23.0
Отсутствует
github.com/lxc/incus
<= 0.7.0
Отсутствует
Связанные уязвимости
Incus is a system container and virtual machine manager. Prior to version 7.2.0, missing authorization checks exist for custom volume copying where an attacker knowing the name of a project that they don't have access to and the name of a custom volume in that project can copy the custom volume to a new project. This issue could allow an attacker to access secrets in custom volumes they are not authorized to access. Version 7.2.0 patches the issue.
Incus is a system container and virtual machine manager. Prior to version 7.2.0, missing authorization checks exist for custom volume copying where an attacker knowing the name of a project that they don't have access to and the name of a custom volume in that project can copy the custom volume to a new project. This issue could allow an attacker to access secrets in custom volumes they are not authorized to access. Version 7.2.0 patches the issue.
Incus is a system container and virtual machine manager. Prior to vers ...