Summary
A path handling vulnerability in Incus allows a specially crafted image or instance backup to cause arbitrary files on the host to be read, created, or overwritten during processing. Depending on the affected files and host permissions, successful exploitation could enable arbitrary command execution and broader host compromise.
Affected context
The issue can occur in Incus deployments that process untrusted or attacker-controlled system images or instance backups. Risk is higher when imported artifacts are handled with host-level privileges or when extracted paths are not reliably confined to an intended directory. The vulnerability affects versions before the release containing the fix, provided that a crafted image or backup reaches the relevant import or restore workflow.
Exploit preconditions
- Attack surface: Incus image import, instance backup restoration, or related archive-processing workflows
- Required access: Ability to supply, upload, or otherwise cause Incus to process a specially crafted image or instance backup
- Trigger point: File extraction or path resolution while the artifact is imported or restored
- Why exploitation is possible: Insufficient restriction of archive or image paths may allow operations to escape the intended extraction location and access host files
Why this happens
The underlying bug is unsafe handling of attacker-controlled file names or paths contained in an image or instance backup. If path resolution and extraction are not securely confined to an approved destination, specially constructed entries can reference locations outside that destination, resulting in arbitrary host file access or modification. This behavior maps to CWE-73: External Control of File Name or Path, where untrusted input influences filesystem operations without adequate canonicalization and boundary enforcement.
Potential impact
- Sensitive host files may be disclosed
- Arbitrary files on the host may be created or overwritten
- Incus configuration, startup, or authorization files could be altered
- Host or guest workloads may be disrupted
- Attackers may achieve arbitrary command execution if a writable file is later executed or interpreted
- Broader host compromise or lateral movement could occur
General mitigation guidance
Mitigation generally focuses on treating images and backups as untrusted archives and enforcing strict filesystem boundaries.
Common defensive patterns include:
- Canonicalizing and validating every extracted path before filesystem access
- Rejecting absolute paths, traversal components, symlinks, and other entries that escape the designated destination
- Using secure archive-extraction libraries with containment guarantees
- Separating staging directories from sensitive host paths
- Processing untrusted artifacts with minimal privileges and confined service identities
- Applying read-only or isolated execution environments where practical
- Restricting who can upload, import, or restore images and instance backups
- Maintaining integrity checks and provenance controls for trusted artifacts
How teams detect issues like this
Organizations can look for this class of issue through:
- Static analysis for archive extraction without canonical path validation
- Code review checks for absolute paths, traversal components, symlink handling, and unsafe filesystem joins
- Tests that attempt to extract entries outside an approved directory
- Monitoring Incus import and restore operations, including unexpected writes to sensitive host paths
- File-integrity monitoring for changes to host configuration, authorization, and startup locations
- Policy enforcement requiring untrusted artifacts to be scanned, staged, and processed with least privilege
Automated security review tools may help identify suspicious path-handling and archive-processing patterns.

