Skip to main content

A tool to scan JWT tokens for security vulnerabilities

Project description

๐Ÿ” JWT Security Scanner

Analyze JSON Web Tokens (JWTs) for common security vulnerabilities and generate professional security reports.


๐Ÿ“ฆ Available on PyPI

Install the tool directly:

pip install jwt-security-scanner

Run the scanner:

jwt-scanner

Windows Users: If jwt-scanner is not recognized, run:

py -m jwt_scanner.scanner

๐Ÿ“– Project Overview

JWT (JSON Web Token) is widely used for authentication in modern web applications. However, insecure JWT implementations can expose applications to authentication bypass, privilege escalation, token forgery, and unauthorized access.

This project is a Python-based command-line security scanner that analyzes JWTs for common security misconfigurations and generates detailed security reports with remediation recommendations.


๐Ÿš€ Features

  • โœ… Detects 5 common JWT security vulnerability categories
  • ๐ŸŽจ Beautiful colored terminal output using Rich
  • ๐Ÿ“„ Generates professional HTML security reports
  • ๐Ÿ“ Generates text reports for documentation
  • ๐Ÿ›ก Provides security recommendations
  • โšก Simple command-line interface
  • ๐Ÿ“ฆ Available as a PyPI package

๐Ÿ” Security Checks

Security Check Description Risk
๐Ÿ” Algorithm Check Detects insecure none algorithm usage ๐Ÿ”ด Critical
๐Ÿ”‘ Weak Secret Key Detects commonly used weak HMAC secrets ๐Ÿ”ด Critical
โณ Expiry Check Detects missing or expired tokens ๐ŸŸ  High
๐Ÿ“„ Sensitive Data Detects passwords or confidential data in payload ๐ŸŸ  High
๐Ÿ›ก Token Claims Checks missing iss, sub, aud, iat claims ๐ŸŸก Medium

โš™๏ธ Technologies Used

  • Python 3
  • PyJWT
  • Rich
  • Colorama
  • Requests

๐Ÿ’ป Installation

Install from PyPI

pip install jwt-security-scanner

If pip is unavailable:

py -m pip install jwt-security-scanner

โ–ถ๏ธ Usage

Launch the scanner:

jwt-scanner

Or, if the command is not recognized on Windows:

py -m jwt_scanner.scanner

Follow the prompts to paste a JWT token. The scanner will automatically:

  • Decode the token
  • Perform security analysis
  • Display findings
  • Generate HTML and TXT reports

๐Ÿ“Š Example Output

JWT Security Scanner

SECURITY FINDINGS

CRITICAL   Weak Secret Key Found
HIGH       No Expiration Time
HIGH       Sensitive Data Detected

SECURITY SUMMARY

Critical : 1
High     : 2
Medium   : 0
Low      : 5

Verdict:
CRITICAL VULNERABILITIES FOUND

๐Ÿ“„ Reports Generated

Every scan automatically generates:

๐Ÿ“ Text Report

  • Plain text format
  • Easy to archive
  • Useful for documentation

๐ŸŒ HTML Report

  • Modern responsive design
  • Severity dashboard
  • Findings table
  • Token information
  • Security recommendations

๐Ÿ“š What I Learned

  • JWT Architecture (Header โ€ข Payload โ€ข Signature)
  • Digital Signatures
  • HMAC & SHA-256
  • HS256 vs RS256
  • Base64URL Encoding
  • JWT Security Best Practices
  • Python Security Tool Development
  • HTML Report Generation
  • Python Package Publishing (PyPI)

๐ŸŒ Real-World Application

JWT security is an important part of modern web application security. During security assessments, penetration testers and application security engineers review JWT implementations to identify weaknesses such as insecure algorithms, weak signing secrets, missing expiration, and improper token validation.

This tool helps automate those checks for learning and testing purposes.


๐Ÿ“‚ Project Structure

JWT-Security-Scanner/
โ”‚
โ”œโ”€โ”€ jwt_scanner/
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ””โ”€โ”€ scanner.py
โ”œโ”€โ”€ setup.py
โ”œโ”€โ”€ pyproject.toml
โ”œโ”€โ”€ requirements.txt
โ”œโ”€โ”€ README.md
โ””โ”€โ”€ .gitignore

๐Ÿš€ Running from Source

Clone the repository:

git clone https://github.com/tabassumfathima28/JWT-Security-Scanner.git
cd JWT-Security-Scanner

Install dependencies:

pip install -r requirements.txt

Run:

py jwt_scanner\scanner.py

๐Ÿ”— Related Project

๐Ÿ›ก AI-Powered SIEM Home Lab

A complete SIEM lab built using Elastic SIEM and Tines automation.

https://github.com/tabassumfathima28/SIEM-HOME-LAB-PROJECT


๐Ÿ‘ฉโ€๐Ÿ’ป Author

Tabassum Fathima

Cybersecurity Undergraduate | Aspiring SOC Analyst


โญ Support

If you found this project useful, consider giving it a โญ on GitHub!


"Security is not a product, but a process." โ€” Bruce Schneier

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jwt_security_scanner-1.0.1.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jwt_security_scanner-1.0.1-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file jwt_security_scanner-1.0.1.tar.gz.

File metadata

  • Download URL: jwt_security_scanner-1.0.1.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for jwt_security_scanner-1.0.1.tar.gz
Algorithm Hash digest
SHA256 4bd3ce9a4537081fd3268c5f68e9eb21deeee0ee2e20e1c5baa69155b9b10ef8
MD5 999722a625556fea63a20827fd420c3c
BLAKE2b-256 dc6e6035e4304a2991cb30c4f850fd15cb0ed0d5a5a0174e0eff9cad333d943f

See more details on using hashes here.

File details

Details for the file jwt_security_scanner-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for jwt_security_scanner-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9cde214de7741fef4fbcae9ac9fa939abfb07af8b081677954d591b4ea754906
MD5 c285067c1cc25cf16fa53bd0fccb0fd9
BLAKE2b-256 a1cd911a90edbd8ee39557481338d4dfba84e9c7b3aae92cdc68956630a5c9d0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page