A tool to scan JWT tokens for security vulnerabilities
Project description
JWT Security Scanner 🔐
A Python-based command-line tool that automatically scans JWT tokens for security vulnerabilities and generates professional security reports.
What is This Tool?
JWT (JSON Web Token) is used by millions of websites to handle user authentication. But poorly configured JWT tokens can be exploited by hackers to bypass login, steal accounts, or gain admin access.
This tool acts like a security doctor for JWT tokens — you give it a token, it runs 5 security checks and tells you exactly what's wrong and how to fix it.
Features
- Detects 5 critical JWT vulnerability categories
- Beautiful colored terminal output
- Generates professional HTML security report
- Generates text report for documentation
- Includes security recommendations
- Works on any JWT token
Vulnerabilities Detected
| Check | What it detects | Risk Level |
|---|---|---|
| Algorithm Check | Dangerous 'none' algorithm usage | CRITICAL |
| Weak Secret Key | Guesses secret key from common passwords | CRITICAL |
| Token Expiry | Missing or expired expiry time | HIGH |
| Sensitive Data | Passwords or private data in payload | HIGH |
| Token Claims | Missing issuer, subject, audience | MEDIUM |
Tools and Technologies
- Python 3 — Core programming language
- PyJWT — JWT token decoding and validation
- Rich — Beautiful terminal formatting
- Colorama — Terminal color support
Installation
Step 1 — Clone the repository
git clone https://github.com/YOURUSERNAME/JWT-Security-Scanner.git
cd JWT-Security-Scanner
Step 2 — Install dependencies
pip install -r requirements.txt
Usage
Run the scanner
python jwt_scanner.py
Or pass token directly
python jwt_scanner.py YOUR_JWT_TOKEN_HERE
Generate a test vulnerable token
python -c "import jwt; print(jwt.encode({'user': 'admin', 'password': 'secret123'}, 'secret', algorithm='HS256'))"
Example Output
JWT Security Scanner
Finds vulnerabilities in JWT tokens
SECURITY FINDINGS
CRITICAL WEAK SECRET KEY FOUND: 'secret'
HIGH No expiry time found!
HIGH Sensitive fields found: password
SECURITY SUMMARY
CRITICAL 1
HIGH 2
MEDIUM 0
LOW 5
CRITICAL VULNERABILITIES FOUND! This token is DANGEROUS!
Reports Generated
After every scan the tool automatically generates:
1. Text Report
Plain text file with all findings — perfect for documentation
2. HTML Report
Professional security report with color coded risk levels, summary dashboard, findings table, recommendations and cybersecurity quotes
What I Learned Building This
- JWT token structure — Header, Payload, Signature
- Common JWT vulnerabilities and how attackers exploit them
- Python security tool development
- Automated vulnerability scanning techniques
- Professional security report generation
- The difference between encoding and encryption
Real World Application
This tool simulates what penetration testers and security engineers do when auditing web applications. JWT vulnerabilities are listed in the OWASP Top 10 and are responsible for thousands of security breaches every year.
Project Structure
JWT-Security-Scanner/
│
├── jwt_scanner.py Main scanner with all checks
├── requirements.txt Python dependencies
└── README.md Project documentation
Also Check Out
My other cybersecurity project:
- AI-Powered SIEM Home Lab — Detects real cyber attacks using Elastic SIEM and Tines automation
Connect With Me
Built by an aspiring SOC Analyst learning cybersecurity through hands-on projects.
Connect on LinkedIn
"Security is not a product, but a process." — Bruce Schneier
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jwt_security_scanner-1.0.0.tar.gz.
File metadata
- Download URL: jwt_security_scanner-1.0.0.tar.gz
- Upload date:
- Size: 11.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae19da1f14979fea5fd724841d113c778b80023e7011b3bf9e667aafa9dbd20d
|
|
| MD5 |
14e3a471964f3a88e655845e260325a1
|
|
| BLAKE2b-256 |
4eac3691127f58c88b41c9f07c795e13a0c700062de5332b105d1d314b512bf5
|
File details
Details for the file jwt_security_scanner-1.0.0-py3-none-any.whl.
File metadata
- Download URL: jwt_security_scanner-1.0.0-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
87f2080d22bd21993732f5bf7abb086331b4eab7cc62d41d8d1b29f6f3192aa3
|
|
| MD5 |
045529d0173d45c806ef7561f46d4ac9
|
|
| BLAKE2b-256 |
c84af239589d1b6de9dc7d75f83fec361e699a9df854a1c1a5cda10a3d94852e
|