# CVE-2026-66897: Canonical LXD path traversal in instance template processing

Source: https://junglewise.ai/threats/cve-2026-66897-canonical-lxd-path-traversal-in-instance-template-processing  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-08-24. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2026-66897 · Severity: critical · CVSS 9.9 · Published 2026-08-24

LXD is a container management system used to run and manage Linux containers at scale. A path traversal vulnerability in its template processing allows users with container edit permissions to overwrite arbitrary files on the host system as root, leading to complete system compromise. This affects any LXD deployment where users are allowed to edit containers or launch custom images.

Technologies: [Canonical LXD](https://junglewise.ai/threats/technologies/lxd). Vendors: [Canonical](https://junglewise.ai/threats/vendors/canonical).

## Quick answers

**Is CVE-2026-66897 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-66897 being exploited in the wild.

**How severe is CVE-2026-66897?** Critical severity, with a CVSS score of 9.9, published 24 August 2026.

**Which products and versions are affected?** Canonical LXD <=6.9.

**Is there a fix for CVE-2026-66897?** A patch was published on 2026-08-24: Patched in versions 4.0.13, 5.0.9, 5.21.7, 6.9-ab8fad2, and 6.10 Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-66897 attacked?** It is attacked over the network, in a network appliance.

**Am I affected by CVE-2026-66897?** Check whether you run Canonical LXD at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

A path traversal vulnerability exists in LXD's instance template file processing (templateApplyNow function). The vulnerability stems from a mismatch between path validation and file creation: template target paths from metadata.yaml are validated using a confined os.Root handle against the instance rootfs, but the file is subsequently created using os.Create with an unconfined string path. An attacker can bypass the confinement check by routing the traversal path through a non-existent directory component (which causes os.Root.Stat to return ENOENT—treated as a success case), then leveraging filepath.Join's lexical normalization to strip the ".." components before passing the escaped path to os.Create. This allows arbitrary file writes as root on the host. The vulnerability requires either container edit permissions (can_edit capability) or the ability to launch a crafted container image, and affects LXD versions through 6.9.

## Affected products

- Canonical LXD <=6.9

## Timeline

- 2026-08-24: disclosed
- 2026-08-24: patched: Patched in versions 4.0.13, 5.0.9, 5.21.7, 6.9-ab8fad2, and 6.10

## References

- [https://github.com/canonical/lxd/security/advisories/GHSA-q39m-8fx9-42fv](https://github.com/canonical/lxd/security/advisories/GHSA-q39m-8fx9-42fv)

## Related threats

- [LXD project restriction bypass in instance copy](https://junglewise.ai/threats/lxd-has-project-restriction-bypass-in-instance-copy-across-projects-48d466e0)
- [Canonical LXD improper certificate validation in HTTPS listener](https://junglewise.ai/threats/cve-2026-112816-improper-certificate-validation-in-the-https-listener-in)
- [Canonical LXD custom storage volume authorization bypass](https://junglewise.ai/threats/cve-2026-97335-incorrect-authorization-in-the-custom-storage-volume-creation)
- [Canonical LXD arbitrary file write via symlink in migration stream](https://junglewise.ai/threats/cve-2026-87799-improper-link-resolution-in-the-migration-receive-path-in)
- [Canonical LXD improper symlink resolution in recursive file pull](https://junglewise.ai/threats/cve-2026-87798-improper-link-resolution-in-the-recursive-file-pull-feature-of)
