Skip to main content
Menu
Advisories

The Auth0 provider's refresh-profile cache is not scoped by tenant, allowing cross-tenant Backstage identity issuance

GHSA-94X8-8MGJ-4MWWPublished Updated GitHub

Description

Impact

The @backstage/plugin-auth-backend-module-auth0-provider package caches the user profile obtained when refreshing an existing sign-in session, with a one-minute TTL, keyed only by the textual sub claim of the user's Auth0 ID token. The cache key has no tenant or issuer component, and a single profile cache is shared by all configured environments of the auth0 provider within a backend process. The environment used for a request is selected per request, for example through the ?env= query parameter, so refreshes performed through different configured environments read and write the same cache entries. This profile cache was introduced in version 0.4.0 of the package.

When two environments of the provider are configured against different Auth0 tenants (different domain values), a session refresh performed through one environment can be served a profile that was cached for a user of the other tenant, if the two users have textually identical sub values. OIDC subject identifiers are unique only within their issuing tenant; Auth0 assigns user IDs independently in each tenant, so two users of different tenants can share a textual subject. The sign-in resolver then resolves the substituted profile, typically by the email it carries, to the other user's Backstage identity, and the session is issued as that user with their ownership and group memberships.

Exploiting this requires all of the following conditions:

  • Two or more configured environments of the auth0 provider pointing at different Auth0 tenants. Deployments where all environments share a single tenant are not affected, because subject identifiers are unique within a tenant.
  • An attacker-held account in one of the configured tenants, used to sign in through that environment. No Backstage credentials of the other user are needed, and no user interaction is required.
  • A textual collision between the attacker's subject and the subject of a user in the other tenant. The collision is probabilistic rather than chosen: the attacker cannot target a specific user, although repeated refresh attempts increase the chance of hitting an active cache entry.
  • A timing race: a refresh by the other user through their environment must occur within the 60-second cache TTL before the attacker's refresh through the other environment. The substitution also works in the reverse direction, serving the attacker's profile to the other user.
  • An email-based sign-in resolver, the common configuration, so that the substituted profile resolves to the other user's catalog entity.

Only the cached profile is substituted: the attacker's own OAuth tokens still originate from their own tenant, and no Auth0 tokens are exposed to either party. The one-minute cache TTL only limits how often a confused identity can be issued; a session issued from a substituted profile remains valid for the backend's normal session lifetime.

Patches

The fix scopes the refresh-profile cache key by the environment's configured Auth0 domain, so that a profile cached for one tenant can never be served to a session refreshed through another tenant; single-tenant deployments keep their existing behavior. The fix is included in @backstage/plugin-auth-backend-module-auth0-provider 0.4.8 (Backstage release 1.57.4); every earlier published version of the provider is affected.

Workarounds

  • Do not configure multiple environments of the auth0 provider against different Auth0 tenants in the same backend. Configurations in which all environments share a single tenant are not affected.
  • If distinct tenants must be used, no complete workaround is available before upgrading to the fixed release.

References

Affected versions

References

GitHub · backstage/backstage