Oauth misconfiguration

From zakirkun/ice-tea · View interactive version

Oauth misconfiguration is an AI agent skill from the GitHub repository zakirkun/ice-tea. Detects common OAuth 2.0 implementation mistakes including missing state parameter, open redirect in redirect_uri, and token exposure.

How to use this skill

Skill file

OAuth Misconfiguration

Overview

OAuth 2.0 implementations are prone to several security issues:

  1. Missing state parameter: Makes the OAuth flow vulnerable to CSRF attacks
  2. Open redirect in redirect_uri: Allows token theft by redirecting to attacker-controlled URL
  3. Implicit flow usage: The OAuth implicit flow exposes tokens in URL fragments
  4. Token in URL: Access tokens logged in server logs or browser history
  5. Client secret exposure: OAuth client secrets hardcoded or leaked

Detection Strategy

Remediation

Vulnerable:

auth_url = f"https://auth.example.com/oauth/authorize?client_id={CLIENT_ID}&redirect_uri={uri}&response_type=token"

Safe:

import secrets
state = secrets.token_urlsafe(32)
session['oauth_state'] = state
auth_url = f"https://auth.example.com/oauth/authorize?client_id={CLIENT_ID}&redirect_uri={FIXED_URI}&response_type=code&state={state}"
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.