Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2026-66898

CVE-2026-66898: LXD Path Traversal Vulnerability

CVE-2026-66898 is a path traversal vulnerability in LXD that enables attackers to manipulate file paths during backup operations. This article covers the technical details, affected versions, security impact, and mitigation.

Published:

CVE-2026-66898 Overview

CVE-2026-66898 is a path traversal vulnerability [CWE-22] in LXD, the system container and virtual machine manager maintained by Canonical. The flaw resides in LXD's backup import and restore logic. LXD fails to validate instance and storage volume names embedded within backup archive metadata. An attacker with permissions to import a crafted backup archive can supply instance or volume names that contain path traversal sequences. This allows file access or file overwrites outside the intended restore directory on the host.

Critical Impact

An authenticated attacker can traverse the host file system during backup import or restore, leading to arbitrary file write, container escape, and full compromise of the LXD host.

Affected Products

  • Canonical LXD (system container and VM manager)
  • LXD backup import functionality
  • LXD storage volume restore functionality

Discovery Timeline

  • 2026-08-12 - CVE-2026-66898 published to the National Vulnerability Database
  • 2026-08-12 - Last updated in NVD database

Technical Details for CVE-2026-66898

Vulnerability Analysis

LXD backup archives package instance metadata, storage volume metadata, and file system contents into a portable tarball. When an administrator imports or restores a backup, LXD reads the embedded instance name and storage volume name from the archive metadata. These names are then used to construct paths on the host file system where restored data is written.

The vulnerability stems from missing validation on these name fields. LXD trusts the values in the archive without checking for directory separators or traversal sequences such as ../. As a result, the derived restore path can escape the designated storage directory and reference arbitrary locations on the host.

Exploitation gives the attacker write primitives outside the LXD storage pool. This can be used to overwrite system binaries, configuration files, systemd units, or authorized_keys files. Because LXD typically runs with root privileges, successful exploitation results in full host compromise.

Root Cause

The root cause is improper limitation of a pathname to a restricted directory [CWE-22]. LXD does not sanitize or canonicalize instance and volume identifiers extracted from untrusted backup archives before joining them to the restore base path.

Attack Vector

The attack vector is network-based and requires low privileges. An attacker with the ability to submit a backup archive to the LXD API crafts an archive in which the instance or volume name contains traversal sequences. Upon import or restore, LXD writes archive contents to a path constructed from the malicious name, allowing files to land outside the target directory.

Refer to the GitHub Security Advisory GHSA-m857-c7gc-c984 for the vendor's technical description.

// No verified proof-of-concept code is published for CVE-2026-66898.
// Consult the vendor advisory for exploitation details.

Detection Methods for CVE-2026-66898

Indicators of Compromise

  • Unexpected files appearing outside the LXD storage pool directories following a backup import or restore operation.
  • LXD API requests to backup import endpoints originating from unusual users or source addresses.
  • Backup archive metadata containing .., /, or other path separators in instance or volume name fields.
  • Modifications to sensitive host paths such as /etc/, /root/.ssh/, or /usr/bin/ correlating in time with LXD restore activity.

Detection Strategies

  • Inspect LXD daemon logs for lxc import or lxc restore operations and correlate with subsequent file system changes outside /var/snap/lxd/common/lxd/storage-pools/.
  • Deploy file integrity monitoring on the LXD host to alert on writes to system directories by the LXD process.
  • Parse backup archive tarballs prior to import and reject archives where metadata name fields contain path separators or traversal tokens.

Monitoring Recommendations

  • Enable audit logging for all LXD API calls, particularly POST /1.0/instances with backup source type and POST /1.0/storage-pools/{pool}/volumes/custom with backup source.
  • Forward LXD daemon logs and host audit events to a centralized log platform for correlation.
  • Alert on any process spawned by lxd that writes to paths outside expected storage pool directories.

How to Mitigate CVE-2026-66898

Immediate Actions Required

  • Restrict access to the LXD API and Unix socket to trusted administrators only.
  • Do not import backup archives from untrusted sources until a patched LXD release is installed.
  • Review recent backup import and restore operations and audit the host file system for unauthorized changes.
  • Apply the vendor-supplied update as soon as it is available from Canonical.

Patch Information

Canonical has published a security advisory for this vulnerability. Refer to the LXD Security Advisory GHSA-m857-c7gc-c984 for fixed version numbers and upgrade instructions. Update LXD through the snap channel using snap refresh lxd or the package manager appropriate to the deployment.

Workarounds

  • Limit LXD API access to a trusted administrative network segment using firewall rules or the core.https_address binding.
  • Require role-based access control so that only trusted operators hold the can_create_instances or backup restore permissions.
  • Manually inspect backup archive metadata for suspicious instance or volume names before importing third-party backups.
  • Run LXD hosts with additional mandatory access controls such as AppArmor or SELinux to constrain unexpected write paths.
bash
# Restrict LXD API access to a trusted management interface
lxc config set core.https_address 10.0.0.10:8443

# Verify installed LXD version against the fixed release from Canonical
snap info lxd | grep installed

# Refresh LXD to the patched release once available
sudo snap refresh lxd

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.