Summary
A critical input-validation vulnerability in the Incus client allows a malicious image server to supply a crafted Incus-Image-Hash header that is processed unsafely. Under affected conditions, this may enable arbitrary file writes and could result in command execution with root privileges on the Incus server.
Affected context
The vulnerability occurs in Incus deployments that use an affected client to retrieve images from an image server controlled or compromised by an attacker. Risk depends on how the client processes the returned Incus-Image-Hash header and whether the resulting file-write behavior reaches a privileged server-side execution path.
Exploit preconditions
- Attack surface: Incus image retrieval and image-server communication
- Required access: The attacker must control, compromise, or impersonate an image server trusted by the Incus client
- Trigger point: Processing of a malicious
Incus-Image-Hashresponse header - Why exploitation is possible: Insufficient validation of header-derived data can allow attacker-controlled values to influence file paths or file contents, potentially reaching privileged execution contexts
Why this happens
The underlying bug is improper validation of externally supplied image metadata. The client accepts a response header from an image server and uses its value in file-handling logic without sufficiently constraining its format, destination, or permitted effects.
This maps to CWE-20: Improper Input Validation, where data is not adequately checked against the expected syntax, structure, or security policy before use. When untrusted metadata influences privileged file operations, validation failures may become arbitrary file-write and code-execution risks.
Potential impact
- An attacker may write or overwrite arbitrary files accessible to the affected process
- The attacker could execute commands with root privileges on the Incus server
- The attacker may compromise containers, virtual machines, or host management functions
- System integrity, confidentiality, and availability could be affected
- The vulnerability could support persistence or lateral movement within the infrastructure
General mitigation guidance
Mitigation generally focuses on reducing trust in image-server responses and constraining all metadata-driven file operations.
Common defensive patterns include:
- Applying the vendor-provided security fix or an equivalent corrected implementation
- Validating image headers against a strict, allowlisted format before use
- Treating header values as data rather than filesystem paths, commands, or executable content
- Resolving file destinations within fixed, non-privileged directories and rejecting traversal or special path forms
- Separating image retrieval from privileged host operations
- Running image-processing components with the minimum required permissions
- Restricting trusted image servers through authentication, integrity verification, and network policy
- Using read-only or isolated staging areas for downloaded image material
How teams detect issues like this
High-level detection can combine code analysis, runtime monitoring, and trust-policy enforcement:
- Use static analysis to identify response-header values flowing into filesystem APIs, process execution, or privileged operations
- Review code for missing allowlists, canonical-path checks, destination constraints, and validation before file writes
- Monitor Incus clients for unexpected image-server endpoints or unusual
Incus-Image-Hashvalues - Alert on writes to sensitive host paths or unexpected child processes launched by Incus components
- Enforce policies requiring authenticated and approved image sources
- Use automated security review tools to flag untrusted input reaching file and command-handling APIs

