Cloudanix VulnDB

CVE-2024-6219

Low · 3.8

lxd has a restricted TLS certificate privilege escalation when in PKI mode

CVSS

3.8

EPSS

0.2%

Published

Dec 9, 2024

CISA due date

—

Cloudanix analysis

Monitor only SSVC: Track

A configuration handling mistake in LXD can let someone who should only have limited access instead take full control of the container environment.

Exploitation
Remote Authenticated
Attacker needs
Low Privilege
Complexity
Low
Impact
Privilege Gain
Component
Application
Class
Authentication Bypass
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

In PKI mode (triggered by presence of server.ca), LXD ignores the restricted flag on CA-signed client certificates added to the trust store when core.trust_ca_certificates is false, granting full administrative access via mTLS instead of the intended limited permissions.

Why it matters to the business

Attackers who obtain any CA-signed certificate can obtain complete control over LXD, allowing them to create, modify, or delete containers and access underlying host resources without authorization.

How an attack unfolds

An attacker generates or obtains a client certificate that has been signed by the configured CA but marked as restricted, connects to LXD over the network or local socket using that certificate, and receives full privileges because the restriction enforcement is bypassed during trust-store insertion.

How to fix it

Upgrade canonical/lxd to commit 0e7f2b5bf4d2bc4eb3abc54b2b5e12c3be663820 or later; after upgrade, verify that core.trust_ca_certificates behaves correctly with restricted certificates and rotate any previously trusted certificates if exposure is suspected.

How to confirm the fix worked

Confirm the running LXD binary or source matches commit 0e7f2b5bf4d2bc4eb3abc54b2b5e12c3be663820 or newer; test by adding a restricted CA-signed certificate and verifying that subsequent operations are still limited to the declared restrictions.

Typical attack path

  1. Ensure LXD starts with a server.ca file present in LXD_DIR to enter PKI mode
  2. Obtain or forge a client certificate signed by that CA but configured with restricted=true
  3. Connect to the LXD daemon using the restricted certificate over the configured endpoint
  4. Perform privileged operations that should have been blocked by the certificate restrictions

How to detect it

Review LXD daemon logs for certificate addition events, especially entries referencing trust store updates or mTLS connections from CA-signed clients; correlate with unexpected privileged API calls after a restricted certificate was added.

  • core.trust_ca_certificates=false
  • Adding certificate to trust store while in PKI mode

What your security team should do

  • Immediately upgrade all LXD installations to the fixed commit
  • Audit existing trusted certificates for unintended full-access grants
  • Disable PKI mode or set core.trust_ca_certificates=true where operationally feasible
  • Monitor certificate trust-store changes in LXD logs

The record

If a `server.ca` file is present in `LXD_DIR` at LXD start up, LXD is in "PKI mode". In this mode, all clients must have certificates that have been signed by the CA. The LXD configuration option `core.trust_ca_certificates` defaults to `false`. This means that although the client certificate has been signed by the CA, LXD will additionally add the certificate to the trust store and verify it via mTLS. When a restricted certificate is added to the trust store in this mode, it's restrictions are not honoured, and the client has full access to LXD.

Affected packages

Ecosystem Package Introduced Fixed
Go github.com/canonical/lxd 0 0.0.0-20240403103450-0e7f2b5bf4d2
Ubuntu:20.04:LTS lxd 0 No fix
Ubuntu:Pro:16.04:LTS lxd 0 No fix
Ubuntu:Pro:18.04:LTS lxd 0 No fix
Ubuntu:Pro:20.04:LTS lxd 0 No fix
openSUSE:Tumbleweed govulncheck-vulndb 0 0.0.20241209T183251-1.1

Related vulnerabilities