Summary
A broken access control flaw in Canonical LXD's devLXDInstancePatchHandler lets an untrusted guest mount, read, and overwrite another guest's custom storage volume via crafted PATCH requests.
When security.devlxd.management.volumes is enabled, improper validation of volume ownership and permissions makes cross-guest volume access possible from within the container.
Affected context
The vulnerability arises in environments using Canonical LXD where containers interact with the devLXD API exposed via /dev/lxd.
It becomes relevant when the security.devlxd.management.volumes option is enabled, and guests are allowed to manage storage volumes.
In such setups, the devLXDInstancePatchHandler component fails to reliably restrict a guest's operations to its own volumes, enabling unintended cross-guest volume access.
Exploit preconditions
- Attack surface: The devLXD API accessible from within a guest via
/dev/lxd. - Required access: Ability to issue crafted device PATCH requests from an untrusted guest container.
- Trigger point: Handling of PATCH operations in
devLXDInstancePatchHandlerwhensecurity.devlxd.management.volumesis enabled. - Why exploitation is possible: The handler does not correctly enforce volume ownership and authorization checks, allowing a guest to reference and manipulate volumes belonging to other guests.
Why this happens
The core issue is broken access control in the internal management path that processes device PATCH requests for storage volumes.
The devLXDInstancePatchHandler trusts volume identifiers provided by the guest without robust verification that the requesting instance actually owns or is authorized for the target volume.
This maps to CWE-639 (Authorization Bypass Through User-Controlled Key) and CWE-862 (Missing Authorization), where user-controlled resource identifiers are accepted without enforcing proper access control rules.
Potential impact
- A guest may mount another guest's custom storage volume and read its contents.
- A guest could overwrite or corrupt another guest's data on shared storage.
- Sensitive information stored on volumes can be exposed across tenant boundaries.
- Cross-guest interference could lead to application failures or data integrity issues.
General mitigation guidance
Mitigation focuses on tightening authorization checks around volume management operations in the devLXD path.
Common defensive patterns include:
- Enforcing strict ownership validation for every storage volume operation, binding resource identifiers to the requesting instance.
- Applying centralized authorization checks that verify tenant, project, or instance boundaries before performing PATCH actions.
- Reducing the attack surface by disabling or limiting guest-initiated volume management capabilities where they are not required.
- Designing devLXD APIs with secure defaults, ensuring that cross-instance resource references are rejected unless explicitly authorized by higher-privilege control paths.
How teams detect issues like this
Detection typically involves:
- Reviewing authorization logic for devLXD handlers to confirm that all device PATCH paths enforce ownership and permission checks.
- Using static analysis or policy-as-code tools to flag endpoints where user-controlled identifiers are used to locate resources without accompanying access control.
- Instrumenting logging around volume management operations to detect unusual patterns, such as a guest accessing volumes not associated with its instance.
- Incorporating security-focused code review for any changes to instance management APIs, especially those that expose privileged storage operations to guests.

