Sh Kb Auth logo

Sh Kb Auth

Community
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.

Overview

Publisherdmdhrumilmistry
Repositorysecurity-harness
Skill namesh-kb-auth
Stars
42
Forks
11
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by dmdhrumilmistry on GitHub. Read the source before you install it.

Installation

Install the Sh Kb Auth AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/dmdhrumilmistry/security-harness/tree/main/plugins/security-harness/skills/sh-kb-auth
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

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
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Sh Kb Auth in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Sh Kb Auth on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Sh Kb Auth is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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.

Frequently asked questions

What does the Sh Kb Auth AI skill do?

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.

Why use Sh Kb Auth on TypingMind?

Because you install it once and use it with any model. Sh Kb Auth is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Sh Kb Auth in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/dmdhrumilmistry/security-harness/tree/main/plugins/security-harness/skills/sh-kb-auth. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Sh Kb Auth?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Sh Kb Auth?

As many as you like. As long as a model supports skills, you can use Sh Kb Auth with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Sh Kb Auth AI skill free?

Yes. It is published on GitHub by dmdhrumilmistry under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