/

CVE-2026-85526

Severity:

CRITICAL RISK

(9.9)

Path Traversal (CWE-22) in LXD Btrfs Storage Driver

CVE-2026-85526

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Host Filesystem Modification and Privilege Escalation

Severity:

CRITICAL RISK

(9.9)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A critical path traversal vulnerability in Canonical LXD's Btrfs storage driver allows an authenticated user with instance creation privileges to influence filesystem paths during optimized backup import.

Under affected conditions, crafted backup metadata may enable deletion or replacement of arbitrary files and directories on the Linux host with root-level impact.

Affected context

The vulnerability occurs in LXD deployments that use the Btrfs storage driver and process optimized backup imports. It becomes risky when an authenticated principal who can create instances is also able to submit or import backup content whose metadata is trusted by the volume-unpacking logic. The impact extends beyond the instance because the affected operation runs with host-level privileges.

Exploit preconditions

  • Attack surface: LXD instance creation and optimized backup import functionality
  • Required access: An authenticated LXD user or tenant with instance creation privileges
  • Trigger point: Btrfs volume unpacking while processing backup metadata
  • Relevant input: A crafted path value within the backup's volume metadata
  • Why exploitation is possible: The storage driver may resolve attacker-controlled paths without sufficiently constraining them to the intended volume directory, allowing privileged filesystem operations outside the expected boundary

Why this happens

The underlying bug is insufficient canonicalization and boundary validation of filesystem paths supplied through backup metadata. A storage operation intended to manipulate files within an isolated Btrfs volume can instead act on paths outside that volume when attacker-controlled path components are accepted without enforcing a trusted destination root.

This maps to CWE-22: Path Traversal, in which externally influenced path data is used to access filesystem locations beyond the authorized directory. Because the operation runs with elevated host privileges, a path-validation failure can become a host-level file deletion or replacement vulnerability.

Potential impact

  • An attacker may delete arbitrary files or directories on the host
  • An attacker could replace host files with attacker-controlled content
  • The vulnerability may enable denial of service through destructive filesystem changes
  • Host services, security controls, or configuration may be disrupted
  • Confidentiality, integrity, and availability of other workloads could be affected
  • In some environments, file replacement could contribute to host or cluster compromise

General mitigation guidance

Mitigation generally focuses on enforcing filesystem containment throughout backup extraction and volume unpacking.

Defensive patterns include:

  • Canonicalizing candidate paths before use and verifying that they remain beneath a trusted volume root
  • Rejecting absolute paths, parent-directory traversal, and ambiguous path representations
  • Applying the same boundary checks after filesystem links, mounts, or Btrfs-specific path resolution are considered
  • Treating backup metadata as untrusted input and validating it against a strict schema
  • Using secure-by-default extraction routines that permit only explicitly authorized destinations
  • Limiting instance-creation identities and separating tenant data from host-sensitive storage
  • Running storage operations with the narrowest practical privileges and applying host filesystem protections

How teams detect issues like this

Detection can combine static analysis, code review, runtime monitoring, and policy enforcement.

Useful signals include:

  • Static-analysis rules for filesystem APIs that consume user-controlled or archive-controlled paths
  • Review findings involving path concatenation without canonicalization and containment checks
  • Tests covering absolute paths, parent-directory components, symlink behavior, and alternate path representations
  • Audit records for backup imports, volume extraction, and unexpected host filesystem modifications
  • Policies requiring trusted-root validation before privileged file operations
  • Automated code review tools that flag path traversal patterns and unsafe archive extraction logic

Sources

SourceLink
github.comgithub.com/canonical/lxd-private/pull/103
github.comgithub.com/canonical/lxd-private/pull/104
github.comgithub.com/canonical/lxd-private/pull/105
github.comgithub.com/canonical/lxd-private/pull/84
github.comgithub.com/canonical/lxd-private/pull/87
github.comgithub.com/canonical/lxd/security/advisories/GHSA-h85r-gjgx-g2rv

Frequently asked

questions

It may be exploitable through LXD's management or API surface when that surface is reachable by an authenticated user who has instance creation and relevant backup-import capabilities. It is not necessarily exploitable by an unauthenticated network user.

The key prerequisite is authenticated access with permission to create instances and cause an optimized backup to be imported or processed. Exact exposure depends on LXD authorization and deployment configuration.

Enforce strict canonical path and trusted-root validation during every volume extraction and unpacking operation, reject traversal or ambiguous paths, and ensure privileged storage actions cannot escape the intended volume directory.

Treat archive and backup metadata as untrusted, use secure extraction APIs, test link and traversal edge cases, apply least privilege, and monitor privileged processes for unexpected host filesystem changes.

Find out what's already
exploitable in your codebase.