Summary
A critical path traversal vulnerability in Incus allows an attacker to use the S3 protocol upload endpoint to create arbitrary files on the host.
Under conditions where the endpoint is reachable and accepts attacker-controlled paths, this may enable arbitrary command execution and host compromise.
Affected context
The vulnerability occurs in Incus deployments that expose or otherwise make the S3 protocol upload endpoint available to an attacker. It becomes risky when uploaded object names or destination paths are insufficiently constrained, allowing path information supplied through the request to escape the intended storage location and affect files on the host.
Exploit preconditions
- Attack surface: Incus S3 protocol upload endpoint
- Required access: Ability to reach and submit requests to the affected upload interface; authentication requirements depend on deployment configuration
- Trigger point: Processing an upload whose supplied path is interpreted as a host filesystem destination
- Why exploitation is possible: Insufficient path canonicalization and containment checks can allow writes outside the designated upload directory
Why this happens
The underlying bug is improper control of externally supplied file paths. When an application uses attacker-influenced object names or path components to construct filesystem destinations without canonicalization and strict directory-boundary validation, traversal sequences can redirect writes to unintended locations.
This behavior maps to CWE-73: External Control of File Name or Path, in which untrusted input influences filesystem operations. If a written file is later interpreted as executable code or configuration, the arbitrary write may be elevated into command execution.
Potential impact
- An attacker may create or overwrite arbitrary files on the host
- The affected service may be compromised through modified configuration or executable content
- Arbitrary command execution may occur under the privileges of the Incus service
- Host confidentiality, integrity, and availability could be affected
- Compromised hosts may provide a path to further container or infrastructure compromise
General mitigation guidance
Mitigation generally focuses on treating upload names and paths as untrusted data and enforcing a strict storage boundary.
Common defensive patterns include:
- Resolve and canonicalize candidate paths before writing files
- Reject traversal components, absolute paths, and path interpretations that escape the intended directory
- Generate server-side storage names instead of trusting client-provided filenames
- Use a storage layer that does not expose direct host filesystem paths
- Restrict the upload service to least-privilege filesystem and operating-system permissions
- Isolate S3 upload processing from sensitive host directories and executable locations
- Apply secure-by-default authentication, authorization, and endpoint exposure policies
- Keep affected components maintained through the organization's normal security update process
How teams detect issues like this
Organizations can look for path traversal risks through:
- Static analysis rules identifying filesystem writes whose paths derive from request or object-name data
- Code review checks for missing canonicalization, containment validation, or rejection of absolute paths
- Tests that verify uploads cannot escape an assigned storage directory
- Runtime monitoring for unexpected file creation or modification outside approved upload locations
- File-integrity monitoring for changes to service configuration, executable paths, and other sensitive host files
- Policy enforcement restricting which interfaces can access upload endpoints and which service identities can write to disk
Automated security scanning and code-review tools may help identify path construction and arbitrary-file-write patterns.

