hunt-session
できること
このスキルは、ログアウト後も残るセッション、セッション固定、Cookieの保護不足などの問題について、セッション管理を調べます。ウェブアプリのアカウントセッションを、許可を得てテストするためのものです。
使う場面
- ✓ユーザーがログアウトした後も、古いセッションがまだ使えるか確認したいとき。
- ✓パスワードやメールアドレスを変更したとき、ほかのセッションも終了すべきかを確認したいとき。
- ✓ログインしても新しいセッションIDが作られていないように見えるとき。
スキルのリンク
https://github.com/elementalsouls/Claude-BugHunter/blob/main/skills/hunt-session/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“当社のアプリでログアウトした後も、古いセッションが使えてしまわないか、許可を得たテストで確認してください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントはセッションを記録し、ログアウトまたはパスワード変更を行ってから、古いセッションで保護されたページにアクセスします。その古いセッションで保護されたページが表示されれば、問題として報告されます。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Autonomous Testing Priority
Missing HttpOnly on cookies is auto-detected — focus your active testing on lifecycle invalidation (higher impact).
Pattern 1 — Session survives logout (most common high-value finding):
- Login and note the session token/cookie value
- Call the logout endpoint (
/logout,POST /api/logout, etc.) - Try to use the OLD session token to access a protected resource (
/api/me,/dashboard,/account) - If 200 with user data → session not invalidated on logout = ATO persistence
Pattern 2 — Session not regenerated on login (session fixation):
- GET any page to receive a pre-authentication session token/cookie
- POST valid credentials to the login endpoint
- Compare the session token BEFORE and AFTER login
- If the token is unchanged → session fixation vulnerability
Pattern 3 — Session survives password change:
- Login → record session A value
- Change the password via the account settings endpoint
- Replay session A on a protected endpoint
- If 200 → token not rotated on credential change = persistent ATO (critical chain when combined with XSS/cookie theft)
Content-type: Login and session endpoints vary — use application/json for REST APIs, application/x-www-form-urlencoded for traditional web forms. Try both if the first returns an unexpected response.
Proof: A protected-resource 200 response (with user data) using a session token that should have been invalidated confirms the finding.
HUNT-SESSION — Session Management
Crown Jewel Targets
Session fixation leading to admin hijack = Critical. Session surviving a password change = High-to-Critical (persistent ATO from a stolen cookie that the victim believes they revoked by resetting their password).
Highest-value chains:
- Session fixation — server accepts a session ID set by the client and does NOT regenerate it on login → attacker pre-plants an ID, victim authenticates, attacker rides the now-authenticated session → persistent ATO.
- No invalidation on logout — old token still works after
/logout→ theft window never closes. - No invalidation on password / email change — a stolen session survives the victim's "I think I was hacked, let me reset" → persistent ATO. This is the single highest-paid session bug class.
- Refresh-token reuse without rotation-detection — a leaked refresh token mints fresh access tokens forever; no reuse-detection means the legitimate user's later refresh does NOT revoke the attacker's branch.
- Predictable / low-entropy session ID — sequential, timestamp- or userId-derived IDs → brute-force or compute other users' sessions.
- JWT-as-session with no
exp/ no revocation list — stolen JWT = permanent access; logout is cosmetic.
Grounding — patterns that shaped each phase
No invented CVE/report IDs below. These are the named, publicly-documented patterns this skill encodes:
- Session fixation, login-CSRF, no-regeneration-on-auth — OWASP WSTG-SESS-03 / WSTG-SESS-01; the classic ACROS / Mitja Kolšek session-fixation paper. Highest-impact variant: fixing the session of an SSO/admin user.
- SameSite=Lax sibling-subdomain CSRF reaching session state — Argo CD CVE-2024-22424 (Lax cookies sent on top-level cross-site navigations from a sibling subdomain). Use this when a session cookie relies on
SameSite=Laxas its only CSRF defence. - Refresh-token rotation & automatic reuse-detection — the Auth0/IETF OAuth-Security-BCP model: a rotated refresh token, if replayed, must invalidate the entire token family. Absence = the core bug to prove.
- Device Bound Session Credentials (DBSC) — the W3C/Chrome DBSC draft binds a session to a TPM/device key. Test the downgrade: does the server still accept a non-bound cookie when the DBSC challenge is stripped?
- Cookie attribute hardening — OWASP WSTG-SESS-02;
__Host-/__Secure-prefixes per RFC 6265bis. MissingHttpOnlyis only a finding when a real XSS/DOM sink exists (chain withhunt-xss/hunt-dom). - Entropy — NIST SP 800-63B requires ≥64 bits of entropy in a session identifier. Treat anything decodable to a counter/timestamp/userId as a finding regardless of length.
Cross-refs: ATO chaining → hunt-ato; JWT alg/kid tampering → hunt-api-misconfig; OAuth code/state flaws → hunt-oauth; CSRF mechanics → hunt-csrf; cookie-theft sinks → hunt-xss / hunt-dom.
Attack Surface Signals
Set-Cookie: session=... # nam
よくある質問
セッション固定とは何ですか?
ログインの前後でサイトが同じセッションIDを使い続けることです。そのIDを知っている攻撃者も、同じセッションを利用できてしまいます。
Cookieの設定もテストされますか?
HttpOnly、Secure、SameSiteなどのCookie設定にも触れますが、主な対象はセッションのライフサイクルの問題です。
問題があることは何で確認できますか?
スキルによると、古いセッションでユーザーのデータを返す保護ページがあれば、それが証拠になります。
詳細
作者による元の説明
Hunt Session Management vulnerabilities — session fixation (no regeneration on login), insufficient invalidation on logout / password-change / email-change, predictable or low-entropy session IDs, JWT-as-session with no exp/revocation, refresh-token rotation/reuse-detection gaps, OAuth/SSO session linkage, device-bound-session (DBSC) downgrade, and cookie attribute issues (Secure/HttpOnly/SameSite/__Host-). Validate with TWO real sessions (attacker A + victim B), body-diff every 200, and OOB confirmation for theft chains. Medium to Critical (fixation→admin hijack, no-invalidation→persistent AT
人気
- GitHubのスター
- 5.4k
- ランキング
- #14930
- ライセンス
- MIT
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
apk-redteam-pipeline
5.4kエージェントが、Android アプリのセキュリティの弱点を、APK ファイルの発見と逆コンパイルから、埋め込まれた機密情報の確認まで、認可されたテストとして確認できるよう支援します。
bugcrowd-reporting
5.4kエージェントが、適切なカテゴリーを選び、対象外の異議に答えることで、より良い Bugcrowd の脆弱性報告書を書けるよう支援します。
cloud-iam-deep
5.4kエージェントが、認可されたセキュリティテストの間に、見つかったクラウドの認証情報が AWS、Azure、Google Cloud で何にアクセスできるかを確認できるよう支援します。
enterprise-vpn-attack
5.4kエージェントが、認可されたテスト中に、Cisco、Fortinet、Citrix などの VPN とリモートアクセスの機器に、既知の弱点がないか確認できるよう支援します。
似ているスキル
reverse-engineer-anything
422kREAツールを使って、出荷済みのアプリやパッケージの中身を調べ、機能の説明、版の比較、再構築の手順をエージェントが支援します。
1password
394k1Password CLIをセットアップし、サインインして、秘密情報の値を会話に表示せずに読み取ったり注入したりするようエージェントを支援します。
healthcheck
394kOpenClawを動かすコンピューターやサーバーを、SSH、ファイアウォール、更新、バックアップなどのセキュリティリスクについて監査し、安全な修正案を提案するようエージェントを支援します。