Context
The Generic OAuth callback no longer accepts profile claims from id_token without verification. That closes the unsafe path where a token response or custom get_token hook could provide arbitrary sub/email claims and have them flow into account creation/linking.
Better Auth upstream 1.6.9 still allows genericOAuth to decode tokens.idToken as a profile source before userinfo. That appears to be a convenience/parity behavior, not a safe OIDC verification boundary.
Recommendation
Add explicit Generic OIDC support only if RustAuth can verify the id_token before using its claims as profile data.
The feature should require a deliberate OIDC configuration path, for example:
- discovery or explicit JWKS endpoint
- issuer validation
- audience/client_id validation
- expiration/not-before validation
- nonce validation when the flow issues a nonce
- algorithm/key validation with fail-closed errors
Non-goals
- Do not re-enable decode-only
id_token profile extraction.
- Do not treat upstream's current decode behavior as sufficient validation.
Acceptance criteria
- A generic provider can opt into verified
id_token profile extraction.
- Forged or unsigned
id_token values are rejected.
- Wrong issuer/audience/nonce tokens are rejected.
- Existing
userinfo_url and custom get_user_info behavior remains supported.
Context
The Generic OAuth callback no longer accepts profile claims from
id_tokenwithout verification. That closes the unsafe path where a token response or customget_tokenhook could provide arbitrarysub/emailclaims and have them flow into account creation/linking.Better Auth upstream
1.6.9still allowsgenericOAuthto decodetokens.idTokenas a profile source beforeuserinfo. That appears to be a convenience/parity behavior, not a safe OIDC verification boundary.Recommendation
Add explicit Generic OIDC support only if RustAuth can verify the
id_tokenbefore using its claims as profile data.The feature should require a deliberate OIDC configuration path, for example:
Non-goals
id_tokenprofile extraction.Acceptance criteria
id_tokenprofile extraction.id_tokenvalues are rejected.userinfo_urland customget_user_infobehavior remains supported.