CVE-2026-112816 is one CVE, but it is not one code path. The same "scan the whole chain" loop appeared in the main API, the metrics endpoint, the cluster and database gateway, certificate self-service, token enrolment, and the VM agent. Fixing one would have left the others open.

The shared helper that did not exist

Before the fix, each authentication site walked r.TLS.PeerCertificates itself. There was no shared function that said "this is the client's identity". Six call sites, six loops, one assumption: that any certificate in the list could represent the client.

The upstream fix adds request.GetPeerCertificate, which returns PeerCertificates[0] and an error when the list is empty. It then rewrites every call site to use it. The size of that change is the clearest map of the blast radius.

1. The main HTTPS API

This is the path the CVE is named for. A client sends a chain whose first certificate it controls and whose second certificate is a trusted server or client certificate. The old code matched the second one and authenticated the caller as its owner.

2. The metrics endpoint

Metrics certificates are a separate trust-store type, intended to allow monitoring systems to scrape /1.0/metrics without granting full API access. The same chain scan meant a metrics certificate could be appended to a chain and used to reach more than metrics, depending on which certificate matched first.

3. The cluster and database gateway

Cluster members authenticate to each other with server certificates. The database gateway — the dqlite traffic that carries the cluster's replicated state — uses the same TLS identity. Appending another member's server certificate gave an attacker the cluster's internal trust, which bypasses the per-project authorization layer entirely.

This is the most damaging of the secondary paths. A cluster member is not a tenant; it is part of the control plane. Its certificate is trusted for operations that no ordinary client can perform.

4. Certificate self-renewal and self-deletion

LXD lets a client manage its own trust-store entry: renew the certificate when it expires, or delete it when the client is retired. Those paths also compared the whole chain. A client could therefore renew or delete another trust-store entry by presenting that entry's certificate in its chain, without holding the corresponding key.

Deletion is the quieter problem. An attacker who can delete a certificate can remove a defender's access, or remove the audit trail's ability to correlate an identity with its key.

5. Token-based certificate enrolment

Adding a new client normally uses a trust token. The enrolment path checks the certificate presented with the token before adding it to the trust store. If that check scans the chain, a token holder can enrol a certificate that impersonates an existing trusted identity rather than adding a new one.

6. The VM agent over vsock

LXD VMs run an agent that the host connects to over vsock. That connection is also mutually authenticated with certificates. The agent checked the chain the same way, so a compromised or malicious guest could present a trusted certificate it did not own and be treated as the host.

The guest-to-host boundary is supposed to be a security boundary. A chain-confusion bug on that socket is a guest escape primitive, even if it requires the guest to be running first.

The configuration-level shortcut

Separate from the code bug, LXD has a setting called core.trust_ca_certificates. When enabled, any certificate signed by the configured CA is trusted without the normal mutual-TLS check. That is a deliberate convenience for large estates, and it is also a standing bypass: the CA's signature, not the client's key, becomes the credential.

A trust store that contains CA certificates has a similar effect even with the setting off, because the old chain scan would match the CA certificate itself. The fix removes the chain scan, but the operational lesson remains: a CA entry is not a client identity.

The audit batch

On 26 November 2026, Canonical published more than twenty LXD advisories from a security audit. They cover restricted-project escapes, host file access through backups and device nodes, OIDC token binding, and certificate trust handling. One of them, CVE-2026-135383, describes restricted and revoked TLS clients gaining unrestricted access through certificate trust handling — a different bug in the same neighborhood.

That batch is context, not a second mechanism. CVE-2026-112816 is specifically the leaf-versus-chain comparison. The others show why the trust store deserves the same scrutiny as a password database.

Next: Part 7 — trusted by certificate, not by key: the one-word defect, the handshake proof it ignored, and the exact upstream fix.