All vulnerabilities

Servers and applications

CVE-2026-66897

Instance template path traversal allows arbitrary host file write as root

Severity
Critical 9.9
Published
24 Aug 2026
Last changed
24 Oct 2026
Added to UpHeron
1 Nov 2026
Fixed in
4.0.13, 5.0.9, 5.21.7
Exploit chance
0.7% in the next 30 daysHigher than 54% of CVEs. EPSS by FIRST, 19 Nov 2026
Weakness
Path traversal (CWE-22)Relative path traversal (CWE-23)
Attack
Over the network · Needs a user account · No user action needed
Attacker can
Read data · Change data · Take it down
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
Also known as
GHSA-q39m-8fx9-42fv
Sources
NVD, Project advisories (GitHub)

Description

A path traversal in the instance template code lets a user with can_edit on a single container write files anywhere on the host as root. The template target path from metadata.yaml is checked against a confined os.Root, but the file is then opened by string path with os.Create. The check and the write don't resolve the same thing. A tenant who can edit one container they own can overwrite any root owned file on the host and get root code execution. No non-default configuration is needed. The same primitive is reachable by launching a crafted image.

Tested on 6.9 at commit 852d0b04301d004fc27e1955f278537ad02779f8.

Templates are applied by templateApplyNow, which reads metadata.yaml straight off disk:

The keys of the templates: map are the target paths. Nothing validates them. ParseImageMetadataFile only YAML decodes:

The validation is here:

rootfsRoot is a real confined *os.Root rooted at the instance rootfs, built here:

From canonical/lxd's security advisory. Shortened; the full text is there.

Affected software

SoftwareAffected versions
LXDServers and applications · cpe:a:canonical:lxd
  • Every version before 4.0.13
  • From 5.0.0 before 5.0.9
  • From 5.1 before 5.21.7
  • From 6.0 up to 6.9
LXDServers and applications · github:canonical/lxd
  • Every version before 4.0.13

About LXD

container manager for system containers

From Wikidata, CC0 1.0.
GitHub stars
4,852GitHub, 15 Nov 2026
Forks
1,074GitHub, 15 Nov 2026
Latest release
lxd-6.10.1GitHub, 15 Nov 2026
Released
28 Oct 2026GitHub
Developer
Stéphane GraberWikidata
License
AGPL-3.0GitHub
Written in
GoWikidata
First released
4 Nov 2014Wikidata
First published on GitHub
4 Nov 2014GitHub

References

  • NVD https://nvd.nist.gov/vuln/detail/CVE-2026-66897
  • CVE.org https://www.cve.org/CVERecord?id=CVE-2026-66897
  • GitHub Advisory Database https://github.com/advisories/GHSA-q39m-8fx9-42fv
  • github.com https://github.com/canonical/lxd/security/advisories/GHSA-q39m-8fx9-42fv