πŸ•΅οΈ
VeryLazyTech
πŸ“œ MediumπŸ›’ My ShopπŸ‘Ύ GithubπŸ“© Telegram πŸ“Ί YouTubeβœ– Twitter
  • πŸ•΅οΈWelcome!
    • VeryLazyTech
    • Support VeryLazyTech
      • πŸ‘Ύ GitHub
      • πŸ“œ Medium
      • β˜• My Shop
      • πŸ“Ί YouTube
      • βœ– Twitter
      • πŸ“© Telegram
  • πŸ›‘οΈ Vulnerabilities and Exploits
    • CVE - POC
      • Unauthenticated RCE Flaw in Rejetto HTTP File Server - CVE-2024-23692
      • POC - CVE-2024–4956 - Nexus Repository Manager 3 Unauthenticated Path Traversal
      • POC - CVE-2024-45241: Path Traversal in CentralSquare's CryWolf
      • Telerik Auth Bypass CVE-2024-4358
      • Check Point Security Gateways Information Disclosure - CVE-2024-24919
      • CVE-2024-23897 - Jenkins File Read Vulnerability
      • CVE-2024–10914- Command Injection Vulnerability in name parameter for D-Link NAS
      • POC - CVE-2024-21534 Jsonpath-plus vulnerable to Remote Code Execution (RCE)
      • CVE-2024-9935 - PDF Generator Addon for Elementor Page Builder <= 1.7.5 - Unauthenticated Arbitrary
      • CVE-2024-50623- Cleo Unrestricted file upload and download
      • POC - WordPress File Upload plugin, in the wfu_file_downloader.php file before version <= 4.24.11
      • POC - Remote and unauthenticated attacker can send crafted HTTP requests to RCE - cve-2025-3248
      • POCβ€Š-β€ŠCVE-2025–2539 File Away <= 3.9.9.0.1β€Š-β€ŠMissing Authorization to Unauthenticated Arbitrary File
      • POC - CVE-2025-29306 FOXCMS /images/index.html Code Execution Vulnerability
  • πŸ•΅οΈβ€β™‚οΈDorks
    • GitHub Dorks
    • Google Dork Online Tool
  • πŸ“š Resources
    • Top Hacking Books for 2024: FREE and Paid
    • How to Study for OSCP with the PWK Book PDF
    • Top 20 phishing tools to use in 2024
    • Top 8 Bug Bounty Books for 2025: Must-Reads for Ethical Hackers
    • Top Hacking Tools and Skills You Need to Learn in 2025
    • Offensive Cloud
    • Penetration Testing & Hacking Tools List
    • Top Cybersecurity Books by Topic
  • The Ultimate Penetration Testing Methodology (2025 Edition)
  • πŸ•ΈοΈPentesting Web
    • Client Side Template Injection (CSTI)
    • Identify a Server’s Origin IP
    • 2FA/MFA/OTP Bypass
  • IDOR
  • Open Redirect
  • Subdomain Takeover
  • Penetration Testing WiFi Networks
  • Client-Side Path Traversal
  • Clickjacking
  • Command Injection
  • JWT Vulnerabilities
  • Bypass rating limit
  • CORS - Misconfigurations & Bypass
  • LDAP Injection
  • File upload vulnerabilities
  • Content Security Policy (CSP) bypass
  • 🐧Linux
    • Practical Linux Commands
    • Bypassing Bash Restrictions - Rbash
    • Privilege escalation - Linux
  • Linux Environment Variables
  • πŸͺŸWindows
    • Active Directory Methodology
  • 🌐Network Pentesting
    • FTP - Port 21
    • SSH- Port 22
    • Telnet - Port 23
    • SMTP/s - Port 25,465,587
    • WHOIS - Port 43
    • TACACS+ - Port 49
    • DNS - Port 53
    • TFTP/Bittorrent-tracker - Port 69/UDP
    • Finger - Port 79
    • Web - Port 80,443
    • Kerberos - Port 88
    • POP - Port 110/995
    • Portmapper - Port 111/TCP/UDP
    • Ident - Port 113
    • NTP - Port 123/UDP
    • MSRPC - Port 135, 539
    • NetBios - Port 137,138,139
    • SMB - Port 139 445
    • IMAP - Port 143, 993
    • SNMP - Ports 161, 162, 10161, and 10162/UDP
    • IRC - Ports 194,6667,6660-7000
    • Check Point Firewall - Port 264
    • LDAP - Ports 389, 636, 3268, 3269
    • IPsec/IKE VPN - Port 500/UDP
    • Modbus - Port 502
    • Rexec - Port 512
    • Rlogin - Port 513
    • Rsh - Port 514
    • Line Printer Daemon (LPD) - Port 515
    • Apple Filing Protocol (AFP) - PORT 548
    • RTSP - Port 554, 8554
    • IPMI - Port 623/UDP/TCP
    • Internet Printing Protocol (IPP) - Port 631
    • EPP - Port 700
    • Rsync - Port 873
    • Rusersd Service - Port 1026
    • Socks - Port 1080
    • Java RMI - RMI-IIOP - Port 1098/1099/1050
    • MSSQL (Microsoft SQL Server) - Port 1433
    • Oracle TNS Listener - Port 1521,1522-1529
  • PPTP - Port 1723
  • MQTT (Message Queuing Telemetry Transport) - Port 1883
  • Compaq HP Insight Manager - Port 2301, 2381
  • NFS Service - Port 2049
  • Docker - Port 2375,2376
  • Squid - Port 3128
  • iScsi - Port 3260
  • SAPRouter - Port 3299
  • 😎Post-exploitation
    • File Transfer Cheatsheet: Windows andΒ Linux
  • πŸ§‘β€πŸ”§Technical guides
    • Kali Linux - Installation
