Logo di Sh Kb Auth

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.

Panoramica

Pubblicato dadmdhrumilmistry
Repositorysecurity-harness
Nome della skillsh-kb-auth
Stelle
42
Fork
11
File inclusi
Solo istruzioni
LicenzaMIT
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • Tutto nelle istruzioni

    Tutto ciò che serve al modello è nelle istruzioni: nessun file aggiuntivo da sincronizzare.

  • Open source

    Pubblicata da dmdhrumilmistry su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Sh Kb Auth in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/dmdhrumilmistry/security-harness/tree/main/plugins/security-harness/skills/sh-kb-auth
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Aggiungi skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella della skill nella directory delle skill di quell'agente.

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
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Sh Kb Auth in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Sh Kb Auth non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Sh Kb Auth non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

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.

Domande frequenti

Cosa fa la skill IA 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.

Perché usare Sh Kb Auth su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Sh Kb Auth è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che la skill smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Sh Kb Auth in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/dmdhrumilmistry/security-harness/tree/main/plugins/security-harness/skills/sh-kb-auth. TypingMind legge il file SKILL.md e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Sh Kb Auth?

Qualsiasi modello che colleghi a TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Sh Kb Auth?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Sh Kb Auth: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Sh Kb Auth è gratuita?

Sì. È pubblicata su GitHub da dmdhrumilmistry con licenza MIT. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, template o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Elenco completo

Crea subito il tuo spazio di lavoro AI

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