Summary
A critical path-handling vulnerability in Incus allows a specially crafted image to read or create and modify arbitrary files on the host system. Where an attacker can introduce or cause processing of such an image, the resulting host compromise may include arbitrary command execution.
Affected context
The vulnerability occurs in Incus image processing before version 7.2.0 when image contents or metadata influence filesystem paths used by the host. Risk depends on whether an untrusted party can supply, import, or trigger processing of a specially crafted image and on the permissions available to the Incus service.
Exploit preconditions
- Attack surface: Incus image import, storage, or processing workflows
- Required access: Ability to provide or cause processing of an untrusted image
- Trigger point: Host-side handling of crafted image paths or contents
- Why exploitation is possible: Insufficiently constrained paths may allow image-controlled filesystem operations outside the intended storage location
Why this happens
The underlying bug is an external-control-of-file-name-or-path weakness mapped to CWE-73. Image-controlled names, paths, or archive entries are insufficiently restricted before being used in host filesystem operations. Without canonicalization, containment checks, and strict destination controls, specially crafted input can escape the intended storage boundary and access unrelated host files.
Potential impact
- An attacker may read sensitive files from the host
- An attacker could create or overwrite arbitrary host files
- Host configuration or security controls may be modified
- Incus service privileges may be abused to affect other workloads
- Arbitrary command execution on the host may be possible
- Confidentiality, integrity, and availability of hosted containers or virtual machines could be affected
General mitigation guidance
Mitigation generally focuses on enforcing a strict trust boundary between
image content and host filesystem paths.
Common defensive patterns include:
- Restricting image-controlled paths to approved storage directories
- Canonicalizing paths and enforcing destination containment checks
- Rejecting traversal sequences, absolute paths, links, and ambiguous path forms
- Using safe archive-extraction and file-creation APIs
- Processing images with least-privilege service identities
- Separating image ingestion from sensitive host filesystem operations
- Limiting which users or services may upload, import, or process images
- Monitoring and protecting sensitive host files from unauthorized modification
How teams detect issues like this
Detection approaches may include:
- Static analysis for archive extraction and filesystem APIs receiving image-derived paths
- Code review checks for missing canonicalization, containment validation, or link handling
- Tests using traversal, absolute-path, symbolic-link, and unusual encoding cases
- Runtime monitoring for image-processing services accessing files outside approved directories
- Policy enforcement that restricts image sources and requires trusted image validation
- Automated security review tools that flag externally controlled filesystem paths

