Overview
A critical path traversal vulnerability (CVE-2026-66897) has been disclosed in LXD, the popular Linux container and virtual machine manager maintained by Canonical. Rated CVSS 9.9, the flaw allows an attacker with container edit permissions — or any user who can cause a victim to launch a crafted container image — to overwrite arbitrary files on the host system.
The vulnerability resides in LXD's instance template processing engine, which fails to properly sanitize file paths when extracting image templates. By embedding a maliciously crafted path (e.g., ../../etc/cron.d/malicious) inside an LXD image, an attacker can escape the container boundary and write to any location accessible by the LXD daemon on the host.
Technical Details
| Field | Value |
|---|---|
| CVE ID | CVE-2026-66897 |
| CVSS Score | 9.9 (Critical) |
| Attack Vector | Network |
| Privileges Required | Low (container edit access) |
| User Interaction | None (or victim launches image) |
| Scope | Changed — host escape from container |
| Component | LXD instance template processor |
Attack Scenarios
Scenario 1 — Container Edit Privileges:
An attacker with legitimate (or compromised) permissions to edit LXD instances can modify an instance's template configuration to include path-traversal sequences. On next template application, the daemon writes attacker-controlled content to arbitrary host paths.
Scenario 2 — Crafted Image Distribution:
An attacker distributes a malicious LXD image via a community repository or internal image registry. Any user or automation system that pulls and launches the image triggers the traversal without requiring explicit container-edit privileges.
Both vectors ultimately achieve host file overwrite, enabling privilege escalation, persistence (e.g., writing cron jobs, SSH keys, or sudoers entries), or service disruption.
Affected Versions
All LXD versions prior to the patched release are affected. Canonical has published a fix; operators should update immediately via:
snap refresh lxdFor non-snap installations, consult your distribution's package manager or the upstream LXD release notes.
Mitigation
- Update LXD immediately to the latest patched version.
- Audit container edit permissions — restrict who can modify instance configurations in multi-tenant or shared environments.
- Enforce image signing and provenance — only pull images from trusted, verified sources. Avoid untrusted community images until they can be reviewed.
- Review LXD daemon privileges — consider restricting the daemon's write access on the host filesystem where possible.
- Monitor for unexpected host file changes — deploy file integrity monitoring (FIM) on critical host paths (
/etc/,/root/.ssh/,/var/spool/cron/).
Severity Rationale
The near-perfect CVSS score of 9.9 reflects the Changed scope (container-to-host escape), low privilege requirement (any container user with edit access), and the critical impact on host confidentiality, integrity, and availability. Container escape vulnerabilities of this class are considered among the most severe in cloud and infrastructure environments.