本文へスキップ
Skillpedia
セキュリティ10k · #11947

offensive-jwt

できること

このスキルは、許可を得たペネトレーションテストにおける、JWTベースの認証のテストのチェックリストです。アルゴリズムの混乱、弱い秘密、ヘッダーの注入、キーのキャッシュの問題を扱います。トークンのログインを回避できるかを確認するセキュリティの専門家向けです。

使う場面

  • ✓許可を得たペネトレーションテストで、ウェブアプリやモバイルアプリのJWTのログインをテストしているとき。
  • ✓サーバーが、署名されていないトークンや改変されたトークンを受け入れるかを確認したいとき。
  • ✓JWTのキーIDやキーのURLのヘッダーがどう扱われているかをレビューする必要があるとき。

スキルのリンク

https://github.com/SnailSploit/Claude-Red/blob/main/Skills/auth/offensive-jwt/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/SnailSploit/Claude-Red/blob/main/Skills/auth/offensive-jwt/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“ログインを検査する許可があります。JWTトークンに、弱い署名やアルゴリズムの混乱がないか確認してください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

このスキルは、チェックリストを順に進めます。アルゴリズム、署名の秘密、キーのヘッダー、キーのキャッシュを確認し、各技術をターゲットに適用します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Overview

Comprehensive JWT attack checklist for offensive security engagements. Follow steps in order; apply each technique to the current target context and track which items have been completed.

Quick Reference: Misconfigurations to Check

  • Algorithm set to none — signature verification bypassed entirely
  • Algorithm switching between RSA and HMAC (confusion attack)
  • Weak or guessable HMAC secret (brute-forceable)
  • kid, jku, jwk, x5u header parameters accepted without validation
  • Expired or tampered tokens accepted by server
  • Sensitive data stored unencrypted in payload

Useful tool: JWT Tool

Mechanisms

JWTs (RFC 7519) consist of three Base64URL-encoded parts: header.payload.signature.

Signing algorithms:

Algorithm Type Notes
HS256/384/512 Symmetric HMAC Shared secret; confusion target
RS256/384/512 Asymmetric RSA Public key can be misused as HMAC secret
ES256/384/512 Asymmetric ECDSA
PS256/384/512 RSASSA-PSS
EdDSA (Ed25519/Ed448) Asymmetric
none Unsigned Critically insecure

Additional pitfalls:

  • JWS/JWE confusion: server accepts encrypted token (JWE) where signed (JWS) is expected, or fails open on unexpected typ/cty
  • JWKS retrieval: SSRF via jku/x5u, insecure TLS, poisoned key caching, kid collisions
  • Token binding (DPoP, mTLS): incorrectly implemented allows replay from other clients

Hunt: Identifying JWT Usage

  1. Check Authorization: Bearer <token> headers in all requests
  2. Look for cookies containing JWT structures (eyJ...)
  3. Examine browser local/session storage
  4. Decode the token at jwt.io or via BurpSuite JWT extension — inspect claims and header parameters
  5. Note any kid, jku, jwk, x5u fields in the header — these are attack surfaces

Vulnerability Map

JWT Vulnerabilities
├── Algorithm Bypass
│   ├── alg:none attack
│   └── RS256→HS256 confusion (public key as HMAC secret)
├── Weak Secret Key → Brute force
├── kid Parameter Injection
│   ├── SQL injection via kid
│   └── Path traversal via kid
├── Header Injection
│   ├── jwk (inline fake key)
│   ├── jku/x5u (remote attacker-controlled JWKS)
│   └── JWKS cache poisoning
└── Missing / Broken Validation
    ├── No signature check
    ├── Expired tokens accepted
    └── iss/aud/exp not validated

Vulnerabilities

Algorithm Vulnerabilities

  • alg:none — Some libraries disable signature validation when alg is none or a case variant (None, NONE, nOnE)
  • Algorithm Confusion (RS256→HS256) — Server uses RSA public key as HMAC secret when attacker switches alg to HS256; attacker re-signs token with the public key
  • Key ID (kid) Manipulation — Exploiting kid to load wrong keys or inject file paths / SQL; enforce strict lookups

Signature Vulnerabilities

  • Weak HMAC Secrets — Brute-forceable with dictionary or hashcat
  • Missing Signature Validation — Token accepted without any verification
  • Broken Validation — Implementation errors in signature checking logic

Implementation Issues

  • Missing Claims Validation — exp, nbf, aud, iss not verified
  • Insufficient Entropy — Predictable JWT IDs or tokens
  • No Expiration — Tokens valid indefinitely
  • Insecure Transport — Token sent over HTTP
  • Debug Leakage — Detailed error messages expose implementation

Header Injection Attacks

  • JWK Injection — Supply a custom attacker-controlled public key via the jwk header
  • JKU Manipulation — Point jku (JWK Set URL) to attacker-controlled JWKS endpoint
  • x5u Misuse — Load untrusted X.509 key URL; exploit lax TLS validation or open redirects
  • JWKS Cache Poisoning — Force caches to accept attacker keys via kid collisions or response header manipulation
  • crit Header Abuse — Server ignores unknown critical parameters, enabling bypass

Information Disclosure

  • Sensitive data (PII, credentials, session details) stored unencrypted in payload
  • Internal service/backend information leaked via claims

Additional Attack Vectors

Mobile App JWT Storage

Android:

  • SharedPreferences: Check if world-readable; location /data/data/<package>/shared_prefs/
  • Keystore extraction: root device or exploit app
  • Backup extraction: adb backup -f backup.ab <package> (if allowBackup=true)
  • Tools: Frida, objection, MobSF

iOS:

  • Keychain: Check `kSecAttrA
よくある質問

アルゴリズムの混乱とは何ですか?

公開鍵を秘密として使うなど、サーバーが誤ったアルゴリズムでトークンを検証するように騙される状態です。

どのツールに言及していますか?

トークンのテストのために、JWT Toolプロジェクトに言及しています。

自分のアプリをテストするためのものですか?

アプリを、テストする許可がある場合の許可されたテストのために書かれています。

詳細

作者による元の説明

JWT attack methodology for penetration testers. Covers algorithm confusion (alg:none, RS256→HS256), weak HMAC secret brute force, kid parameter injection (SQLi, path traversal), jku/x5u/jwk header injection, JWKS cache poisoning, JWS/JWE confusion, timing attacks, and mobile JWT storage extraction. Use when testing JWT-based authentication, hunting auth bypass via token manipulation, or evaluating JWT implementation security in web or mobile apps.

repo: SnailSploit/Claude-Red

人気

GitHubのスター
10k
ランキング
#11947
ライセンス
MIT
更新日
2026/10/12

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル