Skip to main content
Menu
Advisories

Project and per-object authorization bypasses on storage volumes, backups and buckets

GHSA-2X8C-5PFM-M9PGPublished Updated GitHub

Description

Reported from Incus. This advisory was copied from the Incus advisory GHSA-8m9x-vx2q-7f9q.

Several API paths dealing with custom storage volumes, stored backups and storage buckets did not apply the same authorization as the rest of the API. They either skipped a project restriction, acted on an object other than the one the caller was authorized for, or identified an object by a name that is not unique across projects.

The affected areas are:

  • Stored backups of instances, custom volumes and buckets were looked up, renamed and deleted by backup name alone, and instance and bucket backup names were not validated. Bucket backups were additionally matched by a shortened name, and were left on disk when their bucket was deleted.
  • The directory holding recorded command output of an instance could be replaced by a symbolic link through a backup import, and was then followed.
  • The file and SFTP endpoints of storage volumes served a custom volume when asked for an instance or image volume of the same name, and in a cluster authorized the request against the member named in target while serving the volume of the member receiving the request.
  • A cross-member move of a custom volume took the project of the source volume from the request body rather than from the URL the caller was authorized on.
  • In a restricted project using the volumes of the default project, a disk device could mark such a volume as dependent, tying its lifetime to the instance.
  • restricted.cluster.groups was not applied to instance backup imports, nor to custom volumes and buckets created on or moved to a member-local storage pool.
  • The custom volumes named by storage.backups_volume, storage.images_volume and storage.logs_volume could still be backed up, copied, rebuilt, attached or accessed through the file endpoints.
  • The file endpoints accepted the target path from a multipart request body, which was spooled to the host's temporary directory.
  • Automatic snapshot names of custom volumes were derived from every volume of that name on the server rather than from the volume's own project.

Impact

Depending on the path, the attacker is either a client holding a certificate restricted to a project with restricted=true, or a client authorized per object through OpenFGA or an authorization scriptlet.

A client restricted to a project that allows backups (restricted.backups=allow) can delete or rename the stored backup records of instances, volumes and buckets in other projects, and can delete the stored instance backups of every project on the server. A client allowed to manage the backups of one bucket can do the same to the backups of other buckets in its project. After a project is deleted and a project of the same name is created for someone else, the new tenant can download bucket backups left by the previous one, including the bucket's S3 keys.

A restricted client can list, download and delete the recorded command output (record-output) of instances in other projects.

A restricted client of the default project on a server using the storage.*_volume keys can read, replace and erase the stored backups and image files of every project.

A restricted client whose project uses the default project's storage volumes can delete custom volumes of the default project, including ones attached to other projects' instances.

A restricted client can place instances, custom volumes and buckets on cluster members outside of the cluster groups its project is limited to, and can fill the host's temporary directory, outside of any quota, through the file endpoints. It can also learn the snapshot numbering of same-named volumes in other projects and prevent their automatic snapshots from being created.

With OpenFGA or scriptlet authorization, a client granted access to one volume can read and write the files of another custom volume of the same name (an instance's root volume and its data volume, or a volume on another cluster member), and a client allowed to create volumes in a project can relocate and rename custom volumes it has no rights on, losing their snapshots.

Workarounds

There is no single workaround. Exposure can be reduced by:

  • Keeping restricted.backups at its default of block on restricted projects.
  • Not giving tenants access to the default project on servers that set storage.backups_volume, storage.images_volume or storage.logs_volume.
  • Keeping features.storage.volumes=true (the default) on restricted projects.
  • Not relying on restricted.cluster.groups to confine custom volumes, buckets or imported instances to a subset of cluster members.
  • With OpenFGA or scriptlet authorization, granting storage volume and bucket permissions at the project level rather than per object.

References

GitHub · canonical/lxd