Vulnerabilities in pkg:golang/github.com/canonical/lxd

PACKAGE
Advisory Identifier: GHSA-jpmc-7p9c-4rxf
Advisory Summary

CVE-2024-6219 is a LOW (CVSS 3.8) lxd has a restricted tls vulnerability (CWE-287: Improper Authentication) affecting Github.com/canonical/lxd libraries in the Go ecosystem. The issue involves lxd has a restricted tls certificate privilege escalation when in pki mode. Remediation is available by upgrading affected packages to version 0.0.0-20240403103450-0e7f2b5bf4d2.

14 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/github.com/canonical/lxd

14 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:golang/github.com/canonical/lxd. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-jpmc-7p9c-4rxf CVE-2024-6219 LOW lxd has a restricted TLS certificate privilege escalation when in PKI mode
GHSA-fm2x-c5qw-4h6f CVE-2026-34177 CRITICAL LXD: VM lowlevel restriction bypass via raw.apparmor and raw.qemu.conf
GHSA-q96j-3fmm-7fv4 CVE-2026-34178 CRITICAL LXD: Importing a crafted backup leads to project restriction bypass
GHSA-c3h3-89qf-jqm5 CVE-2026-34179 CRITICAL LXD: Update of type field in restricted TLS certificate allows privilege escalation to cluster admin
GHSA-crmg-9m86-636r CVE-2026-3351 MODERATE lxd's non-recursive certificate listing bypasses per-object authorization and leaks all fingerprints
GHSA-3g2j-vm47-x4mj - HIGH LXD vulnerable to a local privilege escalation through custom storage volumes
GHSA-xch9-h8qw-85c7 CVE-2025-54291 MODERATE Canonical LXD Project Existence Determination Through Error Handling in Image Get Function
GHSA-p8hw-rfjg-689h CVE-2025-54286 HIGH Canonical LXD CSRF Vulnerability When Using Client Certificate Authentication with the LXD-UI
GHSA-7232-97c6-j525 CVE-2025-54288 MODERATE Canonical LXD Source Container Identification Vulnerability via cmdline Spoofing in devLXD Server
GHSA-3g72-chj4-2228 CVE-2025-54289 HIGH Canonical LXD Vulnerable to Privilege Escalation via WebSocket Connection Hijacking in Operations API
GHSA-p3x5-mvmp-5f35 CVE-2025-54290 MODERATE Canonical LXD Project Existence Determination Through Error Handling in Image Export Function
GHSA-472f-vmf2-pr3h CVE-2025-54293 HIGH Canonical LXD Path Traversal Vulnerability in Instance Log File Retrieval Function
GHSA-x9qq-236j-gj97 - LOW Canonical LXD documentation improvement to make clear restricted.devices.disk=allow without restricted.devices.disk.paths also allows shift=true
GHSA-4c49-9fpc-hc3v CVE-2024-6156 LOW lxd CA certificate sign check bypass

CVE-2024-6219 at a Glance

CVE Identifier CVE-2024-6219
GHSA Identifier GHSA-jpmc-7p9c-4rxf
Severity LOW
CVSS v3.1 Base Score 3.8
CWE Classification CWE-287: Improper Authentication
Affected Product Github.com/canonical/lxd
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 3.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:L/I:N/A:N).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2024-6219

To remediate this vulnerability, upgrade all affected Github.com/canonical/lxd dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/canonical/lxd fixed: 0.0.0-20240403103450-0e7f2b5bf4d2
Upgrade github.com/canonical/lxd to 0.0.0-20240403103450-0e7f2b5bf4d2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/canonical/lxd

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-6219, inspect your project dependencies for Github.com/canonical/lxd:

inspect dependencies for github.com/canonical/lxd

