CVE-2025-54289 Overview
CVE-2025-54289 is a privilege escalation vulnerability in the operations API of Canonical LXD versions earlier than 6.5. An attacker holding only read permissions can hijack active terminal or console sessions through WebSocket connection hijacking. Once a session is hijacked, the attacker executes arbitrary commands in the context of the legitimate session owner. The flaw is tracked under CWE-1385: Missing Origin Validation in WebSockets and affects LXD deployments across all supported platforms. Successful exploitation undermines the trust boundary between read-only operators and privileged users in multi-tenant LXD environments.
Critical Impact
A read-only LXD user can hijack interactive terminal and console sessions, executing arbitrary commands with the privileges of the session owner.
Affected Products
- Canonical LXD versions prior to 6.5
- LXD deployments on Linux distributions exposing the operations API
- Multi-user LXD clusters where low-privilege accounts have read access
Discovery Timeline
- 2025-10-02 - CVE-2025-54289 published to NVD
- 2025-10-24 - Last updated in NVD database
Technical Details for CVE-2025-54289
Vulnerability Analysis
LXD exposes an operations API that brokers long-running tasks, including interactive exec sessions to containers and console attachments to virtual machines. These interactive operations upgrade to WebSocket connections for bidirectional input and output streams. The vulnerability stems from insufficient origin validation and access control on these WebSocket endpoints. An authenticated client with read permissions can connect to a WebSocket associated with an in-progress operation owned by another user. The server fails to verify that the connecting client has write or operator privileges on the target operation.
Once attached, the attacker reads keystrokes and command output, and injects arbitrary input into the session. Because the session executes in the security context of the original user, commands run with that user's privileges inside the container, virtual machine, or host console.
Root Cause
The root cause is missing authorization checks on WebSocket connections tied to operations created by other identities. LXD's operations API treats WebSocket attach requests as a continuation of the originating operation rather than as a new, independently authorized action. Read permission grants visibility into operation metadata, which exposes the secret identifiers needed to attach to the operation's I/O streams.
Attack Vector
Exploitation requires network access to the LXD API and a valid account with at least read permission. The attacker enumerates active operations through the API, identifies an interactive exec or console session, and opens a WebSocket connection to the session's control and I/O endpoints. The attacker then issues shell commands that the LXD daemon forwards to the target container or VM. User interaction is required because the attacker must wait for or coincide with an active interactive session opened by a privileged user. No verified public proof-of-concept code is currently available. Refer to the Canonical GHSA-3g72-chj4-2228 advisory for vendor technical details.
Detection Methods for CVE-2025-54289
Indicators of Compromise
- Multiple WebSocket connections attached to a single LXD operation from distinct client certificates or API tokens
- Unexpected shell commands executed inside containers during sessions initiated by administrators
- API authentication events from read-only accounts immediately followed by WebSocket upgrade requests to /1.0/operations/<uuid>/websocket
Detection Strategies
- Audit the LXD daemon log (/var/log/lxd/lxd.log or systemd journal) for WebSocket attach events correlated to operation owners
- Compare the identity initiating an exec or console operation with identities subsequently attaching to its WebSocket streams
- Alert when accounts with can_view but not can_exec permissions issue WebSocket upgrade requests to operation endpoints
Monitoring Recommendations
- Enable LXD audit logging and forward events to a centralized log platform for correlation
- Monitor inside containers for shell command sequences that diverge from expected administrator workflows
- Track LXD RBAC policy changes and review accounts holding the viewer role against the list of users with active sessions
How to Mitigate CVE-2025-54289
Immediate Actions Required
- Upgrade Canonical LXD to version 6.5 or later on all hosts and cluster members
- Restrict LXD API network exposure to trusted management networks only
- Audit existing role assignments and remove unnecessary read permissions from non-administrative accounts
- Rotate client certificates and API tokens for accounts that previously held read access
Patch Information
Canonical addressed the issue in LXD 6.5. Apply the upgrade through your distribution's package manager or the snap channel used in your environment. Verify the running version with lxd --version after the upgrade and restart the daemon to ensure the new code path handles WebSocket authorization correctly. Full details are documented in the GitHub Security Advisory GHSA-3g72-chj4-2228.
Workarounds
- Disable read-only access for untrusted users until the upgrade is applied
- Place the LXD API behind a network policy that only permits connections from administrator workstations
- Avoid running interactive lxc exec or lxc console sessions on shared clusters until patching is complete
# Verify LXD version and upgrade via snap
lxd --version
sudo snap refresh lxd --channel=latest/stable
sudo systemctl restart snap.lxd.daemon
# Review accounts with read permission
lxc auth group list
lxc auth identity list
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

