Logo: Auditing Jwt Verification And Key Trust

Auditing Jwt Verification And Key Trust

Organisatioun
UnboundCompute
auditing-jwt-verification-and-key-trust

Iwwerpréift, wéi e Service JSON Web Tokens géint déi klassesch Ëmgehungsattacke bei der Verifikatioun iwwerpréift: eng Attack duerch Algorithmusverwiesslung, bei där en Token den Ënnerschrëftalgorithmus wiesselt, soudatt en ëffentleche Schlëssel als symmetrescht Geheimnis benotzt gëtt, oder den Algorithmus op none gesat gëtt; e Schlëssel, deen aus engem Header ausgewielt gëtt, deen en Ugräifer kontrolléiert (eng Schlëssel-ID, eng JWKS-URL oder e Schlëssel am Token), soudatt den Token säin eegene Signataire ugëtt; eng Ënnerschrëft, déi decodéiert, awer net tatsächlech verifizéiert gëtt; a Claims (Ablaf, Aussteller, Audience), déi zwar ausgeliest, awer net duerchgesat ginn. Dat gëllt fir Servicer, déi JWTs akzeptéieren a verifizéieren, fir en Uruffer ze authentifizéieren oder ze autoriséieren. Benotzt dëst, wann e JWT d’Umeldungsmëttel ass a seng Verifikatioun d’Grenz ass. Den gefälschten oder net verifizéierten Token ass d’Quell; déi authentifizéiert oder autoriséiert Aktioun, déi en erméiglecht, ass d’Zil; an de Feeler ass d’Algorithmusverwiesslung, e vum Ugräifer gewielte Schlëssel oder e Claim, deen net verifizéiert gëtt, mee trotzdem akzeptéiert gëtt.

Iwwersiicht

EditeurUnboundCompute
Repositorysecurity-agent-skills
Skill-Nummauditing-jwt-verification-and-key-trust
Stären
27
Forks
8
Matgeliwwert Dateien
Nëmmen Instruktiounen
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    UnboundCompute huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Auditing Jwt Verification And Key Trust an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/UnboundCompute/security-agent-skills/tree/main/skills/auditing-jwt-verification-and-key-trust
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/UnboundCompute/security-agent-skills.git /tmp/security-agent-skills
mkdir -p .claude/skills
cp -r /tmp/security-agent-skills/skills/auditing-jwt-verification-and-key-trust .claude/skills/auditing-jwt-verification-and-key-trust
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Auditing Jwt Verification And Key Trust an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Auditing Jwt Verification And Key Trust automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Auditing Jwt Verification And Key Trust net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Auditing JWT verification and key trust: the token names its own signer unless you stop it

A JSON Web Token is a signed claim, and its security is entirely in how the verifier checks the signature and the claims. The failures are a small, famous set, and they recur because the token itself carries the parameters an attacker wants to control. The algorithm lives in the token header, so a verifier that trusts it can be steered into algorithm confusion, verifying an RS256 token as HS256 using the public key as the shared secret, or accepting an algorithm of none with no signature at all. The key can be selected from the header too, a key id, a JWKS URL, or an embedded key, so a token can name a signer the attacker controls. A verifier that decodes the token and reads the claims but never actually checks the signature accepts anything. And a verifier that checks the signature but not the expiry, issuer, and audience honors expired or wrong-context tokens. The audit pins the algorithm and key on the server side and confirms the signature and claims are enforced. You audit this by presenting manipulated tokens and confirming each is refused.

When to use

  • A service accepts JWTs and verifies them to authenticate or authorize a caller.
  • The signing algorithm or key may be chosen from token-supplied fields (alg, kid, jku, embedded key).
  • Claims such as expiry, issuer, and audience may be parsed but not enforced during verification.

Scope check

Test JWT verification only against services you own or are authorized to assess, on non-production tokens and accounts. Forging tokens attempts real authentication, so use non-production credentials and never use a forged token to reach real data. If you can't name the authorization, stop.

The loop

  1. Establish the intended algorithm and key first. Name the exact algorithm the service should accept and the specific key or key set it should verify against, both fixed on the server side. This is the false-positive killer: a verifier that pins the algorithm, selects the key from server configuration or a pinned trusted key set, verifies the signature, and enforces expiry, issuer, and audience is correct. Name the intended algorithm and key, then test manipulation.

  2. Test algorithm confusion and none. Present a token whose header switches the algorithm: an RS256 token re-signed as HS256 using the public key as the secret, and a token with the algorithm set to none and no signature. Confirm the verifier rejects any algorithm other than the one it expects and never accepts none. A verifier that honors the header's algorithm is steerable into using the wrong verification path.

  3. Test attacker-chosen key selection. Check whether the key is selected from a token-supplied field: a key id that indexes an attacker-influenceable store or path, a JWKS URL the token names so the server fetches the attacker's key, or an embedded key the token carries. Present tokens that manipulate each and confirm the server ignores token-supplied key hints and uses only its pinned trusted keys.

  4. Confirm the signature is actually verified. Confirm the code verifies the signature rather than merely decoding the token and reading claims. Present a token with a valid structure but an invalid signature and confirm it is rejected. A decode-without-verify path accepts any well-formed token regardless of signature.

  5. Check claim enforcement. Confirm the verifier enforces expiry (and not-before), issuer, and audience, not just parses them. Present an expired token, one from the wrong issuer, and one for a different audience, and confirm each is refused. A signature-valid token with an unenforced claim is honored outside its intended time or context.

  6. Confirm and record. Confirm by getting a manipulated token accepted, an algorithm-confused or none token, one signed by an attacker-named key, one with an unverified signature, or an expired or wrong-audience token, on non-production accounts and without reaching real data. Kill the lead if the verifier pins the algorithm, uses only server-side trusted keys, verifies the signature, and enforces expiry, issuer, and audience. Record the forged token, the authenticated or authorized action sink, and the algorithm confusion, attacker-chosen key, or unverified claim that accepted it.

