Summary
Incus contains a path traversal vulnerability in migration handling: a malicious migration peer can provide unvalidated dependent volume or snapshot names in a migration offer. If Incus processes such an offer, the names may direct writes outside intended directories, potentially compromising the host or disrupting the daemon.
Affected context
The issue concerns Incus migration handling, including deployments before 7.6.0. It arises when a migration offer contains dependent volume or snapshot names that are not adequately validated before being used to construct filesystem paths. The described host-path impact is particularly relevant to deployments using directory-backed storage pools.
Exploit preconditions
- Attack surface: Incus migration processing
- Required access: Ability to act as or control a migration source accepted by the target
- Trigger point: Processing a migration offer header containing dependent volume or snapshot names
- Why exploitation is possible: Unvalidated names may influence destination paths, allowing writes outside the intended storage directories
Why this happens
The underlying bug is improper validation of path components derived from peer-controlled migration metadata. When names are incorporated into filesystem paths without reliably preventing traversal beyond the intended directory, attacker-controlled input can redirect file operations. This maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Potential impact
- Attacker-controlled content could be written to unintended host paths, potentially as root-owned files.
- Hosts using directory-backed storage pools could be compromised.
- The issue could bypass the intended restrictions of
restricted.storage-pools.access. - Malformed or malicious migration data could crash the Incus daemon and disrupt service.
General mitigation guidance
Defensive patterns focus on treating migration metadata as untrusted and confining filesystem operations to explicitly authorized storage locations.
- Validate volume and snapshot names against a strict schema and reject path separators or traversal components.
- Resolve and verify destination paths remain within the intended storage root before performing writes.
- Prefer APIs or abstractions that operate on authorized storage objects rather than constructing paths directly from peer-provided names.
- Apply least privilege to daemon and storage operations, and keep migration access limited to trusted peers.
- Enforce storage-pool authorization consistently, including for dependent volumes and snapshots.
How teams detect issues like this
- Use static analysis to identify filesystem paths constructed from migration metadata or other peer-controlled names.
- Review path-handling code for canonicalization, containment checks, and validation performed before file creation.
- Add tests and policy checks that reject traversal-like names and verify writes cannot escape the configured storage root.
- Monitor migration failures, unexpected files in host directories, and daemon crashes associated with migration processing.

