mukul975/anthropic-cybersecurity-skills/testing-jwt-token-security
Claude Code and agent skill by mukul975/anthropic-cybersecurity-skills
- community
Checking that the SKILL.md file is still in the repository.
Assessing JSON Web Token implementations for cryptographic weaknesses,
Install
npx vskill@latest install mukul975/anthropic-cybersecurity-skills/testing-jwt-token-securitySKILL.md
The same SKILL.md was published earlier as mukul975/anthropic-cybersecurity-skills/testing-jwt-token-security.
Testing JWT Token Security
When to Use
- During authorized penetration tests when the application uses JWT for authentication or authorization
- When assessing API security where JWTs are passed as Bearer tokens or in cookies
- For evaluating SSO implementations that use JWT/JWS/JWE tokens
- When testing OAuth 2.0 or OpenID Connect flows that issue JWTs
- During security audits of microservice architectures using JWT for inter-service authentication
Prerequisites
- Authorization: Written penetration testing agreement for the target
- jwt_tool: JWT attack toolkit (
pip install jwt_toolorgit clone https://github.com/ticarpi/jwt_tool.git) - Burp Suite Professional: With JSON Web Token extension from BApp Store
- Python PyJWT: For scripting custom JWT attacks (
pip install pyjwt) - Hashcat: For brute-forcing HMAC secrets (
apt install hashcat) - jq: For JSON processing
- Target JWT: A valid JWT token from the application
Workflow
Step 1: Decode and Analyze the JWT Structure
Extract and examine the header, payload, and signature components.
Step 2: Test Algorithm None Attack
Attempt to forge tokens by setting the algorithm to "none".
Step 3: Test Algorithm Confusion (RS256 to HS256)
If the server uses RS256, try switching to HS256 and signing with the public key.
Step 4: Brute-Force HMAC Secret
If HS256 is used, attempt to crack the signing secret.
Step 5: Test JWT Claim Manipulation and Injection
Modify JWT claims to escalate privileges or bypass authorization.
Step 6: Test Token Lifetime and Revocation
Assess token expiration enforcement and revocation capabilities.
Key Concepts
| Concept | Description | |
|---|---|---|
| Algorithm None Attack | Removing signature verification by setting alg to none | |
| Algorithm Confusion | Switching from RS256 to HS256 and signing with the public key as HMAC secret | |
| HMAC Brute Force | Cracking weak HS256 signing secrets using wordlists or brute force | |
| JKU/x5u Injection | Pointing JWT header URLs to attacker-controlled key servers | |
| KID Injection | Exploiting SQL injection or path traversal in the Key ID header parameter | |
| Claim Tampering | Modifying payload claims (role, sub, permissions) after compromising the signing key | |
| Token Revocation | The ability (or inability) to invalidate tokens before their expiration | |
| JWE vs JWS | JSON Web Encryption (confidentiality) vs JSON Web Signature (integrity) |
Tools & Systems
| Tool | Purpose | |
|---|---|---|
| jwt_tool | Comprehensive JWT testing toolkit with automated attack modules | |
| Burp JWT Editor | Burp Suite extension for real-time JWT manipulation | |
| Hashcat | GPU-accelerated HMAC secret brute-forcing (mode 16500) | |
| John the Ripper | CPU-based JWT secret cracking | |
| PyJWT | Python library for programmatic JWT creation and manipulation | |
| jwt.io | Online JWT decoder for quick analysis (do not paste production tokens) |
Common Scenarios
Scenario 1: Algorithm None Bypass
The JWT library accepts "alg":"none" tokens, allowing any user to forge admin tokens by simply removing the signature and changing the algorithm header.
Scenario 2: Weak HMAC Secret
The application uses HS256 with a dictionary word as the signing secret. Hashcat cracks the secret in minutes, enabling complete token forgery and admin impersonation.
Scenario 3: Algorithm Confusion on SSO
An SSO provider uses RS256 but the consumer application also accepts HS256. The attacker signs a forged token with the publicly available RSA public key using HS256.
Scenario 4: KID SQL Injection
The kid header parameter is used in a SQL query to look up signing keys. Injecting ' UNION SELECT 'attacker_secret' -- allows the attacker to control the signing key.
Output Format
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/testing-jwt-token-security/SKILL.md
Popularity
- Repository stars
- 32,697
- Repository forks
- 3,943
- 7-day trend score
- 52
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 8 May 2026, 6 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/mukul975/anthropic-cybersecurity-skills/testing-jwt-token-security)