Where JWT verification leaks

  • Algorithm from the header enables confusion. Trusting the token's algorithm allows RS256-to-HS256 confusion using the public key as the secret, or an algorithm of none with no signature.
  • Key from the token names its own signer. A key id, a JWKS URL, or an embedded key taken from the token lets an attacker point verification at a key they control.
  • Decode is not verify. Reading the claims without checking the signature accepts any well-formed token.
  • Parsed claims are not enforced claims. Expiry, issuer, and audience read but not checked honor expired or wrong-context tokens.
  • A valid signature is not sufficient authorization. A correctly signed token still must match the expected issuer, audience, and time to authorize this action.

Worked example (a confirm and a kill)

Confirm. A service verifies RS256 tokens but selects the verification algorithm from the token header. A token re-signed as HS256, using the service's known public key as the HMAC secret, is accepted because the verifier runs the HMAC path with the public key. The forged token authenticates as an arbitrary user. Confirmed JWT algorithm-confusion authentication bypass, critical, remediation = pin the accepted algorithm to exactly RS256 on the server, reject any other algorithm and none, and never derive the verification key or algorithm from token-supplied fields.

Kill. The verifier accepts only the one configured algorithm, rejects none and any mismatch, selects the key solely from a pinned trusted key set ignoring the token's key id, JWKS URL, and embedded key, verifies the signature on every token, and enforces expiry, issuer, and audience. An algorithm-confused, wrong-key, unsigned, expired, or wrong-audience token is refused. Killed, kill_reason = "algorithm pinned, key taken only from server-side trusted set, signature verified, and claims enforced; no manipulated token authenticates."

Rationalizations to reject

  • "The library verifies the token." → Confirm it pins the algorithm and ignores token-supplied keys; many verify paths honor the header's algorithm and key hints unless configured not to.
  • "We use RS256." → Confirm the server rejects a token that claims HS256 or none; accepting the header's algorithm is exactly the confusion attack.
  • "The key id tells us which key." → A token-supplied key id, JWKS URL, or embedded key is attacker input; select the key from your trusted set, never from the token.
  • "We read the claims." → Reading is not verifying; confirm the signature is checked and expiry, issuer, and audience are enforced, not just parsed.
  • "The signature is valid." → A valid signature proves origin, not context; enforce issuer, audience, and expiry so the token authorizes only this action now.

Executing this in practice

You need the algorithm the service accepts, how the verification key is selected, whether the signature is actually verified, and which claims are enforced. For each, present an algorithm-confused or none token, a token naming an attacker-controlled key, an invalid-signature token, and expired and wrong-audience tokens. Reading the verification code shows the intended pinning; a manipulated token accepted shows whether it holds.

Related

  • auditing-oauth-token-audience-and-scope-trust - the audience and scope layer above verification; a token must verify here before its audience and scope can be trusted there.
  • auditing-saml-and-oidc-federation-trust - OIDC ID tokens are JWTs, so this verification is the mechanism underneath that skill's issuer and audience checks.
  • auditing-webhook-authenticity-and-callback-trust - signed webhooks share the verify-the-signature-and-the- claims discipline; the same decode-without-verify and key-trust mistakes appear there.
  • hunting-non-human-identity-and-secret-reachability - the signing key is a high-value secret; that skill traces who can reach it, which decides whether forgery is even needed.
  • FINDING-SCHEMA.md - source = the forged or unverified token, sink = the authenticated or authorized action it grants, evidence = the algorithm confusion, attacker-chosen key, or unverified claim that accepted it.

Heefeg gestallte Froen

Wat mécht de KI-Skill Auditing Jwt Verification And Key Trust?

Iwwerpréift, wéi e Service JSON Web Tokens géint déi klassesch Ëmgehungsattacke bei der Verifikatioun iwwerpréift: eng Attack duerch Algorithmusverwiesslung, bei där en Token den Ënnerschrëftalgorithmus wiesselt, soudatt en ëffentleche Schlëssel als symmetrescht Geheimnis benotzt gëtt, oder den Algorithmus op none gesat gëtt; e Schlëssel, deen aus engem Header ausgewielt gëtt, deen en Ugräifer kontrolléiert (eng Schlëssel-ID, eng JWKS-URL oder e Schlëssel am Token), soudatt den Token säin eegene Signataire ugëtt; eng Ënnerschrëft, déi decodéiert, awer net tatsächlech verifizéiert gëtt; a Cl...

Firwat Auditing Jwt Verification And Key Trust op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Auditing Jwt Verification And Key Trust besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Auditing Jwt Verification And Key Trust an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/UnboundCompute/security-agent-skills/tree/main/skills/auditing-jwt-verification-and-key-trust an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Auditing Jwt Verification And Key Trust benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Auditing Jwt Verification And Key Trust benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Auditing Jwt Verification And Key Trust domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Auditing Jwt Verification And Key Trust gratis?

Jo. UnboundCompute huet de Skill ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