Oauth oidc security

From xalgorix/xalgorix · View interactive version

Oauth oidc security is an AI agent skill from the GitHub repository xalgorix/xalgorix. OAuth 2.0 and OpenID Connect implementation testing — redirect URI validation bypass, PKCE enforcement and downgrade, state/CSRF, code replay, token audience and scope abuse, and ID token validation flaws

How to use this skill

Skill file

OAuth & OIDC Implementation Testing

Purpose

Exploit flawed OAuth 2.0/OIDC implementations: redirect manipulations that steal authorization codes, missing PKCE, replayable codes, cross-client token reuse, and unvalidated ID tokens — each confirmed by obtaining usable credentials for a victim context.

Preconditions

Attack Surface Signals

Methodology

Step 1: Map the Flow

curl -sk "https://TARGET/.well-known/openid-configuration" | jq '.authorization_endpoint, .token_endpoint, .scopes_supported'
# Walk the full code flow as the test user; record every parameter and redirect

Step 2: redirect_uri Manipulation

Exact match is the only safe validation. Test:
  prefix match:      redirect_uri=https://app.target.com.evil.com/callback
  substring match:   redirect_uri=https://app.target.com/callback/../../../redirect
  open redirect ch:  redirect_uri=https://app.target.com/redirect?to=https://OOB.oast.pro
  authority tricks: https://app.target.com@evil.com/  |  https://app.target.com#@evil.com
  scheme swaps:      http://app.target.com/callback  |  //evil.com
  path traversal:    https://app.target.com/callback/../../open

Confirm by RECEIVING code= on the off-domain destination — then exchange the code at the token endpoint to prove a usable credential, not just a redirect bounce.

Step 3: PKCE Enforcement

- drop code_verifier entirely at /token
- send a wrong code_verifier (token should fail; issuance = broken PKCE)
- downgrade S256 → plain in both the authorize request and the token exchange

A finding requires the token endpoint issuing tokens without a valid verifier.

Step 4: state, Code Replay, and TTL

Step 5: Token Audience, Binding, and Scope

# Token issued to client A against client B's API
curl -sk -H "Authorization: Bearer CLIENT_A_TOKEN" "https://CLIENT_B.example.com/api/me"
# Refresh token with a different client_id
curl -sk -X POST "https://TARGET/token" -d "grant_type=refresh_token&refresh_token=RT&client_id=other-client"
# Scope escalation: request scopes the user never granted
curl -sk "https://TARGET/authorize?...&scope=openid%20admin%20read:all"

Step 6: ID Token Validation (OIDC)

Evidence Contract

An OAuth finding requires a usable credential outcome:

NOT evidence: a redirect that bounces but delivers no code, a permissive-looking authorize response, discovery metadata listing endpoints, an ID token that decodes

Common Misses

False Positives / Non-Findings

Xalgorix Tool Strategy

Stopping Rule

Every grant type in use x every redirect mutation x PKCE/state/replay/audience checks, each confirmed by an exchanged, working credential.

Handoff

Report the flow leg, the exact parameter manipulation, the received/exchanged credential, and the victim context gained. Account-takeover chains into the account-takeover methodology; ID-token signature issues into jwt-security-testing.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.