CVE-2025-54289

8.1 HIGH

📋 TL;DR

This vulnerability allows attackers with read permissions in Canonical LXD to hijack terminal or console sessions via WebSocket connection hijacking, enabling arbitrary command execution and privilege escalation. It affects LXD installations on multiple platforms where users have read access to the operations API. This poses significant risk to container management environments.

💻 Affected Systems

Products:
  • Canonical LXD
Versions: All versions < 6.5
Operating Systems: Linux, Multiple platforms
Default Config Vulnerable: ⚠️ Yes
Notes: Affects any LXD installation where users have read permissions to operations API endpoints.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full system compromise where attacker gains root privileges on the host system, potentially accessing all containers and host resources.

🟠

Likely Case

Privilege escalation from low-privileged user to root within LXD context, allowing container escape and unauthorized access to other containers.

🟢

If Mitigated

Limited impact if proper network segmentation and access controls prevent unauthorized users from reaching LXD API endpoints.

🌐 Internet-Facing: HIGH if LXD API is exposed to internet without proper authentication and authorization controls.
🏢 Internal Only: HIGH as internal attackers with read permissions can exploit this to gain elevated privileges.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Requires read permissions to LXD operations API and ability to establish WebSocket connections.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 6.5 or later

Vendor Advisory: https://github.com/canonical/lxd/security/advisories/GHSA-3g72-chj4-2228

Restart Required: Yes

Instructions:

1. Update LXD to version 6.5 or later using your package manager. 2. Restart LXD service. 3. Verify the update was successful.

🔧 Temporary Workarounds

Restrict API Access

linux

Limit access to LXD operations API endpoints to only trusted users and networks.

# Configure firewall rules to restrict access to LXD API ports
# Review and tighten LXD user permissions

Disable Unnecessary Features

linux

Disable terminal/console features if not required in your environment.

# Configure LXD to disable interactive console features if not needed

🧯 If You Can't Patch

  • Implement strict network segmentation to isolate LXD API from untrusted networks
  • Apply principle of least privilege - remove read permissions from non-essential users

🔍 How to Verify

Check if Vulnerable:

Check LXD version with 'lxd --version' or 'snap info lxd' if installed via snap. Compare against vulnerable versions (<6.5).

Check Version:

lxd --version

Verify Fix Applied:

Confirm LXD version is 6.5 or higher and test that terminal/console sessions cannot be hijacked by users with only read permissions.

📡 Detection & Monitoring

Log Indicators:

  • Unauthorized WebSocket connection attempts to operations API
  • Unexpected terminal session creations
  • Privilege escalation attempts in LXD logs

Network Indicators:

  • Suspicious WebSocket traffic to LXD API endpoints from unauthorized sources
  • Unexpected command execution patterns

SIEM Query:

source="lxd.log" AND ("WebSocket hijack" OR "unauthorized session" OR "privilege escalation")

🔗 References

📤 Share & Export