/

CVE-2026-63298

Severity:

CRITICAL RISK

(9.9)

Command Injection (CWE-78) in LXD NVIDIA Config Handling

CVE-2026-63298

Analyzed

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Host-level Remote Code Execution

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

A critical command-injection vulnerability in LXD's NVIDIA instance configuration handling allows an authenticated attacker to inject configuration directives through specially crafted NVIDIA-related values.

If the attacker can create or modify an affected instance configuration, the resulting directives may cause arbitrary code execution on the host with the privileges of the LXD daemon.

Affected context

The vulnerability occurs in LXD deployments that process NVIDIA instance configuration values, including nvidia.driver.capabilities and nvidia.require.*, when generating the instance's lxc.conf file. Risk depends on an authenticated user having sufficient permission to configure instances and on the affected values being incorporated into generated configuration without adequate control-character neutralization.

Exploit preconditions

  • Attack surface: LXD instance configuration handling and generated container runtime configuration
  • Required access: Authenticated access with permission to create or modify relevant instance configuration
  • Trigger point: Processing NVIDIA-related configuration values while generating lxc.conf
  • Why exploitation is possible: Special characters in configuration values are not adequately neutralized, allowing attacker-controlled content to alter generated directives and influence privileged host-side processing

Why this happens

The underlying flaw is improper neutralization of special elements in user-controlled configuration data. Newline characters and related delimiters are accepted in NVIDIA configuration values and can change the structure of the generated LXC configuration rather than remaining ordinary data.

This behavior maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command or Command Argument, because attacker-controlled input crosses a configuration boundary into a privileged execution-related context without sufficient encoding, validation, or structural separation.

Potential impact

  • An attacker may execute arbitrary code on the host
  • The attacker could obtain the privileges of the LXD daemon
  • Host confidentiality, integrity, and availability may be compromised
  • Other containers, workloads, or stored data could be accessed or altered
  • The system could be used for lateral movement or persistence

General mitigation guidance

Mitigation generally focuses on treating instance configuration as untrusted input and preventing values from changing the structure of generated runtime configuration.

Common defensive patterns include:

  • Rejecting control characters, delimiters, and unexpected line breaks in configuration values
  • Applying strict allowlists and type-aware validation for NVIDIA capability and requirement fields
  • Building configuration through structured APIs rather than string concatenation
  • Separating data values from configuration directives and applying context-appropriate escaping
  • Restricting which authenticated roles may modify device and runtime-related settings
  • Running the LXD daemon with the minimum practical host privileges and limiting exposed management interfaces
  • Auditing existing instance configurations for unexpected directives or embedded control characters

How teams detect issues like this

Detection approaches commonly include:

  • Static analysis rules for concatenating user-controlled values into LXC or shell-adjacent configuration files
  • Code review checks for newline handling, delimiter validation, and direct generation of privileged configuration text
  • Dynamic tests using control characters and malformed values to verify rejection and safe serialization
  • Runtime monitoring for unexpected changes to generated lxc.conf files or unusual LXD child processes
  • Policy enforcement requiring schema validation and approved value sets for device-related configuration
  • Automated security review tools that flag command-injection sinks and unsafe string-based configuration generation

Sources

SourceLink
github.comgithub.com/canonical/lxd/security/advisories/GHSA-vfh7-q59q-54v2

Frequently asked

questions

It can be remotely exploitable through an exposed LXD management interface when an authenticated user has permission to modify the affected instance configuration. Exploitability depends on network exposure and authorization policy.

Authentication alone may not be sufficient. The attacker generally needs permission to create or update configuration values that are processed by the NVIDIA instance configuration path.

Treat these values as untrusted data, validate them against strict schemas and allowlists, reject control characters, and generate runtime configuration through structured serialization instead of unchecked string composition.

Apply least privilege to LXD users and the daemon, limit management-plane exposure, add negative tests for control characters and configuration injection, and continuously monitor generated configuration files and privileged process activity.

Find out what's already
exploitable in your codebase.