You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(oidc): security hardening from OIDC review — S256-only PKCE, atomic code redemption, reuse family revocation
Applies the three findings from the 2026-07-11 security review (RFC 9700):
- PKCE accepts S256 only. Authlib's default also allows 'plain', where the
challenge travels as the cleartext verifier — useless against the
authorization-request interception PKCE exists for. Discovery no longer
advertises plain.
- Authorization codes are consumed atomically (single UPDATE ... RETURNING
on a redeemed flag), closing the TOCTOU race where two concurrent /token
requests could both redeem one code. Any redemption attempt burns the
code, including ones that later fail PKCE. Redeemed rows are kept until
expiry: reuse of a redeemed code signals interception and revokes every
token issued to that (client, user) grant. Side effect: the nonce-replay
window now actually spans the code lifetime.
- Replay of a rotated-out refresh token revokes the whole token family, so
a thief who rotates first no longer keeps a live token while the legit
client is silently rejected.
Per-client rate-limit buckets (finding 4) deferred — the global in-process
guard stays; noted as follow-up when it matters.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
0 commit comments