Powered by GitBook
On this page
  • What is JWT?
  • Find JWT tokens
  • Quick win
  • Common JWT Vulnerabilities and Exploitation Techniques
  • 1. Algorithm Confusion Attack (None Algorithm Bypass)
  • 2. Weak Secret Key (Brute-Force HS256 Secret Key)
  • 3. Key Confusion in RS256 to HS256 Downgrade Attack
  • 4. JWT Expiration and Replay Attacks
  • 5. Sensitive Data Exposure in JWT Payloads
  • Tools for Penetration Testing JWTs
  • 1. jwt_tool
  • 2. jwt-cracker
  • 3. Burp Suite with JWT Editor
  • 4. John the Ripper & Hashcat

Was this helpful?

JWT Vulnerabilities

PreviousCommand InjectionNextBypass rating limit

Last updated 2 months ago

Was this helpful?

  • Become VeryLazyTech ! 🎁

  • Follow us on:

    • βœ– Twitter .

    • πŸ‘Ύ Github .

    • πŸ“œ Medium .

    • πŸ“Ί YouTube .

    • πŸ“© Telegram .

    • πŸ•΅οΈβ€β™‚οΈ My Site .

  • Visit our for e-books and courses. πŸ“š

What is JWT?

JWT is an open standard (RFC 7519) for securely transmitting information between parties as a JSON object. It consists of three parts:

  • Header – Specifies the token type and signing algorithm (e.g., HS256, RS256).

  • Payload – Contains the claims, such as user ID, roles, and expiration time.

  • Signature – Used to verify the authenticity of the token.

A typical JWT looks like this:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.
eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6Ikpv
biBEb2UiLCJhZG1pbiI6dHJ1ZX0.
SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c

JWTs are widely used in APIs, Single Sign-On (SSO), and authentication mechanisms, but their security largely depends on correct implementation.


Find JWT tokens

1. Inspect HTTP Headers

JWTs are often passed in HTTP headers, particularly in the Authorization header:

Authorization: Bearer <your_jwt_token>

Use tools like Burp Suite, Postman, or your browser’s Developer Tools to inspect network requests and locate JWTs.

2. Check Local Storage, Session Storage, and Cookies

JWTs may be stored in:

console.log(localStorage.getItem('token'));
console.log(sessionStorage.getItem('token'));
console.log(document.cookie);

Use browser Developer Tools (F12 -> Application -> Storage) to find them.

3. Search in JavaScript Files

Developers sometimes hardcode JWTs in JavaScript files. Use tools like grep:

grep -r 'eyJ' /var/www/html/

Or use Burp Suite’s passive scanner to detect tokens.

4. Analyze API Responses

JWTs are often returned in API responses. Use tools like curl:

curl -X GET https://example.com/api -H "Authorization: Bearer <token>"

Intercept API responses with Burp Suite or OWASP ZAP to extract JWTs.

5. Check Logs and Error Messages