Analyze the terminal output to locate any version of Github.com/canonical/lxd in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.0.0-20240403103450-0e7f2b5bf4d2), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-287: Improper Authentication, where when an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct. In Github.com/canonical/lxd, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary 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. ### Details When authorization was refactored to allow for generalisation (at the time for TLS, RBAC, and OpenFGA, see https://github.com/canonical/lxd/pull/12313), PKI mode did not account for the `core.trust_ca_certificates` configuration option. When this option is enabled, all CA-signed client certificates are given full access to LXD. [This cherry-pick from Incus](https://github.com/canonical/lxd/pull/12513/commits/5cdc9a35b9c51e981b1e70330bde0413ccacc7fd) was added to LXD to fix the issue. The cherry-pick fixed the immediate issue and allowed full access to LXD for CA-signed client certificates when `core.trust_ca_certificates` is enabled, but did not consider the behaviour of LXD when `core.trust_ca_certificates` is disabled. When `core.trust_ca_certificates` is false, restrictions that are applied to a certificate should be honoured. Instead, they are being ignored due to the presence of a `server.ca` file in `LXD_DIR`. ### PoC ``` # Install/initialize LXD $ snap install lxd --channel 5.21/stable $ lxd init --auto $ lxc config set core.https_address=127.0.0.1:8443 # Use easyrsa for configuring CA: https://github.com/OpenVPN/easy-rsa $ cp -R /usr/share/easy-rsa "/tmp/pki" $ export EASYRSA_KEY_SIZE=4096 $ cd /tmp/pki $ ./easyrsa init-pki $ echo "lxd" | ./easyrsa build-ca nopass $ ./easyrsa build-client-full lxd-client nopass $ cp pki/ca.crt /var/snap/lxd/common/lxd/server.ca $ cp pki/issued/lxd-client.crt ~/snap/lxd/common/config/client.crt $ cp pki/private/lxd-client.key ~/snap/lxd/common/config/client.key # Restart daemon. $ systemctl reload snap.lxd.daemon # Add a restricted certificate to the trust store. $ token="$(lxc config trust add --name ca-test --quiet --restricted)" $ lxc remote add tls "${token}" # Our client has a CA-signed certificate, but it is restricted, so the client should not be able to view server config. $ lxc config get tls: core.https_address 127.0.0.1:8443 ``` ### Impact I believe this vulnerability is low impact because PKI mode is: 1. Not the standard or recommended mode of operation for LXD. 2. While `core.trust_ca_certificates` defaults to false, we believe that users who enable PKI mode will generally have `core.trust_ca_certificates` enabled to allow for passwordless PKI with CRL revocation (see https://github.com/canonical/lxd/issues/3832). When this mode is enabled, all clients with CA-signed certificates have root access* anyway. *Note: If a restricted certificate is added before `core.trust_ca_certificates` is enabled, the certificate becomes unrestricted. We believe this was the original intention of the PR, but this should be changed to disallow any unintended permission change.

CVE-2024-6219 Affected Github.com/canonical/lxd Versions

1 component(s)
Fixed Versions:
0.0.0-20240403103450-0e7f2b5bf4d2
Product / Package Ecosystem Affected Versions Fixed Version
github.com/canonical/lxd
Go
< 0.0.0-20240403103450-0e7f2b5bf4d2
0.0.0-20240403103450-0e7f2b5bf4d2

References

Frequently Asked Questions

