CVE-2026-66898: LXD path traversal in backup restore enables arbitrary file write

CVE-2026-66898 · Severity: critical · CVSS 9.9 · Published 2026-08-12

LXD is a container management system that allows users to create and manage lightweight Linux containers. A path traversal vulnerability in the backup import/restore feature allows an authenticated attacker to write arbitrary files as root outside the designated storage directory, enabling remote code execution on the host system. An attacker with container creation permissions can craft a malicious backup archive that exploits insufficient validation of instance names in backup metadata.

Technologies: Canonical LXD. Vendors: Canonical.

Quick answers

Is CVE-2026-66898 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-66898 being exploited in the wild.
How severe is CVE-2026-66898?
Critical severity, with a CVSS score of 9.9, published 12 August 2026.
Which products and versions are affected?
Canonical LXD < 4.0.12, 5.0.x < 5.0.4, 5.1.x - 5.20.x, 5.21.x < 5.21.2, 6.0.x, 7.0.x, 7.1.x, 7.2.x.
Is there a fix for CVE-2026-66898?
A patch was published on 2026-08-12. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-66898 attacked?
It is attacked over the network.
Am I affected by CVE-2026-66898?
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

The vulnerability is a path traversal (CWE-22) flaw in LXD's backup import handler. When processing an instance backup via POST /1.0/instances with application/octet-stream content, the backup.GetInfo() function reads the instance name directly from the backup/index.yaml metadata without validation. This unsanitized name flows directly into file system path construction via pool.CreateInstanceFromBackup() → vol.MountPath() → EnsureMountPath(os.Mkdir), bypassing the instance.ValidName() check which only applies to the JSON-dispatch code path. An authenticated user with can_create_instances project entitlement can exploit this by crafting a backup tarball with a malicious instance name containing path traversal sequences (e.g., "../../../../etc/cron.d/pwn"), causing LXD to create directories and unpack attacker-controlled content as root outside the storage pool. This yields arbitrary directory creation, arbitrary-content file write, and ultimately host remote code execution. Patches are available in versions 4.0.12, 5.0.4, 5.21.2, and 6.1.

Affected products

  • Canonical LXD < 4.0.12, 5.0.x < 5.0.4, 5.1.x - 5.20.x, 5.21.x < 5.21.2, 6.0.x, 7.0.x, 7.1.x, 7.2.x

Timeline

  • 2026-07-31: disclosed
  • 2026-08-12: patched

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.