A valid token is not your token: OIDC lessons from the LXD advisory
- What happened?
- Four checks that were missing
- Why this is not just an LXD problem
- What I would do this week
- Conclusion
Hi there,
if you ask a developer “how do you validate a JWT?”, you usually hear three things: check the signature, check the issuer, check the expiry. That sounds complete. It isn’t.
Yesterday Canonical published an advisory for LXD, the system container and VM manager, that shows this very nicely. It is a small list of missing checks, and each one is a classic OpenID Connect mistake. I bet some of your apps have at least one of them.
What happened?
On November 26, 2026, the LXD project published GHSA-v3m9-p36m-qjqc with the title “OIDC tokens are not bound to the LXD client or to a verified user”. The key facts from the advisory:
- CVE: CVE-2026-135384, weakness CWE-287 (Improper Authentication).
- Severity: CVSS 3.1 base score 8.1 (High), vector
AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H. - Fixed versions: 5.0.12, 5.21.10 and 6.10.2.
- Origin: the advisory says it “was copied from the Incus advisory GHSA-cp5w-98j2-x2hv”, so the Incus fork, which shares LXD’s history, had the same issue.
The impact is not small. According to the advisory, in the default setup where OIDC clients are not passed to OpenFGA or a scriptlet for authorization, “any authenticated OIDC client has full control” of the server.
A secondary write-up I found quotes a different CVSS 4.0 score. I could not confirm it on a primary source, so I stick to the 8.1 from the advisory.
Four checks that were missing
The advisory describes how LXD accepted a JWT as a bearer token (or via the web UI cookie) after checking issuer, signature and expiry. Then it lists what was not checked:
- No audience binding. “Unless
oidc.audiencewas set, nothing tied that token to this […] server”. So a token that the same identity provider issued to a completely different application was accepted. - Tokens without a user. A signed token that names no user was accepted and authenticated with an empty user name. An identity with no name is still an identity, apparently.
- ID token instead of access token. “An ID token was accepted in place of the access token”, which meant checks that only applied to access tokens were skipped. The advisory names a subnet restriction claim and a shorter access-token lifetime as examples.
- Unverified email as the username. If
oidc.claimwas not set, the username came from theemailclaim, even when the provider marked that email as not verified. With OpenFGA or a scriptlet using email-based identities, the advisory says a user could be authorized as someone else by putting that person’s address on their own account.
Why this is not just an LXD problem
None of these mistakes is exotic. They come from mixing up two questions: “Was this token issued by someone I trust?” and “Was this token issued for me, about a real user?” The signature only answers the first one.
- The audience is the address on the envelope. The OpenID Connect Core spec requires the client to reject an ID token if its
auddoes not contain its own client ID. For access tokens, RFC 9068 says the resource server must reject a JWT access token whoseauddoes not contain a value identifying it. A signed letter from your bank is genuine, but if it’s addressed to your neighbour, you shouldn’t act on it. - ID tokens are not API keys. An ID token tells the client who logged in. It is not a credential for calling an API. RFC 9068 even defines a dedicated
typvalue,at+jwt, so resource servers can tell the two apart. - Email is a contact detail, not an identifier. OIDC Core defines
subas “a locally unique and never reassigned identifier within the Issuer”, while foremailit says the relying party “MUST NOT rely upon this value being unique”. Useiss+subas your key.
In big organisations, one IdP issues tokens for hundreds of apps, some written in an afternoon by an intern. If one of them leaks tokens, every API that skips the audience check inherits that leak.
What I would do this week
- Patch LXD (and Incus). Move to 5.0.12, 5.21.10 or 6.10.2, depending on your track.
- Apply the workarounds anyway. The advisory recommends setting
oidc.audienceto a value the IdP only puts into access tokens issued for LXD, and settingoidc.claimto a claim users can’t edit, such assub, or configuring the provider to release only verified emails. - Give each API its own audience at the IdP. Don’t reuse one generic client for everything.
- Grep your own code. Look for JWT validation that sets the audience check to “optional” or skips it. Look for code that reads
emailorpreferred_usernameas the primary key. Make sure your APIs reject tokens without asub. - Test with a wrong token. Request a token for app A and send it to API B. If B says yes, you have the same bug. This takes five minutes and is more fun than another policy review.
Conclusion
A valid signature tells you who wrote the token, not who it was written for. Every API needs to ask three questions: is it from my issuer, is it for me, and who exactly is this user? LXD forgot the last two, and the result was full control for any token from the same IdP. The fix is mostly configuration, so go check your audiences before someone else does.
Have a great Friday, and may all your tokens find the right address!
Magikarp
This post was researched and written by an AI agent (Claude) in Magikarp’s style and published automatically.