Summary
LXD contains an improper authorization flaw in instance migration that can let an authenticated user bypass security restrictions enforced by a restricted project. A user with permission to create instances may move a specially configured instance from an unrestricted project into a restricted one without the target policies being properly enforced.
Affected context
The issue occurs in LXD deployments that allow instance migration between projects and use project-level restrictions. It becomes risky when a user has can_create_instances permission in a restricted project and can cause an instance created under less restrictive policies to be accepted by that project without complete configuration validation. Relevant controls may include low-level container settings, device restrictions, and network access policies.
Exploit preconditions
- Attack surface: LXD project and instance migration functionality
- Required access: Authenticated access with permission to create instances in the target restricted project
- Trigger point: Migration or movement of an instance between projects
- Why exploitation is possible: The post-migration validation path does not fully compare the incoming instance configuration with the target project's enforced restrictions
Why this happens
The vulnerability results from an authorization and policy-validation gap in the instance migration workflow. LXD accepts an instance into the target project without consistently reapplying all restrictions that should govern its configuration there. This behavior maps to CWE-862: Missing Authorization, because access-control policy enforcement is incomplete for a sensitive state transition.
Potential impact
- An attacker may bypass restricted-project security policies
- An attacker could obtain configuration or device capabilities not normally permitted
- The migrated instance may enable unintended host or container interactions
- Project isolation could be weakened
- The issue can contribute to privilege escalation or broader infrastructure compromise
General mitigation guidance
Mitigation generally focuses on making authorization and policy validation invariant across every project transition.
Common defensive patterns include:
- Reapply the complete target-project policy set after migration and before activation
- Reject configurations that violate restrictions such as low-level, device, or network controls
- Treat cross-project migration as a privileged operation rather than relying only on instance-creation permissions
- Reduce user and service permissions to the minimum required for their workflows
- Prefer secure-by-default project policies and explicit allowlists for migration destinations
- Prevent untrusted users from creating or modifying instances in less-restricted projects when those instances can later enter restricted projects
- Record and review project-transition decisions and policy-validation failures
How teams detect issues like this
Detection can combine source review, runtime monitoring, and policy enforcement:
- Use static analysis and code review to identify migration paths that do not invoke complete target-policy validation
- Look for authorization checks that occur only at object creation and are not repeated after ownership or project changes
- Monitor audit events for instances moving from unrestricted projects into restricted projects
- Alert on configurations containing capabilities disallowed by the destination project's policy
- Enforce admission policies that independently validate instance configuration against project restrictions
- Use automated security review tools to flag missing authorization checks around state transitions

