CVE-2024-6156
Low · 3.8lxd CA certificate sign check bypass
CVSS
3.8
EPSS
0.2%
Published
Dec 9, 2024
CISA due date
—
Cloudanix analysis
LXD can be tricked into letting the wrong people take control of containers when it is set to use only approved certificates.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- 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 server.ca in LXD_DIR), LXD accepts TLS clients presenting non-CA-signed certificates that exist in the trust store, violating the intended CA-only authentication policy.
Why it matters to the business
Unauthorized parties can obtain management access to LXD, enabling them to create, modify, or exfiltrate containers and potentially compromise the underlying host infrastructure.
How an attack unfolds
An attacker prepares a non-CA-signed certificate already present in the LXD trust store, initiates a TLS handshake from a manual client such as curl that transmits the certificate, and thereby authenticates successfully despite PKI mode being active.
How to fix it
Upgrade canonical/lxd to commit 2eacddbb65acf10b2fcea4ee92374a90d2376dc4 or newer; after upgrade, confirm PKI mode correctly rejects non-CA-signed certificates even when present in the trust store.
How to confirm the fix worked
After applying the fix, start LXD with server.ca present, attempt authentication using a manual client with a non-CA-signed trusted certificate, and verify the connection is rejected.
Typical attack path
- Locate an LXD deployment that has server.ca present at startup
- Ensure a non-CA-signed certificate is added to the trust store
- Perform a TLS handshake using a non-Go client (e.g., curl) that sends the certificate
- Issue LXD API or CLI commands under the obtained identity
How to detect it
Inspect LXD daemon logs for authentication successes that originate from non-Go clients or that reference certificates lacking a CA signature; correlate with API command history for unexpected operations.
What your security team should do
- Apply the referenced LXD commit immediately on all affected deployments
- Audit the trust store and remove any non-CA certificates that are no longer required
- Enable additional logging of TLS client certificate details during authentication
- Restrict direct network access to the LXD API to trusted management networks only
The record
If a `server.ca` file is present in `LXD_DIR` at LXD start up, LXD is in "PKI mode". In this mode, only TLS clients that have a CA-signed certificate should be able to authenticate with LXD. We have discovered that if a client that sends a non-CA signed certificate during the TLS handshake, that client is able to authenticate with LXD if their certificate is present in the trust store. - The LXD Go client (and by extension `lxc`) does not send non-CA signed certificates during the handshake. - A manual client (e.g. `cURL`) might send a non-CA signed certificate during the handshake.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Go | github.com/canonical/lxd | 0 | 0.0.0-20240708073652-5a492a3f0036 |
| Debian:12 | lxd | 0 | No fix |
| Debian:13 | incus | 0 | 6.0.3-1 |
| Debian:13 | lxd | 0 | No fix |
| Debian:14 | incus | 0 | 6.0.3-1 |
| 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
- GO-2025-4121 LXD vulnerable to a local privilege escalation through custom storage volumes in lxd in… Also affects github.com/canonical/lxd
- GO-2025-4003 CSRF Vulnerability When Using Client Certificate Authentication with the LXD-UI in… Also affects github.com/canonical/lxd
- GO-2025-3999 Privilege Escalation via WebSocket Connection Hijacking in Operations API in… Also affects github.com/canonical/lxd
- GO-2025-4000 Canonical LXD Path Traversal Vulnerability in Instance Log File Retrieval Function in… Also affects github.com/canonical/lxd
- GO-2025-4001 Canonical LXD Source Container Identification Vulnerability via cmdline Spoofing in… Also affects github.com/canonical/lxd
- GO-2025-4005 Canonical LXD Project Existence Determination Through Error Handling in Image Get… Also affects github.com/canonical/lxd
- GO-2025-4002 Canonical LXD Project Existence Determination Through Error Handling in Image Export… Also affects github.com/canonical/lxd
- CVE-2024-6219 lxd has a restricted TLS certificate privilege escalation when in PKI mode Also affects github.com/canonical/lxd