JWTs may be leaked in logs or error messages. Run:

grep -r 'Authorization: Bearer' /var/log/

Review logs, especially if debugging mode is enabled.

6. Use Search Engines (Google Dorking)

Sometimes JWTs are exposed online. Try:

site:example.com inurl:token

Quick win

python3 jwt_tool.py -M at \
    -t "https://api.example.com/api/v1/user/76bab5dd-9307-ab04-8123-fda81234245" \
    -rh "Authorization: Bearer eyJhbG...<JWT Token>"

If you are lucky the tool will find some case where the web application is incorrectly checking the JWT:

Then, you can search the request in your proxy or dump the used JWT for that request using jwt_ tool:

python3 jwt_tool.py -Q "jwttool_706649b802c9f5e41052062a3787b291"

Common JWT Vulnerabilities and Exploitation Techniques

1. Algorithm Confusion Attack (None Algorithm Bypass)

If a server improperly verifies the signing algorithm, an attacker can modify the header to use "alg": "none", bypassing signature verification.

Exploitation:

  1. Capture a valid JWT token.

  2. Modify the header to:

    { "alg": "none", "typ": "JWT" }
  3. Remove the signature part and send the modified token to the server.

  4. If the server accepts the unsigned token, authentication is bypassed.


2. Weak Secret Key (Brute-Force HS256 Secret Key)

HS256 requires a secret key for signing, but weak secrets can be brute-forced using tools like jwt-cracker or John the Ripper.

Exploitation:

  1. Extract the JWT token.

  2. Use jwt-tool or hashcat to brute-force the key:

    hashcat -m 16500 -a 3 token.jwt rockyou.txt
  3. If cracked, forge valid JWT tokens with arbitrary claims.


3. Key Confusion in RS256 to HS256 Downgrade Attack

If a server allows switching between RS256 and HS256, an attacker can trick it into using a public key as an HMAC secret key.

Exploitation:

  1. Extract the public key of the application.

  2. Change the algorithm in the JWT header from RS256 to HS256.

  3. Sign the token using the extracted public key.

  4. If accepted, the attacker can generate valid admin JWTs.


4. JWT Expiration and Replay Attacks

Expired tokens may still be accepted if expiration checks are not properly implemented.

Exploitation:

  1. Capture a valid JWT.

  2. Modify the exp field in the payload to extend its validity.

  3. Resign the token and reuse it to gain prolonged access.


5. Sensitive Data Exposure in JWT Payloads

JWT payloads are base64-encoded, not encrypted. Storing sensitive data in them can lead to information leaks.

Exploitation:

  1. Decode the JWT payload:

    echo '<JWT_PAYLOAD>' | base64 -d
  2. If sensitive information (passwords, API keys) is exposed, attackers can use it for further attacks.


Tools for Penetration Testing JWTs

1. jwt_tool

  • A powerful Python tool for testing JWT security.

  • Install it using:

    pip install jwt_tool
  • Example usage:

    jwt_tool <token> -C -d wordlist.txt

2. jwt-cracker

  • Used for brute-forcing weak JWT secrets.

  • Command:

    jwt-cracker -t <token>

3. Burp Suite with JWT Editor

  • Intercept and modify JWTs in real time.

  • Add JWT Editor extension from Burp’s BApp Store.

4. John the Ripper & Hashcat

  • Used for cracking JWT HMAC secrets.

  • Hashcat example:

    hashcat -m 16500 -a 3 <token> rockyou.txt

Support VeryLazyTech πŸŽ‰
  • Follow us on:

Run with mode All Tests! and wait for green lines

You can also use the to launch JWT attacks from Burp.

Learn & practice

Become VeryLazyTech ! 🎁

βœ– Twitter .

πŸ‘Ύ Github .

πŸ“œ Medium .

πŸ“Ί YouTube .

πŸ“© Telegram .

πŸ•΅οΈβ€β™‚οΈ My Site .

Visit our for e-books and courses. πŸ“š

member
@VeryLazyTech
@VeryLazyTech
@VeryLazyTech
@VeryLazyTech
@VeryLazyTech
@VeryLazyTech
shop
jwt_tool
Burp Extension SignSaboteur
For the OSCP.
member
@VeryLazyTech
@VeryLazyTech
@VeryLazyTech
@VeryLazyTech
@VeryLazyTech
@VeryLazyTech
shop