CVE-2026-66897: Instance template path traversal allows arbitrary host file write as root
A path traversal vulnerability in LXD's instance template processing allows an attacker with container edit permissions, or any user launching a crafted image, to overwrite arbitrary files on the host system as root. When processing target template paths specified in metadata.yaml, LXD validates the path against a confined os.Root directory handle but subsequently opens and creates the file using os.Create with an unconfined string path. This discrepancy between path resolution checks and file creation allows an attacker to escape directory confinement, overwrite root-owned host files, and achieve host root code execution.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 4.0.13 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 5.0.9 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 5.21.7 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 6.10
Event History
Frequently Asked Questions
Who should be considered exposed to exploitation?
LXD deployments where a user can edit container configuration or launch a crafted image are exposed. Either capability can provide the attacker-controlled template metadata needed to trigger the flaw.
What access does an attacker need before exploitation?
The attacker needs low-privileged access through either container edit permissions or the ability to launch a crafted image. No user interaction is required after that access is obtained.
What is the likely impact after successful exploitation?
An attacker can overwrite arbitrary root-owned files on the host and obtain host root code execution. The vulnerability affects confidentiality, integrity, and availability of the host system.