Skip to main content
Menu
Advisories

Restricted clients can exhaust LXD memory through unbounded request bodies on upload endpoints

GHSA-XCGC-PM37-9FRMPublished Updated GitHub

Description

Reported from github.com/lxc/incus/security/advisories/GHSA-cxqx-x785-5926

Request bodies are limited to 1MiB except on the endpoints that accept large uploads, such as instance creation (backup import), custom volume creation (backup and ISO import) and file upload. Those endpoints also accept a JSON body, or in the case of file upload a symlink target, which they read entirely into memory before processing. Those branches were not subject to any size limit.

Details

A client allowed to create instances, custom volumes or storage buckets in a project, or to upload files to an instance or custom volume, which includes a restricted client in its own project, can make incusd allocate memory proportional to an arbitrarily large request body. Repeated or concurrent requests can exhaust the host's memory and get the daemon killed, interrupting the API for every project.

Neither instance nor project limits apply to this memory.

Proof of concept

A client allowed to create instances, custom volumes or storage buckets in a project, or to upload files to an instance or custom volume, which includes a restricted client in its own project, can make incusd allocate memory proportional to an arbitrarily large request body. Repeated or concurrent requests can exhaust the host's memory and get the daemon killed, interrupting the API for every project.

Neither instance nor project limits apply to this memory.

Impact

A client allowed to create instances, custom volumes or storage buckets in a project, or to upload files to an instance or custom volume, which includes a restricted client in its own project, can make incusd allocate memory proportional to an arbitrarily large request body. Repeated or concurrent requests can exhaust the host's memory and get the daemon killed, interrupting the API for every project.

Neither instance nor project limits apply to this memory.

References

GitHub · canonical/lxd