hunt-jwt-crypto

Detect and exploit JWT signature forgery flaws including alg:none and RS256-to-HS256 key confusion.

4.0k|628|Updated May 5, 2026
One-click install
npx skills add https://github.com/elementalsouls/Claude-BugHunter --skill hunt-jwt-crypto
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hunt-jwt-crypto
Source: https://github.com/elementalsouls/Claude-BugHunter/tree/main/skills/hunt-jwt-crypto
Command: npx skills add https://github.com/elementalsouls/Claude-BugHunter --skill hunt-jwt-crypto

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Applications that authenticate with JSON Web Tokens often contain cryptographic verification flaws that let an attacker forge tokens and impersonate any user or admin. This Skill guides a security tester through identifying, exploiting, and proving those JWT signature weaknesses during authorized bug-hunting engagements.

Core Features & Use Cases

  • Signature Forgery Techniques: Covers alg:none stripping, RS256-to-HS256 key confusion, kid/jku/x5u header injection, jwk self-signed key injection, and expiry claim manipulation.
  • Offline Secret Cracking: Cracks weak HS256 HMAC secrets with hashcat (mode 16500) or jwt_tool wordlists to forge arbitrary tokens.
  • Escalation Workflow: Drives from a working forge to an admin objective, with a fixed sequence for hitting admin endpoints and proving cross-identity data access.
  • Use Case: During an authorized assessment you capture an eyJ... Bearer token signed with RS256; the Skill walks you through fetching the public key from the JWKS endpoint, re-signing an edited admin payload with HS256, and proving access to the admin user list.

Quick Start

Ask the AI to test the application's JWT authentication for signature forgery flaws such as alg:none and RS256-to-HS256 key confusion using the captured Bearer token.

Frequently Asked Questions about hunt-jwt-crypto

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test a JWT for alg:none signature bypass?

Set the token header alg value to none, edit the payload claims such as role or user id, and drop the signature while keeping the trailing dot. Some verifiers reject lowercase none but accept case variants like None or NONE, so try each variant.

How does RS256 to HS256 key confusion work?

When a token is signed with RS256, the RSA public key is public by design. If the verifier accepts HS256, it uses that public key as the HMAC secret, so an attacker can sign an edited payload with HS256 using the public key and pass verification.

What tools can I use to forge JWT tokens?

jwt_tool supports tampering, alg:none attacks, and key confusion via flags like -X a and -X k -pk. Burp Suite's JWT Editor extension and PyJWT also work, and nuclei can automate JWT vulnerability scanning against a target URL.

Can weak JWT HMAC secrets be cracked offline?

Yes, HS256 tokens with weak secrets can be cracked offline using hashcat mode 16500 with a wordlist like rockyou.txt, or jwt_tool's built-in cracking mode. Once the secret is recovered, any token can be forged with HS256.

Why does my forged JWT get a 401 response?

A 401 means the verifier rejected the forge, so change one variable at a time: the kid traversal depth, the claim name or value, or the algorithm. A rejected alg:none only means that specific flaw is patched, so try key confusion before concluding the app is safe.

When should JWT crypto testing not be used?

This testing is only appropriate for authorized bug-hunting and red-team engagements within scope. It focuses on signature and crypto forgery; SSO/SAML token trust issues and non-crypto JWT handling belong to separate authentication testing areas.