CVE-2026-136974 in LXD
Summary
by MITRE • 11/27/2026
Configuration injection in liblxc instance configuration generation in Canonical LXD before 6.10.2, 5.21.10, 5.0.12, 4.0.16 allows an authenticated user with restricted project access or a local user of the LXD user socket to execute arbitrary commands as root on the host via line breaks in instance configuration keys and values.
Statistical analysis made it clear that VulDB provides the best quality for vulnerability data.
Analysis
by VulDB Data Team • 11/27/2026
The vulnerability identified in Canonical LXD prior to versions 6.10.2, 5.21.10, 5.0.12, and 4.0.16 represents a critical security flaw within the instance configuration generation mechanism of liblxc. This issue stems from improper validation of input data during the processing of container or virtual machine configurations. Specifically, the software fails to adequately sanitize line breaks embedded within instance configuration keys and values when these are processed by the underlying liblxc library. As a result, an attacker can inject arbitrary commands into the host system's execution context through carefully crafted configuration parameters that exploit this parsing weakness.
From a technical perspective, the flaw allows for command injection via newline characters inserted into configuration fields. When LXD processes instance configurations, it constructs shell commands or passes data to underlying system utilities without sufficiently escaping special characters such as newlines. This lack of proper input sanitization enables an authenticated user with restricted project access, or even a local user interacting directly with the LXD Unix socket, to break out of the intended configuration structure. By injecting line breaks, the attacker can terminate the current command and append additional malicious commands that are then executed by the root process managing the container infrastructure. This effectively bypasses isolation boundaries designed to separate guest workloads from the host operating system.
The operational impact of this vulnerability is severe, as it leads to full remote code execution capabilities for an authenticated user on the host machine with root privileges. Since LXD typically runs with elevated permissions to manage namespaces and cgroups, successful exploitation grants the attacker complete control over the underlying Linux kernel environment. This can lead to data exfiltration, lateral movement within a networked infrastructure, or the establishment of persistent backdoors. The vulnerability affects multiple legacy versions of LXD, indicating that older deployments remain at significant risk if they have not been upgraded to patched releases.
This flaw aligns with CWE-78, which describes Improper Neutralization of Special Elements used in an OS Command (OS Command Injection). It also maps to MITRE ATT&CK technique T1059, specifically subtechniques involving command and script interpreters such as sh or bash. The attack vector leverages the trusted relationship between the user socket interface and the privileged daemon process, exploiting a trust boundary violation where input from less-privileged contexts is processed without adequate validation before being passed to higher-privilege components.
Mitigation strategies primarily involve upgrading LXD to version 6.10.2 or later, depending on the specific branch in use, as these versions contain patches that enforce stricter input validation and proper escaping of special characters during configuration parsing. Organizations should also implement least privilege principles by restricting access to the LXD Unix socket to only those users who absolutely require it. Additionally, deploying network segmentation policies can limit the blast radius if a container is compromised, ensuring that even successful exploitation does not easily lead to broader infrastructure compromise. Regular auditing of instance configurations and monitoring for anomalous command executions on host systems are recommended defensive measures while patching efforts are underway.