← Research

APIsec Labs · Excerpt · Original article: 14 min read

The Seven Wonders of OAuth Exploitation

We read 105 public OAuth/OIDC bug bounty reports since 2019, and two-thirds of the exploit mechanisms we found across the real OAuth disclosures don't map to any spec guidance at all. If it's not in the RFC, what is it, and is it sitting in your codebase right now?

oauth d clustering

Sign in with Google, the signature verifies, and the token is valid. PKCE checks out, the redirect_uri matched exactly, state came back untouched. Textbook flow, start to finish. Then the application runs find_user_by_email(claims.email), and the session goes to whoever controls that address.

That kept happening. So across every publicly disclosed OAuth and OIDC report on HackerOne from 2019 to mid-2026, read by hand, we stopped asking which control was defective and asked something else of each one: what was the attacker's pivotal move? Not which parameter was malformed. What they actually did to turn a defect into someone else's account.

Out of 105 publicly disclosed OAuth and OIDC reports, 29, the single largest group are SSRF, ReDoS, brute force, cleartext transport and information disclosure, sitting on an endpoint that happens to have /oauth/ in its path. Real bugs, several of them severe, but they're just not OAuth bugs. The same way a bug in your billing service could get filed under "billing" because of where it lives, not what it is.

Clear those out and 76 reports remain where the exploit genuinely turns on how grants and tokens were handled. Seven patterns cover the lot.

MechanismnThe attacker's pivotal move
grant_interception28Move the code or token to an attacker-controlled destination in transit
surface_injection13Execute script or inject control characters into the auth origin
identity_binding_abuse10Abuse how the app maps an IdP identity onto a local account
credential_replay9Present a credential outside its intended binding or lifetime
consent_forgery6Trick the victim's browser into completing an authorization it never intended
flow_step_bypass6Reach a path that skips a mandatory auth step
authorization_enforcement_gap4A valid token reaches a resource the server should have refused

Roughly half of what remains is what you already test for. The other half lives in code your team wrote.

The familiar half: redirects and injection

Every one of those passed a validation check written by somebody who sincerely believed they were validating a redirect_uri. The attacker only has to find the one edge case you didn't think of; you have to think of all of them. That's why exact string matching is the recommendation and not "check it carefully."

Worth noticing: state shows up here as an injection sink, not as the CSRF token everyone thinks of it as. It's attacker-supplied data your auth origin reflects.

The half hiding in your glue code

Identity binding, 10 reports: The opening scene, ten times over. The handshake is clean and the account still moves.

Three different systems share one assumption, that a credential which validates is a credential that belongs here. Audience, binding and lifetime are separate checks, and in each case the one that mattered didn't happen.

Consent forgery, flow bypass, enforcement gaps: 16 reports. The last three families are variations on the authorization step being reachable in a state it shouldn't be.

Why your spec checklist won't catch most of this

We also coded all 76 against RFC 9700, the IETF's January 2025 consolidated OAuth security guidance[24], to see how the two views compare.

Mechanism families ranked by count against the RFC 9700 class each report maps to, if any

Rows are the seven in-scope exploit-mechanism families ranked by count; columns are the five RFC 9700 classes used, including unmapped. 52 of 76 in-scope reports are unmapped. Three of the seven families have no report in any mapped class. A further 29 out-of-scope reports sit below a divider.

That's the column axis in the figure, and it's lopsided: 14 reports map to redirect URI validation, 5 to CSRF/state, 4 to Referer leakage, 1 forced into PKCE downgrade, and 52, roughly two thirds, map to nothing at all.

Two things about that, because it's easy to over-read.

It isn't a hole in the spec. RFC 9700 has plenty to say about the unmapped pile. What it is, is a shape mismatch. RFC 9700 is organised as a set of controls: what you should have implemented, and which named attack each control defeats. That's the right shape at design review. It is not the shape of a triage vocabulary, because most of these disclosures chain two or three bugs together and a control-based lens only ever labels the first link. The part of the RFC closest to what triage actually needs is the updated attacker model, which sorts adversaries by capability: who can read the authorization response, who can read the request, who can acquire a token. It's the section nobody quotes.

What you can take home from this article

  • Audit the account-linking code, not just the OAuth library. If it trusts an email claim without checking email_verified and pinning the identity to the issuing IdP, that's an account takeover waiting to be found. Ten of these bugs lived there.

  • When you triage, ask what the attacker did before asking which section this is. The mechanism question left none of these reports without a home. The spec-conformance question left most of them.

Reality check: what this data can't tell you

This is the shape of what got disclosed, on one platform, by programs mature enough to run a bounty and comfortable enough to publish the result. Severe issues go missing from public bounty data non-randomly; the worst ones are often the quietest.

Three specifics worth knowing before you cite these numbers. Three programs make up a third of the corpus: Nextcloud 17 reports, Rockstar 11, curl 7, so disclosure culture shapes this data at least as much as attacker behaviour does. Related: the four Referer-leakage reports are all Rockstar, and all four are pieces of a single researcher's attack chain disclosed on the same day. That's one finding counted four times, not a base rate. And about a dozen records have a bare advisory link as their entire body text; those were coded from the linked advisory rather than the report itself.

A zero count is also a statement about what gets paid out and published, not about what exists. No mix-up attacks appear here, and only one PKCE bug. That mostly means these rarely surface as a standalone reportable finding: a missing PKCE implementation is usually the precondition some other, more visible bug quietly depended on. Implement PKCE regardless (please.)

What the data does support is, among bugs severe enough to report and safe enough to publish, most were integration defects. Bugs in code your team wrote, in the box every OAuth diagram draws as a plain rectangle labelled "your app."

Want to catch some of these patterns?APIsec automates the ones attackers try first and most pipelines never check for. We're expanding the suite fast, guided by our research.

References

[16] N. Sakimura, J. Bradley, M. Jones, B. de Medeiros, and C. Mortimore, "OpenID Connect Core 1.0." [Online]. Available: https://openid.net/specs/openid-connect-core-1_0.html
[24] T. Lodderstedt, J. Bradley, A. Labunets, and D. Fett, "Best Current Practice for OAuth 2.0 Security," RFC 9700, BCP 240, IETF, January 2025. [Online]. Available: https://www.rfc-editor.org/rfc/rfc9700
[25] D. Hardt, Ed., "The OAuth 2.0 Authorization Framework," RFC 6749, IETF, October 2012. [Online]. Available: https://www.rfc-editor.org/rfc/rfc6749
For every application you run

Find what's deployed and prove which exploits are real.

Go to apisec.ai