CVE-2026-66897
PoC moderatePath Traversal in Canonical LXD Template Processing Enables Host Root Compromise
CVE-2026-66897 is a path traversal flaw (CWE-22/CWE-23) in LXD's instance template processing: when handling target template paths declared in an image's metadata.yaml, LXD validates the path against a confined os.Root directory handle but then opens and creates the file with os.Create using an unconfined string path, so the check and the actual file creation can disagree. It is triggered by an authenticated user with permission to edit a container/instance, or by any user who launches an instance from a crafted image containing a malicious template path that escapes directory confinement. Successful exploitation lets the attacker overwrite arbitrary root-owned files on the LXD host and achieve host root code execution, consistent with the critical 9.9 CVSS score (network vector, low privileges, changed scope). The flaw affects Canonical LXD deployments, and it is most consequential on hosts where untrusted users hold container-edit rights or can import and launch images. Exploitation status: not listed in CISA KEV, EPSS estimates a ~0.6% probability of exploitation within 30 days (48th percentile), and one public advisory/PoC reference exists, so there is no confirmed in-the-wild exploitation at this time.
What to do: Upgrade LXD to a patched release identified in Canonical's security advisory (GHSA-q39m-8fx9-42fv); the supplied data does not include fixed version numbers. Until patched, restrict container-edit permissions and image import/launch rights to trusted users and limit network exposure of the LXD API. Review hosts for untrusted users with instance-edit rights or use of third-party images, and verify the integrity of critical root-owned files.
| Canonical LXD | — |
Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.
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.
- Vendors
- canonical
- Products
- lxd
- Weakness
- CWE-22, CWE-23
- Vector
- CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
In the news0 stories
No ingested article mentions this CVE yet.