strix/skills/protocols/oauth.md
OAuth and OIDC failures often enable account takeover, token theft, and cross-client token confusion. Treat every redirect, client identifier, and token exchange as an authorization boundary — not a convenience layer.
Flows
Endpoints
/authorize, /token, /userinfo, /introspect, /revoke, /logout/.well-known/openid-configuration, /jwks.jsonToken Types
Client Types
Discovery
GET /.well-known/openid-configuration
GET /oauth2/.well-known/openid-configuration
GET /.well-known/oauth-authorization-server
Extract: authorization_endpoint, token_endpoint, registration_endpoint, supported response_types, code_challenge_methods_supported, grant_types_supported.
Client Enumeration
client_id, redirect URIs, scopesOpen Redirect Chains
https://app.com/callback, path-prefix only, subdomain wildcards@ tricks, encoded slashes, backslash variantshttps://app.com/callback.evil.com
https://app.com/callback%2f..%[email protected]
https://app.com/callback?next=https://evil.com
com.app://callback (mobile custom scheme)
Redirect URI Validation Bypasses
http vs https)redirect_uri parameter pollution (first vs last wins)*.app.com → register attacker.app.com or find dangling subdomainCode Leakage
Code Injection / Mix-Up
client_id between authorize and token stepsredirect_uri binding at token endpointstate → CSRF on OAuth login (session fixation, account linking)nonce in OIDC → ID token injection/replaystate not bound to client session or PKCE verifiercode_challenge_method downgrade: accept plain instead of S256code_verifier not validated or compared case-insensitively with weak matchingPublic Client Abuse
client_secret for confidential clientsclient_id only authentication on token/introspection endpointsSecret Leakage
client_secret accepted in query string or logged in access logsadmin/offline_access/openid profile email beyond app need; server grants all requested scopesactive:true without proper auth on introspection endpointacr, amr, auth_time not validated for step-up requirementssub collision across issuers if iss not validatedReferer Leakage
code from Referer if policy allowsDevice Flow Abuse
device_code endpoint with guessed codes; slow rate limits onlyAccount Linking
state; swap sessions mid-flowstate/nonce enforced and bound; CSRF test fails as expectedredirect_uri, client_id, PKCE)The sandbox ships jwt_tool (already cloned at /home/pentester/tools/jwt_tool) plus curl — enough for the token side of OAuth/OIDC.
alg:none, HS256/RS256 key confusion, kid injection, claim editing (sub, aud, iss, exp):
python3 /home/pentester/tools/jwt_tool/jwt_tool.py <ID_TOKEN> # decode/inspect
python3 /home/pentester/tools/jwt_tool/jwt_tool.py <ID_TOKEN> -X a # alg:none
python3 /home/pentester/tools/jwt_tool/jwt_tool.py <ID_TOKEN> -X k -pk pub.pem # RS256->HS256 confusion
redirect_uri, client_id, state, PKCE code_challenge/code_verifier) and can test the binding/downgrade cases above.Humans often use Burp's EsPReSSO (RUB-NDS) SSO extension for flow visualization; it is GUI-only, so prefer manual curl + jwt_tool in-sandbox.
OAuth security hinges on strict redirect URI binding, unguessable state/nonce, PKCE for public clients, and consistent token audience validation. Any gap in the authorize-to-token chain is a potential account takeover.