Canonical LXD Source Container Identification Vulnerability via cmdline Spoofing in devLXD Server
Date: 2025-10
Affected: go/github.com/canonical/lxd, go/github.com/canonical/lxd, go/github.com/canonical/lxd
Attack vector: info-disclosure
Category: vulnerability-disclosure
Severity: Medium
CVE: CVE-2025-54288
CWE: CWE-290
CVSS: 4.1 (CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:L/I:N/A:N)

### Impact In LXD's devLXD server, the source container identification process uses process cmdline (command line) information, allowing attackers to impersonate other containers by spoofing process names. The core issue lies in the findContainerForPID function in `lxd/api_devlxd.go`. This function identifies senders through two steps as shown below: 1. cmdline-based identification: Check while tracing back through parent processes, and if it starts with `[lxc monitor]`, extract the project name and container name from that process name in the format projectName_containerName. 2. PID namespace-based identification: If not found in Step 1, check against all containers' PID namespaces. https://github.com/canonical/lxd/blob/43d5189564d27f6161b430ed258c8b56603c2759/lxd/api_devlxd.go#L166-L276 Attackers can exploit Step 1 processing to impersonate arbitrary containers across projects by spoofing process names. ### Reproduction Steps 1. Access devLXD server from a normal container (e.g., EEEE): ``` root@EEEE:~# curl --unix-socket /dev/lxd/sock http://lxd-host/1.0/meta-data instance-id: 9f928574-2561-4eff-af82-a68e57d3c68b local-hostname: EEEE ``` 2. Use exec -a to spoof process name and impersonate another container (DDDD): ``` root@EEEE:~# bash -c "exec -a '[lxc monitor]' curl --unix-socket /dev/lxd/sock http://lxd-host/1.0/meta-data -x 'test-project_DDDD'" instance-id: 1bb2f1c3-3ad2-4cd6-9965-67b14c3582cc local-hostname: DDDD ``` This attack successfully obtains metadat


Mitigations:

Architectural layers (MAESTRO):