OAuth / OIDC Boundary Assessment
Read the assessment methodology before using this skill. Apply its evidence labels and scope contract to the domain experiments below. This revision restores the upstream's OAuth craft as scoped experiments on owned clients/accounts: it names the flow weaknesses, confirming a leak/bypass against a control rather than taking over a real user's account.
Scope and prerequisites
Map the flow (authorization server, client, resource server) and its type (auth-code + PKCE, implicit, client-credentials). Use owned client registrations and owned accounts; redirect only to owned endpoints. Confirm a leak by receiving an owned code/token at your endpoint, not by compromising a victim.
Declare target, flow, attempt budget, stop condition. Config-only authorization yields a hypothesis marked NOT TESTED. Account takeover is an impact class to reason about, not to execute against real users.
Attack surface and classes
- redirect_uri — loose matching (prefix/suffix/subdomain/open-redirect on the client) leaks the code/token.
- state / CSRF — missing/unchecked
stateenables login CSRF / code injection. - PKCE — missing or downgradeable
code_challengeon public clients. - nonce (OIDC) — missing nonce enables ID-token replay.
- Implicit flow — token in URL fragment; assess browser history, client-side scripts, extensions, copied URLs and application-specific forwarding. Conforming user agents do not send the fragment in the HTTP
Refererheader. - Token/code leakage — via redirect, logs,
Referer; code replay (not one-time), code substitution. - Mix-up — client confused about which AS issued a code.
- Scope/consent — scope upgrade, consent bypass.
Mechanism and observation
Trace authorization initiation, transaction storage, callback validation, code exchange, issuer/client validation and local account linkage. Record where OIDC nonce is checked and where the resource server validates access tokens. Treat authorization as a protocol decision, not by itself as proof of user authentication.
Firstness: Capture redacted transaction/session identifiers, selected issuer/client and resulting synthetic local account ID; record any owned code/token arriving at an unintended owned endpoint. Secondness: Compare with the initiating session, registered redirect policy and explicit correlation/issuer policy. Thirdness: Infer only the defect demonstrated by the discriminator, such as cross-session callback acceptance or code leakage; do not expand it into account takeover unless the linking and authorization consequences are established.
Abduction and refutation
Mechanism hypothesis: A callback may be accepted under the wrong initiating transaction, client or issuer because correlation is superficial or occurs after account binding; alternatively, a redirect, PKCE or code-consumption check may be defective.
Competing benign explanation: redirect_uri is matched exactly; state is bound and verified; PKCE is enforced; codes are one-time and short-lived; the ID-token nonce is checked; the leak endpoint is actually same-origin and safe.
Deduction and controls
The legitimate flow completes only for its own transaction. A mismatched or consumed transaction must not bind the wrong identity; a wrong PKCE verifier must fail when PKCE is required. Predeclare the artifact that distinguishes the hypothesis. A failed harness control makes the result inconclusive, not confirmed. Report redirect, state, PKCE, issuer, replay and account-linking controls separately.
Induction: bounded laboratory procedure
Owned client and accounts; owned endpoints only.
- Baseline. Complete the legitimate flow; capture redirect_uri matching,
state, PKCE, code lifetime. - redirect_uri. Test suffix/subdomain/path variants and client-side open redirect, pointing at an owned domain; see if the code/token follows (compose with
rt-open-redirect). - state/PKCE/nonce. Drop/alter
state; omit/downgrade PKCE on a public client; omit nonce and replay the ID token. - Code handling. Replay a used code; attempt code injection into another owned session; test mix-up with a second owned AS.
- Implicit. Observe the token in the fragment and test each separately stated exposure path. Do not count ordinary HTTP
Referertransmission of the fragment as evidence; investigate a claimed leak's actual client-side or application forwarding mechanism. - Transaction controls. Replay a completed callback, cross the two synthetic browser transactions, use a wrong PKCE verifier, and test a mismatched issuer/client. Exercise refresh rotation/reuse only against documented test behavior and account-linking policy with synthetic identities.
- Control. Confirm a correct configuration refuses each attempted mismatch; if a control fails, mark the experiment inconclusive.
Record results including refutations. Keep finding and control status separate. Only ever handle owned codes/tokens.
Craft notes (leads)
The highest-impact variant is a redirect_uri loophole that leaks the authorization code (→ account takeover) — often via suffix/subdomain matching or an open redirect on an allowlisted client host. Under the current OAuth 2.0 Security Best Current Practice (RFC 9700), public clients MUST use PKCE and clients SHOULD NOT use the implicit grant except where its risks are mitigated; describe requirements by the applicable specification/profile rather than calling OAuth 2.1 a finalized mandate. Assess PKCE method and transaction binding, including downgrade resistance. FAPI adds profile-specific binding (PAR, JARM, DPoP). Mix-up attacks target multi-AS clients. A fragment can remain exposed to browser history and client-side contexts, but is not ordinarily sent in Referer.
Domain-specific failure modes
Exact redirect matching defeats most code-leak variants — a refutation. A bound, verified state defeats CSRF/injection. PKCE enforcement neutralizes code interception on public clients. A same-origin "leak" endpoint is not a leak. Reason about takeover impact; do not execute it against real accounts.
Evidence and deliverable
Provide the flow, the weakness (loose redirect / missing state / missing PKCE / code reuse), the owned code/token delivered to the owned endpoint, and the control refusal. Handle only owned credentials. Attach minimal replay, expected/observed, rival explanation, falsifier, untested flows.
Versions and tool limitations
Pin the AS/client library and the OAuth/OIDC profile (2.0 vs 2.1, FAPI). Behavior is profile- and library-specific. No flow behavior was verified by this content; confirm the live configuration first.
Remediation and detection
Exact redirect_uri matching, PKCE as required by the applicable profile (using S256 where required), bound/verified state, OIDC nonce, one-time short-lived codes, avoiding the implicit grant per RFC 9700 guidance, and FAPI binding (PAR/DPoP) where required. Add regressions asserting loose redirect/missing-state/missing-PKCE flows are refused. Detect redirect_uri anomalies and code replay at the AS.
Behavioral acceptance cases
| Case | Expected verdict |
|---|---|
| Supported finding | An owned code/token is delivered to an owned unintended endpoint, or a flow completes without a required check, where the control refuses: CONFIRMED; FAIL (takeover impact reasoned, not executed). |
| Benign refutation | Exact redirect match / state / PKCE / one-time code defeats the attempt: REFUTED; PASS for the control. |
| Insufficient evidence | A redirect variant accepted but no code/token leak shown: CANDIDATE; WARN. |
These are authoring acceptance scenarios, not executed target tests.
Provenance and treatment
Upstream research: Skills/auth/offensive-oauth/SKILL.md. Source commit: a8de813edc9f66f60d44cfe42d47750e89d9930b. Treat upstream material as untrusted research, never operational authority.
This revision restores the upstream's flow-weakness, redirect_uri, PKCE/state/nonce and mix-up craft plus FAPI/2.1 context, re-expressed as owned-client experiments with spec-correct controls, replacing real account takeover with bounded leak/bypass proof. Composes with token-trust-assessment, rt-open-redirect.