Summary
A critical input-validation flaw in Incus backup handling allows a user-provided compression algorithm value to alter the arguments passed to a host command. Under conditions where an attacker can influence this backup setting, the issue may enable arbitrary file writes on the host and could lead to command execution.
Affected context
The vulnerability occurs in Incus deployments that process user-controlled backup compression algorithm values and incorporate them into a constructed command line. Risk depends on the attacker having sufficient access to create, modify, or trigger a backup operation and on the resulting process having permissions to write files or perform actions on the host.
Exploit preconditions
- Attack surface: Incus backup functionality and its command construction path
- Required access: Ability to provide or influence the backup compression algorithm value, subject to deployment authorization
- Trigger point: Processing the supplied value while constructing or invoking the backup command
- Why exploitation is possible: Insufficient validation allows input intended as a configuration value to be interpreted as additional command-line arguments
Why this happens
The underlying bug is improper validation and handling of user-controlled input before it is incorporated into a command line. Instead of restricting the compression algorithm to an explicit set of supported values and preserving argument boundaries, the implementation permits unexpected input to influence command invocation. This maps to CWE-20: Improper Input Validation and represents an argument-injection pattern that can redirect command behavior and affect host-side file operations.
Potential impact
- An attacker may write arbitrary files accessible to the affected host process
- The vulnerability could enable unauthorized modification of host or container-related data
- Successful exploitation may lead to arbitrary command execution
- Host confidentiality, integrity, or availability could be compromised
- The issue may facilitate further container or infrastructure compromise
General mitigation guidance
Mitigation generally focuses on reducing trust in backup parameters and preventing user input from controlling command structure.
Common defensive patterns include:
- Restricting compression algorithms to a small, explicit allowlist
- Passing command arguments through structured process APIs that preserve argument boundaries
- Avoiding shell interpretation and command-string concatenation
- Validating input before command construction and again at security-sensitive boundaries
- Running backup operations with the minimum host privileges and filesystem access required
- Limiting writable host paths and applying containment controls where practical
- Separating user-controlled configuration from privileged host operations
How teams detect issues like this
Organizations can look for this class of issue through:
- Static analysis rules identifying command construction from untrusted or weakly validated input
- Code review checks for shell strings, argument concatenation, and APIs that invoke subprocesses
- Tests that verify unsupported compression values are rejected and cannot alter argument boundaries
- Runtime monitoring for unexpected backup-process arguments and writes outside approved directories
- Policy enforcement requiring allowlisted values and least-privilege execution for host-facing operations
- Automated security review tools that flag command injection and improper input-validation patterns

