CVE-2025-54288: Canonical LXD Source Container Identification Vulnerability via cmdline Spoofing in devLXD Server
4.1
Basic Information
Technical Details
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| github.com/canonical/lxd | go | >= 4.0, < 5.21.4 | 5.21.4 |
| github.com/canonical/lxd | go | >= 6.0, < 6.5 | 6.5 |
| github.com/canonical/lxd | go | >= 0.0.0-20200331193331-03aab09f5b5c, < 0.0.0-20250827065555-0494f5d47e41 | 0.0.0-20250827065555-0494f5d47e41 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability, as described, is a container identification spoofing issue in Canonical's LXD. The root cause is the reliance on process command-line information (cmdline) to identify a container, without sufficient verification of the process's actual origin. An attacker with root in one container could launch a process with a spoofed name, making it appear to be the monitor process for a different container.
The analysis of the provided patches confirms this. The key change is the replacement of the loadContainerFromLXCMonitorPID function, which only parsed the command line, with a new function getLXCMonitorContainer. This new function adds a critical security check: it verifies the PID namespace of the process by reading the NSpid field from /proc/<pid>/status. If a process is running in a different PID namespace, it cannot be the legitimate monitor process, even if its name is spoofed.
Two primary vulnerable functions were identified that used this flawed logic:
-
devlxdFindContainerForPIDinlxd/api_devlxd.go: This was the main function responsible for mapping a process ID to a container for devLXD API requests. The patch shows the removal of the loop that walked the process tree and called the insecureloadContainerFromLXCMonitorPID. -
An anonymous function within
(*Daemon).init()inlxd/daemon.go: This function serves as a seccomp handler and also usedloadContainerFromLXCMonitorPIDto identify containers from PIDs. This provided a second vector for the same attack.
By exploiting these functions, an attacker could bypass container isolation and access sensitive information from other containers on the same host, including metadata, configuration, and device information. The fix, applied in both locations, mitigates this by ensuring the process's PID namespace is validated, preventing the spoofing attack. Security teams should ensure they have patched to LXD 5.21.4 or 6.5 to remediate this vulnerability.
Vulnerable functions
devlxdFindContainerForPIDlxd/api_devlxd.go
(*Daemon).init.func1lxd/daemon.go