What is CVE-2024-6219?
CVE-2024-6219 is a security vulnerability in Github.com/canonical/lxd involving lxd has a restricted TLS certificate privilege escalation when in PKI mode under CWE-287: Improper Authentication.
Which Github.com/canonical/lxd versions are affected?
Affected versions include releases prior to 0.0.0-20240403103450-0e7f2b5bf4d2 across affected packages: github.com/canonical/lxd.
What version fixes CVE-2024-6219?
Upgrading to 0.0.0-20240403103450-0e7f2b5bf4d2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/canonical/lxd affected?
Yes, github.com/canonical/lxd is affected in releases prior to 0.0.0-20240403103450-0e7f2b5bf4d2. Upgrade your dependency to 0.0.0-20240403103450-0e7f2b5bf4d2 or later.
What is the CVSS score of CVE-2024-6219?
CVE-2024-6219 has a CVSS v3.1 base score of 3.8 (LOW) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:L/I:N/A:N.
What CWE is associated with CVE-2024-6219?
CVE-2024-6219 is classified under CWE-287: Improper Authentication (When an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct.).
How can I check Go dependencies for CVE-2024-6219?
Run the dependency tree command: 'inspect dependencies for github.com/canonical/lxd'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-jpmc-7p9c-4rxf",
  "modified" : "2026-06-26T19:31:18Z",
  "published" : "2024-12-09T22:43:13Z",
  "aliases" : [ "CVE-2024-6219" ],
  "summary" : "lxd has a restricted TLS certificate privilege escalation when in PKI mode",
  "details" : "### Summary\nIf 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. \n\nThe 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.\n\nWhen 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.\n\n### Details\nWhen authorization was refactored to allow for generalisation (at the time for TLS, RBAC, and OpenFGA, see https://github.com/canonical/lxd/pull/12313), PKI mode did not account for the `core.trust_ca_certificates` configuration option. When this option is enabled, all CA-signed client certificates are given full access to LXD. [This cherry-pick from Incus](https://github.com/canonical/lxd/pull/12513/commits/5cdc9a35b9c51e981b1e70330bde0413ccacc7fd) was added to LXD to fix the issue. \n\nThe cherry-pick fixed the immediate issue and allowed full access to LXD for CA-signed client certificates when `core.trust_ca_certificates` is enabled, but did not consider the behaviour of LXD when `core.trust_ca_certificates` is disabled. \n\nWhen `core.trust_ca_certificates` is false, restrictions that are applied to a certificate should be honoured. Instead, they are being ignored due to the presence of a `server.ca` file in `LXD_DIR`.\n\n### PoC\n```\n# Install/initialize LXD\n$ snap install lxd --channel 5.21/stable\n$ lxd init --auto\n$ lxc config set core.https_address=127.0.0.1:8443\n\n# Use easyrsa for configuring CA: https://github.com/OpenVPN/easy-rsa\n$ cp -R /usr/share/easy-rsa \"/tmp/pki\"\n$ export EASYRSA_KEY_SIZE=4096\n$ cd /tmp/pki\n$ ./easyrsa init-pki\n$ echo \"lxd\" | ./easyrsa build-ca nopass\n$ ./easyrsa build-client-full lxd-client nopass\n$ cp pki/ca.crt /var/snap/lxd/common/lxd/server.ca\n$ cp pki/issued/lxd-client.crt ~/snap/lxd/common/config/client.crt\n$ cp pki/private/lxd-client.key ~/snap/lxd/common/config/client.key\n\n# Restart daemon.\n$ systemctl reload snap.lxd.daemon\n\n# Add a restricted certificate to the trust store.\n$ token=\"$(lxc config trust add --name ca-test --quiet --restricted)\"\n$ lxc remote add tls \"${token}\"\n\n# Our client has a CA-signed certificate, but it is restricted, so the client should not be able to view server config.\n$ lxc config get tls: core.https_address\n127.0.0.1:8443\n```\n\n### Impact\nI believe this vulnerability is low impact because PKI mode is:\n1. Not the standard or recommended mode of operation for LXD.\n2. While `core.trust_ca_certificates` defaults to false, we believe that users who enable PKI mode will generally have `core.trust_ca_certificates` enabled to allow for passwordless PKI with CRL revocation (see https://github.com/canonical/lxd/issues/3832). When this mode is enabled, all clients with CA-signed certificates have root access* anyway.\n\n*Note: If a restricted certificate is added before `core.trust_ca_certificates` is enabled, the certificate becomes unrestricted. We believe this was the original intention of the PR, but this should be changed to disallow any unintended permission change.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/canonical/lxd"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.0.0-20240403103450-0e7f2b5bf4d2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/canonical/lxd/security/advisories/GHSA-jpmc-7p9c-4rxf"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-6219"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/canonical/lxd/pull/12313"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/canonical/lxd/commit/5cdc9a35b9c51e981b1e70330bde0413ccacc7fd"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/canonical/lxd"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2024-3313"
  }, {
    "type" : "WEB",
    "url" : "https://www.cve.org/CVERecord?id=CVE-2024-6219"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-287", "CWE-295" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-12-09T22:43:13Z",
    "nvd_published_at" : "2024-12-06T00:15:04Z"
  }
}