The daemon looped over every certificate the client sent, matched any of them against the trust store, then compared the matched certificate with itself. TLS only proves possession of the leaf key; the fix is a helper that returns PeerCertificates[0].

The server asked "does this chain contain a certificate I trust?" when the only safe question was "did the client prove it holds the key for the certificate it claims?" For every honest client both questions return the same answer. For an attacker holding nothing but public data, they return opposite ones.
This is the authentication path in lxd/daemon.go, inside Daemon.Authenticate, before the fix:
// Request has TLS. If client sent a peer certificate, check mTLS and CA.
if len(r.TLS.PeerCertificates) > 0 {
// Convert list of peer certificates to map.
peerCertificateFingerprints := make([]string, 0, len(r.TLS.PeerCertificates))
peerCertificates := make(map[string]x509.Certificate, len(r.TLS.PeerCertificates))
for _, c := range r.TLS.PeerCertificates {
f := shared.CertFingerprint(c)
peerCertificates[f] = *c
peerCertificateFingerprints = append(peerCertificateFingerprints, f)
}
...
matchedCerts := certGetter(peerCertificateFingerprints...)
Two variables carry the defect. peerCertificateFingerprints is a slice built from every certificate the client sent. certGetter is the trust-store lookup, and it is handed the whole slice at once. There is no point in the function where the code asks which of those certificates the client actually owns.
The code then performs what looks like a key check:
trusted, _ := util.CheckMutualTLS(peerCertificates[matchedFingerprint], matchedCerts)
CheckMutualTLS compares the DER bytes of the matched certificate with the DER bytes of the stored certificate. When the matched certificate is the one the attacker appended, that is the certificate compared against itself. It is byte-identical by definition. The function returns true, and the caller is authenticated as the owner of a certificate whose private key it has never seen.
LXD sets tls.RequestClientCert, which asks for a client certificate without validating the chain against a CA. That is deliberate: LXD clients are usually self-signed, so there is no public root to validate against, and the daemon does its own fingerprint lookup afterwards.
The consequence is narrow and absolute. In TLS 1.3 the client signs a transcript of the handshake with the private key of its leaf certificate, and the server verifies that signature in CertificateVerify. That is the only proof of possession in the connection. Every certificate after the first is attacker-supplied data whose sole legitimate purpose is to describe a path to a trust anchor. A server that treats each element as an identity has confused the path with the endpoint.
Upstream added one function to lxd/request/request.go:
// GetPeerCertificate returns the first peer certificate in the request TLS connection states peer certificate list.
func GetPeerCertificate(r *http.Request) (*x509.Certificate, error) {
if r.TLS == nil {
return nil, api.StatusErrorf(http.StatusBadRequest, "%w", ErrNoTLS)
}
if len(r.TLS.PeerCertificates) == 0 {
return nil, api.StatusErrorf(http.StatusBadRequest, "%w", ErrNoCertificate)
}
return r.TLS.PeerCertificates[0], nil
}
Then every trust decision was rewritten to use it. In daemon.go the slice becomes a single fingerprint:
peerCertificate, err := request.GetPeerCertificate(r)
...
peerCertificateFingerprint := shared.CertFingerprint(peerCertificate)
matchedCerts := certGetter(peerCertificateFingerprint)
The self-comparison disappears because the certificate being checked is now the one the handshake proved. CheckMutualTLS becomes a real comparison between the client's proven certificate and the stored entry, and the CA-signature path — core.trust_ca_certificates — is evaluated against that same leaf instead of looping over attacker-chosen candidates.
The helper landed first, then separate commits for the VM agent, the cluster and database gateway, the vsock endpoint, the main API, certificate self-service, and the tests. Part 6 mapped those six call sites. The point of listing them again here is that the defect was not a typo in one function; it was a pattern repeated wherever the code needed a client identity and reached for the list it had.
"Trusted certificates are a set. The client sends certificates. Intersect the sets." Each clause is true and the conclusion is false, because one set contains identities and the other contains public objects. The bug is catalogued as CWE-295, improper certificate validation, and scored CVSS v4.0 10.0 with the vector AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H — no privileges, no user interaction, and full impact on confidentiality, integrity and availability, in the vulnerable system and in everything downstream of it.
The Incus advisory adds the sentence that should end any argument about whether this was a recent regression: "This has been the case since the initial release." Every LXD and Incus build before its fixed release carried the same loop.

Next: Part 8 — four LTS lines, one tag that looks patched: the version matrix, the 6.10.0 trap, and why a current-looking number is not a fixed build.