What’s Vulnerable › Vulnerabilities

CVE-2026-66897: Instance template path traversal allows arbitrary host file write as root

Description

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 products

How to fix

Upgrade to a fixed version: Canonical LXD 4.0.13, 5.0.9, 5.21.7. Check the vendor advisory for mitigations.

References

Get alerted when CVE-2026-66897 or the next vulnerability affects your stack