offensive-jwt
What it does
This skill is a checklist for testing JWT-based authentication in authorized penetration tests. It covers algorithm confusion, weak secrets, header injection and key caching problems. It is for security professionals checking whether token login can be bypassed.
When to use it
- βWhen you are testing a web or mobile app's JWT login in an authorized penetration test.
- βWhen you want to check whether a server accepts unsigned or altered tokens.
- βWhen you need to review how a JWT's key ID or key URL headers are handled.
Skill link
https://github.com/SnailSploit/Claude-Red/blob/main/Skills/auth/offensive-jwt/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βWe are authorized to test our login. Check the JWT tokens for weak signing or algorithm confusion.β
5 new skills a week. 1 minute to read.
How it works
The skill works through a checklist in order. It checks the algorithm, the signing secret, the key headers and key caching, and applies each technique to the target.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Overview
Comprehensive JWT attack checklist for offensive security engagements. Follow steps in order; apply each technique to the current target context and track which items have been completed.
Quick Reference: Misconfigurations to Check
- Algorithm set to
noneβ signature verification bypassed entirely - Algorithm switching between
RSAandHMAC(confusion attack) - Weak or guessable HMAC secret (brute-forceable)
kid,jku,jwk,x5uheader parameters accepted without validation- Expired or tampered tokens accepted by server
- Sensitive data stored unencrypted in payload
Useful tool: JWT Tool
Mechanisms
JWTs (RFC 7519) consist of three Base64URL-encoded parts: header.payload.signature.
Signing algorithms:
| Algorithm | Type | Notes |
|---|---|---|
| HS256/384/512 | Symmetric HMAC | Shared secret; confusion target |
| RS256/384/512 | Asymmetric RSA | Public key can be misused as HMAC secret |
| ES256/384/512 | Asymmetric ECDSA | |
| PS256/384/512 | RSASSA-PSS | |
| EdDSA (Ed25519/Ed448) | Asymmetric | |
| none | Unsigned | Critically insecure |
Additional pitfalls:
- JWS/JWE confusion: server accepts encrypted token (JWE) where signed (JWS) is expected, or fails open on unexpected
typ/cty - JWKS retrieval: SSRF via
jku/x5u, insecure TLS, poisoned key caching,kidcollisions - Token binding (DPoP, mTLS): incorrectly implemented allows replay from other clients
Hunt: Identifying JWT Usage
- Check
Authorization: Bearer <token>headers in all requests - Look for cookies containing JWT structures (
eyJ...) - Examine browser local/session storage
- Decode the token at jwt.io or via BurpSuite JWT extension β inspect claims and header parameters
- Note any
kid,jku,jwk,x5ufields in the header β these are attack surfaces
Vulnerability Map
JWT Vulnerabilities
βββ Algorithm Bypass
β βββ alg:none attack
β βββ RS256βHS256 confusion (public key as HMAC secret)
βββ Weak Secret Key β Brute force
βββ kid Parameter Injection
β βββ SQL injection via kid
β βββ Path traversal via kid
βββ Header Injection
β βββ jwk (inline fake key)
β βββ jku/x5u (remote attacker-controlled JWKS)
β βββ JWKS cache poisoning
βββ Missing / Broken Validation
βββ No signature check
βββ Expired tokens accepted
βββ iss/aud/exp not validated
Vulnerabilities
Algorithm Vulnerabilities
- alg:none β Some libraries disable signature validation when
algisnoneor a case variant (None,NONE,nOnE) - Algorithm Confusion (RS256βHS256) β Server uses RSA public key as HMAC secret when attacker switches
algto HS256; attacker re-signs token with the public key - Key ID (
kid) Manipulation β Exploitingkidto load wrong keys or inject file paths / SQL; enforce strict lookups
Signature Vulnerabilities
- Weak HMAC Secrets β Brute-forceable with dictionary or hashcat
- Missing Signature Validation β Token accepted without any verification
- Broken Validation β Implementation errors in signature checking logic
Implementation Issues
- Missing Claims Validation β
exp,nbf,aud,issnot verified - Insufficient Entropy β Predictable JWT IDs or tokens
- No Expiration β Tokens valid indefinitely
- Insecure Transport β Token sent over HTTP
- Debug Leakage β Detailed error messages expose implementation
Header Injection Attacks
- JWK Injection β Supply a custom attacker-controlled public key via the
jwkheader - JKU Manipulation β Point
jku(JWK Set URL) to attacker-controlled JWKS endpoint - x5u Misuse β Load untrusted X.509 key URL; exploit lax TLS validation or open redirects
- JWKS Cache Poisoning β Force caches to accept attacker keys via
kidcollisions or response header manipulation critHeader Abuse β Server ignores unknown critical parameters, enabling bypass
Information Disclosure
- Sensitive data (PII, credentials, session details) stored unencrypted in payload
- Internal service/backend information leaked via claims
Additional Attack Vectors
Mobile App JWT Storage
Android:
SharedPreferences: Check if world-readable; location/data/data/<package>/shared_prefs/- Keystore extraction: root device or exploit app
- Backup extraction:
adb backup -f backup.ab <package>(ifallowBackup=true) - Tools: Frida, objection, MobSF
iOS:
- Keychain: Check `kSecAttrA
FAQ
What is algorithm confusion?
It is when a server is tricked into checking a token with the wrong algorithm, such as using a public key as a secret.
Which tool does it mention?
It mentions the JWT Tool project for testing tokens.
Is this for testing my own app?
It is written for authorized testing of an app, where you have permission to test it.
Details
Original description by the author
JWT attack methodology for penetration testers. Covers algorithm confusion (alg:none, RS256βHS256), weak HMAC secret brute force, kid parameter injection (SQLi, path traversal), jku/x5u/jwk header injection, JWKS cache poisoning, JWS/JWE confusion, timing attacks, and mobile JWT storage extraction. Use when testing JWT-based authentication, hunting auth bypass via token manipulation, or evaluating JWT implementation security in web or mobile apps.
repo: SnailSploit/Claude-Red
Popularity
- GitHub stars
- 10k
- Ranking position
- #11947
- License
- MIT
- Updated
- 10/12/2026
Comments
- β¦
More skills from this repository
offensive-active-directory
10kHelps your agent plan an authorized Active Directory security test, from mapping the network to finding attack paths to Domain Admin.
offensive-netexec
10kHelps your agent use the NetExec (nxc) tool for authorized network testing, covering protocols, authentication and credential checks.
offensive-api-abuse
10kHelps your agent plan authorized API security tests that look for business logic abuse, GraphQL risks and race conditions.
offensive-api-security
10kHelps your agent run authorized security tests on REST, gRPC and WebSocket APIs, based on the OWASP API Top 10.
Similar skills
reverse-engineer-anything
422kHelps your agent look inside shipped apps and packages to explain features, compare versions, or guide a rebuild, using the REA tool.
1password
394kHelps your agent set up the 1Password CLI, sign in, and read or inject secrets without printing their values into chat.
healthcheck
394kHelps your agent audit the computer or server that runs OpenClaw for security risks, such as SSH, firewall, updates, and backups, then suggest safe fixes.