Any OIDC login failure discards the cached dynamic client id #67

Closed
opened 2026-09-12 01:51:23 -04:00 by jared · 0 comments
Owner

Severity: low · Type: bug · Confidence: high

Location: src/app/pages/auth/oidc/oidcLoginUtil.ts:29-49, src/app/pages/auth/oidc/oidcState.ts:35-40

Problem

startOidcLogin wraps discovery, registration and authorization-URL generation in one
try, and its catch unconditionally calls invalidateCachedClient(issuer). The comment says this
is for a stale client id, but the same branch fires for a transient network error, an offline
discovery fetch, or a crypto.randomUUID failure. Each retry then performs a fresh MSC2966 dynamic
registration, accumulating throwaway OAuth clients at the provider — which is exactly the pattern
MAS/Authelia rate-limit.

How to trigger

go offline (or block the issuer's .well-known), press "Continue with SSO" a few times, come back online — each attempt registered a new client id.

Suggested fix

only invalidate on an authorization/registration rejection that indicates a bad client
(invalid_client, HTTP 400/401 from the registration or authorize step); leave the cache alone for
network/discovery failures.


Filed from the September 2026 client audit (branch lotus @ 4bea4895).

**Severity:** low · **Type:** bug · **Confidence:** high **Location:** `src/app/pages/auth/oidc/oidcLoginUtil.ts:29-49`, `src/app/pages/auth/oidc/oidcState.ts:35-40` ### Problem `startOidcLogin` wraps discovery, registration and authorization-URL generation in one `try`, and its `catch` unconditionally calls `invalidateCachedClient(issuer)`. The comment says this is for a stale client id, but the same branch fires for a transient network error, an offline discovery fetch, or a `crypto.randomUUID` failure. Each retry then performs a fresh MSC2966 dynamic registration, accumulating throwaway OAuth clients at the provider — which is exactly the pattern MAS/Authelia rate-limit. ### How to trigger go offline (or block the issuer's `.well-known`), press "Continue with SSO" a few times, come back online — each attempt registered a new client id. ### Suggested fix only invalidate on an authorization/registration rejection that indicates a bad client (`invalid_client`, HTTP 400/401 from the registration or authorize step); leave the cache alone for network/discovery failures. --- _Filed from the September 2026 client audit (branch `lotus` @ 4bea4895)._
jared added this to the Audit 2026-09 · Medium & Low milestone 2026-09-12 01:51:23 -04:00
jared added the bugpriority: lowarea: auth-session labels 2026-09-12 01:51:23 -04:00
jared self-assigned this 2026-09-12 01:51:23 -04:00
jared closed this issue 2026-09-12 19:46:15 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/cinny#67