Sh Kb Authのロゴ

Sh Kb Auth

コミュニティ
dmdhrumilmistry
sh-kb-auth

Knowledge base for finding authentication and session-management failures - weak login, broken JWT/session handling, password/reset flaws, MFA bypass, credential storage issues. Use when hunting authentication (not authorization - see sh-kb-access-control). CWE-287/384/613/620/640, OWASP A07:2021-Identification and Authentication Failures.

概要

公開者dmdhrumilmistry
リポジトリsecurity-harness
スキル名sh-kb-auth
スター
42
フォーク
11
同梱ファイル
指示のみ
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    dmdhrumilmistryがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Sh Kb Auth」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/dmdhrumilmistry/security-harness/tree/main/plugins/security-harness/skills/sh-kb-auth
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/dmdhrumilmistry/security-harness.git /tmp/security-harness
mkdir -p .claude/skills
cp -r /tmp/security-harness/plugins/security-harness/skills/sh-kb-auth .claude/skills/sh-kb-auth
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでSh Kb Authを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にSh Kb Authを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Sh Kb Authは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Authentication & Session - Hunter Knowledge Base

Failures in proving who the user is (vs access-control, which is what they may do). Covers login, sessions, tokens, password handling, and account recovery.

What to hunt

  • JWT flaws: alg:none accepted; algorithm confusion (RS256 verified with the public key as an HMAC secret); signature not verified (decode without verify); secret hardcoded/weak (offline-brute-forceable); no exp check; trusting unverified claims for authz. Header-parameter injection: kid used to look up the verification key via a path (traversal to a predictable low-entropy file, e.g. /dev/null -> empty-string HMAC key) or a DB query (SQLi); jwk header lets the server verify against an attacker-embedded public key (attacker signs with the matching private key); jku/x5u header points to an attacker-hosted key set/certificate with no host allowlist.
  • Session management: session id not rotated after login (fixation, CWE-384); no server-side invalidation on logout; predictable/low-entropy tokens; missing HttpOnly/Secure/SameSite; overly long/absent expiry (CWE-613); session token in URL.
  • Password handling: plaintext or fast-hash storage (md5/sha1/unsalted) instead of bcrypt/scrypt/ argon2 (CWE-256/916); no rate limiting / lockout (credential stuffing, CWE-307); timing-unsafe comparison of secrets (== on tokens); lockout counter keyed by source IP instead of the account (trivially bypassed with distributed attempts) or a lockout with no path to self-recovery (usable as a DoS against a victim).
  • Account recovery: guessable/predictable reset tokens, reset token that doesn't expire or isn't single-use, host-header poisoning in reset links, user enumeration via differing responses (CWE-640).
  • MFA: verification step skippable, OTP not rate-limited/reusable, backup-code weaknesses.
  • Broken "remember me" / trust tokens; OAuth state missing (CSRF on login); redirect_uri not validated.

Sinks / patterns (grep targets)

jwt.decode(/verify(, algorithms=, verify=False, verify_signature, md5(/sha1( near "password", == comparing tokens/HMACs (vs hmac.compare_digest/crypto.timingSafeEqual), session[, set_cookie, SECRET_KEY, random/Math.random for tokens, password_reset, otp, login, authenticate, JWT header parsing that reads kid/jwk/jku/x5u before signature verification.

Detection recipe

  1. Find the login, logout, session-issue, password-store, and reset flows from codebase-map.json.
  2. For JWT: check the verify call actually verifies signature + exp + expected alg, and the secret's source.
  3. For sessions: is the id regenerated on privilege change/login? cookie flags set? entropy adequate?
  4. For passwords: which hash + salt? is comparison constant-time? is there lockout/rate limiting?
  5. For reset: token entropy, expiry, single-use, and whether the reset link host comes from a request header.

Payloads / PoC

  • JWT none: set header {"alg":"none"}, drop signature, change sub/role. Confusion: sign with RS256 public key as HMAC secret. Expired token still accepted -> no exp check.
  • JWT header injection: kid -> ../../../../dev/null (then sign with empty-string HMAC key) or a SQLi string if kid feeds a key-lookup query; jwk -> attacker's own public key embedded in the header, token signed with the matching private key; jku/x5u -> attacker-controlled URL serving a malicious key set/certificate.
  • Fixation: set a session id pre-login, authenticate, check it's unchanged.
  • Reset poisoning: POST /forgot with Host: attacker.com -> link points to attacker.
  • Enumeration: compare responses/timing for known vs unknown usernames.

False-positive filters

  • Vetted library with defaults (Django auth, Devise, Spring Security, NextAuth, Passport) used correctly.
  • JWT verified with the right algorithm+secret and exp/nbf enforced; secret from env/secret manager.
  • kid resolves only against a fixed in-memory/config map of known key ids (no path/DB use); jwk header ignored in favor of a pinned server-side key; jku/x5u restricted to a strict host allowlist.
  • Passwords via bcrypt/argon2/scrypt with per-user salt; constant-time compares for secrets.
  • Session id from a CSPRNG; cookie flags set; rotation on login present in middleware.
  • Lockout counter keyed by account (not just source IP) with a bounded exponential delay, and a working self-recovery path so lockout can't be used to lock out a victim.

CWE / OWASP / severity

CWE-287/384/613/620/640/307/916. OWASP A07:2021. Auth bypass / token forgery -> critical; weak hashing or missing lockout -> high; missing cookie flags / enumeration -> medium.

Chaining hints

Weak session/JWT + xss or open-redirect/Referer leak -> token theft -> takeover; user enumeration + no lockout -> credential stuffing; reset-token flaw -> account takeover; access-control IDOR that leaks tokens feeds this. Auth bypass unlocks every authenticated finding.

Mitigation

Use a maintained auth framework; verify JWT signature+alg+exp (never none); pin/allowlist the verification key rather than trusting kid/jwk/jku/x5u from the token itself; store passwords with argon2/bcrypt+salt; constant-time secret comparison; rotate session id on login and invalidate on logout; set HttpOnly/Secure/SameSite; CSPRNG single-use expiring reset tokens; rate-limit + lockout keyed by account with exponential backoff and a DoS-safe recovery path; enforce MFA.

よくある質問

AIスキル「Sh Kb Auth」では何ができますか?

Knowledge base for finding authentication and session-management failures - weak login, broken JWT/session handling, password/reset flaws, MFA bypass, credential storage issues. Use when hunting authentication (not authorization - see sh-kb-access-control). CWE-287/384/613/620/640, OWASP A07:2021-Identification and Authentication Failures.

TypingMindでSh Kb Authを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Sh Kb Authはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにSh Kb Authをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/dmdhrumilmistry/security-harness/tree/main/plugins/security-harness/skills/sh-kb-authを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Sh Kb Authを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Sh Kb Authで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもSh Kb Authを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Sh Kb Auth」は無料ですか?

はい。dmdhrumilmistryがMITライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