Summary
A critical authorization flaw in LXD can allow an authenticated attacker to bypass target project restrictions during cross-project instance copies. If configuration checks occur before configuration merging is complete, disallowed high-privilege settings may be copied into a restricted project.
Affected context
The vulnerability may affect LXD environments that permit authenticated users to copy instances between projects while applying target-project configuration restrictions. The risk arises when authorization checks evaluate an incomplete configuration state before the final merged configuration is available.
Exploit preconditions
- Attack surface: LXD cross-project instance copy operations
- Required access: Authenticated access sufficient to initiate or influence an instance copy
- Trigger point: Authorization checks performed during target-project configuration processing
- Why exploitation is possible: The check may occur before configuration merging finishes, allowing the final instance configuration to differ from the state that was authorized
Why this happens
The underlying bug is a time-of-check to time-of-use condition, mapped primarily to CWE-367. LXD evaluates project restrictions against an intermediate configuration state, then uses a subsequently merged configuration without revalidating the complete result. This sequencing error can cause authorization decisions to be made against data that no longer represents the operation being performed. The resulting access-control failure also relates to CWE-863: Incorrect Authorization.
Potential impact
- An attacker may copy instances with disallowed high-privilege configurations
- Project isolation controls could be bypassed
- Restricted projects may contain instances with elevated capabilities
- Attackers could gain access to protected host, network, or storage resources
- Confidentiality, integrity, and availability of workloads could be affected
General mitigation guidance
Mitigation generally focuses on making authorization decisions against the final, canonical configuration and preventing state changes between validation and use.
Common defensive patterns include:
- Complete configuration merging before applying authorization checks
- Revalidate the finalized configuration immediately before the privileged operation
- Treat project restrictions as deny-by-default policy controls
- Centralize authorization decisions so all copy paths enforce the same rules
- Minimize instance and daemon privileges using least-privilege settings
- Log cross-project copy requests, rejected restrictions, and effective configuration changes
- Use transactional or otherwise atomic workflows where configuration and authorization state must remain consistent
How teams detect issues like this
Organizations can look for TOCTOU and authorization-bypass risks through:
- Static analysis for checks performed before normalization, merging, or canonicalization
- Code review signals involving mutable configuration objects between validation and use
- Tests that compare authorization results for partial and fully merged configurations
- Policy tests covering cross-project copies and restricted high-privilege settings
- Runtime monitoring for unexpected privileged configuration changes in restricted projects
- Automated security review tools that flag authorization decisions made before final state construction

