Skip to main content
Menu
Advisories

OIDC tokens are not bound to the LXD client or to a verified user

GHSA-V3M9-P36M-QJQCPublished Updated GitHub

Description

Reported from Incus. This advisory was copied from the Incus advisory GHSA-cp5w-98j2-x2hv.

When OIDC authentication is configured, Incus accepts a JWT sent as bearer token (or through the web UI cookie) after checking its issuer, signature and expiry. Unless oidc.audience was set, nothing tied that token to this Incus server:

  • A token that the same identity provider issued to a different application was accepted.
  • A token signed by the provider that doesn't name any user was accepted, and its bearer was authenticated with an empty user name.
  • An ID token was accepted in place of the access token, so the checks meant for the access token, such as the incus.allowed_subnets claim and its shorter lifetime, could be skipped by sending the other token.

Separately, when oidc.claim is unset, the user name is taken from the token's email claim. That claim was used even when the provider marks the address as unverified.

Impact

Anyone who can obtain a JWT signed by the configured OIDC issuer can authenticate to the Incus API, without ever having been given access to Incus. This includes the operator of any other application registered with the same provider, who receives such a token whenever a user signs in to that application and can then act on Incus as that user. With providers that sign responses for unauthenticated requests, no account at the provider is needed at all.

With the default configuration, where OIDC clients are not sent to OpenFGA or an authorization scriptlet, any authenticated OIDC client has full control of the Incus server.

On servers that do authorize OIDC users through OpenFGA or a scriptlet and identify them by e-mail address, a user who can set an unverified e-mail address on their own account at the provider can be authorized as the user owning that address, with all of that user's permissions.

A user restricted to specific networks through the incus.allowed_subnets claim can reach the API from any network.

Workarounds

Set oidc.audience to a value that the identity provider only puts in access tokens issued for Incus. This rejects tokens issued to other applications and ID tokens sent in place of the access token.

Set oidc.claim to a claim that users can't edit themselves, such as sub, or configure the provider to only release verified e-mail addresses.

References

GitHub · canonical/lxd