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

CVE-2026-86334: Canonical LXD Path Traversal Vulnerability

CVE-2026-86334 is a path traversal flaw in Canonical LXD CLI client that allows malicious image servers to overwrite local files and execute code. This post explains its technical details, affected versions, and mitigation steps.

Published:

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

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-86334 Overview

CVE-2026-86334 is a path traversal vulnerability [CWE-22] in the Canonical LXD command-line interface (CLI) client. The flaw affects the unified image export and copy functionality in LXD versions from 4.0.2 before 4.0.14, 5.0.10, 5.21.8, and 6.10 on all platforms. A remote malicious image server, or an attacker in a machine-in-the-middle (MITM) position, can supply a crafted Content-Disposition header filename parameter. The crafted header causes the LXD client to write files outside the intended target directory. Successful exploitation allows arbitrary local file overwrite and code execution on the client host.

Critical Impact

An untrusted or hijacked LXD image server can overwrite arbitrary files on the client workstation and achieve code execution when a user runs lxc image export or lxc image copy into a local directory target.

Affected Products

  • Canonical LXD 4.0.2 through 4.0.13
  • Canonical LXD 5.0.0 through 5.0.9, and 5.21.0 through 5.21.7
  • Canonical LXD 6.0 through 6.9

Discovery Timeline

  • 2026-09-28 - CVE-2026-86334 published to the National Vulnerability Database (NVD)
  • 2026-09-28 - Last updated in the NVD database

Technical Details for CVE-2026-86334

Vulnerability Analysis

The vulnerability resides in the LXD CLI client's handling of HTTP responses returned during unified image export and copy operations. When the client requests an image, the remote server returns the image payload with a Content-Disposition header that includes a filename parameter. The client uses this filename to persist the downloaded content to the local directory specified by the user.

The LXD client does not sanitize the filename parameter before joining it to the destination path. An attacker-controlled filename containing ../ sequences, or an absolute path, causes the file write to escape the user-selected directory. The write occurs with the privileges of the invoking user, which commonly includes the ability to overwrite shell initialization files, cron jobs, or binaries on the PATH.

Because the attack vector is network-based and the client initiates the connection, any remote image server the user interacts with, including one reached through a hijacked network path, can trigger the behavior. Exploitation requires user interaction in the form of running an image export or copy command against the attacker-controlled endpoint.

Root Cause

The root cause is improper limitation of a pathname to a restricted directory [CWE-22]. The client trusts the server-supplied Content-Disposition filename parameter and performs path concatenation without canonicalization or containment checks against the user-specified target directory.

Attack Vector

Exploitation requires one of two preconditions. First, the user runs lxc image export or lxc image copy against a malicious remote image server. Second, an attacker in a machine-in-the-middle position intercepts and modifies the HTTP response from a legitimate server when transport integrity is not enforced. The crafted response includes a Content-Disposition: attachment; filename="../../path/to/target" header, which the client resolves outside the intended directory. The attacker then overwrites files such as ~/.bashrc, ~/.ssh/authorized_keys, or user-writable binaries to achieve code execution on the next shell session or binary invocation.

// No verified exploit code is published. Refer to the upstream advisory
// and pull requests for the sanitization logic applied in the fix:
// https://github.com/canonical/lxd/security/advisories/GHSA-g4cm-f533-78hq

Detection Methods for CVE-2026-86334

Indicators of Compromise

  • Unexpected modifications to user dotfiles such as ~/.bashrc, ~/.profile, or ~/.ssh/authorized_keys shortly after running lxc image export or lxc image copy.
  • Files written outside the directory supplied as the target argument to lxc image export or lxc image copy.
  • LXD client traffic to image servers not on the organization's allowlist, or TLS certificate changes for known servers.

Detection Strategies

  • Inspect LXD client logs and shell history for lxc image export or lxc image copy invocations targeting unfamiliar remote servers.
  • Compare file write timestamps on sensitive paths against the execution window of LXD CLI commands.
  • Alert on HTTP responses to LXD clients containing Content-Disposition filename values that include .., /, or \ sequences at a network inspection point.

Monitoring Recommendations

  • Enable file integrity monitoring (FIM) on user home directories, shell initialization files, and SSH configuration directories on workstations that run the LXD client.
  • Capture process execution telemetry for the lxc binary and correlate parent-child process trees with subsequent file write events.
  • Restrict and log outbound connections from developer workstations to approved LXD image server hosts only.

How to Mitigate CVE-2026-86334

Immediate Actions Required

  • Upgrade the LXD client to version 4.0.14, 5.0.10, 5.21.8, 6.10, or later as applicable to your branch.
  • Suspend use of lxc image export and lxc image copy against third-party or untrusted image servers until the client is patched.
  • Audit workstations for recent exports or copies and verify that no files were written outside the specified target directories.

Patch Information

Canonical fixed the issue upstream through pull requests on the LXD repository. Review the merged changes in GitHub LXD Pull Request #18940, #18974, #18975, #18976, and #18977. The coordinated advisory is published as GitHub Security Advisory GHSA-g4cm-f533-78hq.

Workarounds

  • Only run lxc image export and lxc image copy against trusted image servers reached over authenticated TLS connections.
  • Execute image export and copy operations from a dedicated, non-privileged user account with no write access to sensitive configuration or binary paths.
  • Perform operations inside an empty, disposable working directory and verify output file paths before using any exported artifacts.
bash
# Verify the installed LXD client version before resuming image operations
lxc --version

# Upgrade on Ubuntu using snap (adjust channel to match your branch)
sudo snap refresh lxd --channel=5.21/stable

# Example: run export in an isolated directory and audit results
mkdir -p /tmp/lxd-export && cd /tmp/lxd-export
lxc image export <image> .
find /tmp/lxd-export -type f -newer /tmp/lxd-export

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

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

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.