CVE-2026-66897

Instance template path traversal allows arbitrary host file write as root

Published Aug 24, 2026 CVSS 3.1 · 9.9 Critical EPSS < 1% KEV · Not listed
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.

Analysis

AI-generated

Technical impact

The flaw arises in how LXD processes instance template metadata. When a user provides a path for a file in metadata.yaml, LXD checks the path against a confined root directory but later creates the file with an unconfined path string. This mismatch permits a path traversal attack that lets the attacker write to any file on the host, including those owned by root. The result is that an attacker can overwrite critical system files and achieve code execution with root privileges on the host.

Affected Systems

The vulnerability affects Canonical's LXD container hypervisor. Any LXD installation older than the patched releases – LXD 4.0.13, 5.0.9, 5.21.7, and 6.10 – is susceptible. This includes all supported LXD 4.x, 5.x, and 6.x releases prior to those specific patch versions.

Risk and Exploitability

The CVSS score is 9.9, classifying this as critical. Since the EPSS score is not available and the vulnerability is not listed in CISA KEV, the public exploitation likelihood may be unknown, but the high severity indicates that any attacker who can edit a container or launch a crafted image can escape confinement. Local users who have container editing rights, or any user who can supply a malformed metadata.yaml, can trigger the vulnerability, leading to host root compromise. Therefore the risk is substantial for systems that expose LXD to untrusted users or run modules that allow arbitrary image creation.

Remediation

Vendor Solution

Upgrade to LXD versions 4.0.13, 5.0.9, 5.21.7, 6.10 or later.


OpenCVE Recommended Actions

  • Upgrade LXD to a patched version—4.0.13, 5.0.9, 5.21.7, 6.10 or later.
  • If an upgrade is temporarily infeasible, restrict container edit permissions to trusted administrators only, denying untrusted users the ability to modify instance metadata.
  • Validate that any image or template metadata does not contain arbitrary file paths before importing or launching containers.
  • Monitor host file integrity and audit container creation logs to detect anomalous file writes.

Generated by OpenCVE AI on August 24, 2026 at 10:22 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
CPEs cpe:2.3:a:canonical:lxd:*:*:*:*:*:*:*:*
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Canonical
Canonical lxd
Vendors & Products Canonical
Canonical lxd
Type Values Removed Values Added
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.
Title Instance template path traversal allows arbitrary host file write as root
Weaknesses CWE-22
CWE-23
References
Metrics cvssV3_1

{'score': 9.9, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H'}

Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

  • CWE-23

    Relative Path Traversal

Sources

Status
PUBLISHED
Assigner
canonical
Published
Updated
Aug 25, 2026, 3:55 AM
Reserved
Jul 28, 2026, 7:41 AM
Status
Analyzed
Published
Aug 24, 2026, 10:16 AM
Modified
Oct 24, 2026, 4:10 PM