/

CVE-2026-28384

Severity:

CRITICAL RISK

(9.9)

OS Command Injection (CWE-78) in Canonical LXD API

CVE-2026-28384

Analyzed

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Remote Command Execution and LXD Daemon Compromise

Severity:

CRITICAL RISK

(9.9)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Canonical LXD contains an improper sanitization flaw in the compression_algorithm parameter used by image and backup API endpoints. An authenticated, unprivileged user may exploit this issue to execute commands with the privileges of the LXD daemon on the LXD server.

Affected context

The vulnerability occurs in LXD deployments where authenticated users can access image or backup API endpoints and supply the compression_algorithm parameter. Risk exists when that parameter is incorporated into command execution without sufficiently restricting its value to an approved set of compression algorithms.

Exploit preconditions

  • Attack surface: LXD image and backup API endpoints
  • Required access: An authenticated account with access to the relevant API operations; administrative privileges may not be required
  • Trigger point: Processing the compression_algorithm parameter during an image or backup operation
  • Why exploitation is possible: Improper sanitization allows attacker-controlled input to reach an operating-system command execution context

Why this happens

The underlying bug is an OS command injection condition mapped to CWE-78. LXD treats a user-controlled compression algorithm value as command-related data without enforcing a strict allowlist or maintaining a safe separation between data and executable arguments. As a result, specially crafted input may alter the intended command behavior when image or backup operations are processed.

Potential impact

  • An attacker may execute arbitrary commands on the LXD server
  • The LXD daemon account or its associated service context could be compromised
  • Host files, container data, images, or backups may be accessed or modified
  • Attackers could establish persistence or disrupt LXD-managed workloads
  • The compromise could enable lateral movement into connected infrastructure

General mitigation guidance

Mitigation generally focuses on preventing user-controlled values from reaching shell or operating-system command interpreters.

Common defensive patterns include:

  • Restricting compression algorithm values to a small, explicit allowlist
  • Passing validated arguments through parameterized process APIs rather than shell evaluation
  • Separating command construction from input handling and avoiding command-string concatenation
  • Applying strict authorization boundaries to image and backup operations
  • Running the LXD daemon with only the privileges required for its operational duties
  • Limiting access to the LXD API and monitoring authenticated activity involving image and backup endpoints
  • Applying vendor-provided security fixes through the organization's normal patch-management process

How teams detect issues like this

Organizations can look for command injection risks through:

  • Static analysis rules identifying shell execution APIs, command-string concatenation, and unvalidated parameters
  • Code review checks for user-controlled values passed to process-spawning or shell-invocation functions
  • Policy enforcement requiring allowlists for enumerated configuration and API parameters
  • Runtime monitoring for unexpected child processes launched by the LXD daemon
  • Audit analysis of image and backup API requests, including unusual compression algorithm values or anomalous command activity
  • Automated security scanning and code review tools that flag unsafe operating-system command construction

Sources

SourceLink
discourse.ubuntu.comdiscourse.ubuntu.com/t/lxd-authenticated-remote-code-execution-fixes-available/78365
github.comgithub.com/canonical/lxd/commit/043696a13171ace7dd4c2b32d34ce039ab629052
github.comgithub.com/canonical/lxd/commit/7046979645c2ce1b63b2f9e60ddf6cbc4c4b78f9
github.comgithub.com/canonical/lxd/commit/b7b411caf5c4971bfe2386c72128f44d7e2aaf4f
github.comgithub.com/canonical/lxd/security/advisories/GHSA-4rmf-rcp8-2r9g

Frequently asked

questions

It may be exploitable through LXD API requests when the service is reachable and the attacker has a valid authenticated account with access to the affected image or backup functionality.

No. The issue is described as exploitable by an authenticated, unprivileged user, although the precise scope depends on the deployment's API authorization policy.

Treat the compression algorithm as an enumerated value, enforce a strict allowlist, and pass validated arguments through APIs that do not invoke a shell or interpret command syntax.

Minimize API exposure, apply least-privilege authorization, review all process-spawning code, use static analysis for command construction, and monitor daemon activity for unexpected processes.

Find out what's already
exploitable in your codebase.