jwt-attacks

jwt-attacks is a skill for Claude Code, Codex from forefy/.context. It costs 44 tokens per session (3,250 once invoked), scanned A, original, MIT.

A security-testing guide for checking JSON Web Tokens (JWTs), signed tokens often used as bearer credentials for web logins and APIs. It analyzes captured tokens and can test whether a server accepts forged signatures or altered token settings.

In plain words
What is it for?
Use it to crack weak HMAC secrets offline and test captured tokens for algorithm confusion, signature removal, key injection, and related JWT validation flaws.
Why use it?
It helps reveal broken signature validation, including accepting unsigned tokens, trusting injected keys, or confusing signing algorithms. Active tests should be used only on authorized applications.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/forefy/.context/jwt-attacks
Any agent
npx skills add forefy/.context --skill jwt-attacks
Clone the repo
git clone --depth 1 https://github.com/forefy/.context

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-attacks

README.md
[![agentmods](https://agentmods.dev/badge/skills/forefy/.context/jwt-attacks.svg)](https://agentmods.dev/skills/forefy/.context/jwt-attacks)
Your own site
<a href="https://agentmods.dev/skills/forefy/.context/jwt-attacks"><img src="https://agentmods.dev/badge/skills/forefy/.context/jwt-attacks.svg" alt="Measured on agentmods" height="20"></a>
Per session 44 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,250 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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 $0.00044 $0.03250
Opus 5 $0.00022 $0.01625
Sonnet 5 $0.00009 $0.00650
Haiku 4.5 $0.00004 $0.00325

Measured today against content hash 0366051b0649, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

jwt-attacks scanned grade A with 1 finding 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 today.

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.

Makes network callslowCapability

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

curl -sk -o /dev/null -w '%{http_code}\n' \
skills/applicative-pentest/jwt-attacks/SKILL.md · 192 lines

How it starts

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

Contents

  • Scope & authorization
  • Step 0 - locate the token and establish a baseline
  • Step 1 - offline HMAC secret crack (passive)
  • Step 2 - signature stripping (active)
  • Step 3 - alg:none family (active)
  • Step 4 - kid manipulation (active)
  • Step 5 - self-signed key injection: jwk / jku (active)
  • Step 6 - RS256->HS256 algorithm confusion (active)
  • Runnable snippets
  • Output

Scope & authorization

Only run against an application you own or are engaged to test. The offline secret-cracking step (Step 1) is fully passive - it only analyzes a token you already captured and makes no network requests, so it is always safe to run. Every forgery step after it is active: it replays a tampered token against the live server, which mutates the authenticated session and appears in the target's logs. Do not run the active steps against third-party or out-of-scope hosts.

Inputs are the JWTs you already hold - captured from proxy history, a browser session, or an Authorization header the app issued to you. Outputs are "report a finding when the server accepts a token you forged."

Step 0 - locate the token and establish a baseline

  1. Find the JWT. In each captured request, read the Authorization header. Strip a leading Bearer if present. A JWT is three base64url segments joined by dots (header.payload.signature) and the header segment almost always starts with ey (that is {" base64url-encoded). Tokens also appear in cookies and in access_token / id_token body or query params - check those too. Skip any auth header whose value does not start with ey; after ~3 non-JWT auth values on a host, move on.
  2. Decode it (passive). base64url-decode segment 1 (header) and segment 2 (payload). Note alg, kid, jku, jwk in the header and exp, iat, roles/scopes/sub in the payload - these drive both the crack and the forgeries.
  3. Establish the rejection baseline (active). Before forging anything, confirm the endpoint actually enforces the token: replay the request with a deliberately invalid token (original token with its last signature character changed) and confirm the server answers 401 Unauthorized. Only endpoints that reject a bad token are worth attacking - if an endpoint returns 200 for garbage, it never checked the token and the "forgery accepted" signal is meaningless. Rate-limit yourself: after ~5 filtered requests that fail to return 401 to an invalid token, stop on that host.

Read the full file on GitHub · 192 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. today Changed · +1 lines 0366051b0649
  2. 5d ago First seen · 191 lines · 44 tokens per session scan A ccb70f03d7fe

Subscribe to this mod's changes

jwt-attacks is a skill published in the GitHub repository forefy/.context (141 stars, last pushed yesterday), licensed MIT. It adds 44 tokens to every session and 3,250 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (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

eresus-manual-security-audit

Elite manual security code review skill for deep, adversarial vulnerability hunting and exploit-chain discovery. Trigger when the user asks to: "do a deep security audit", "manual code review", "find exploit chains", "hunt for logic bugs", "red-team this codebase", "do an offensive security review", "review this like…

EresusSecurity/appsec-skills · 145 tokens

eresus-sast-scanner

General-purpose Static Application Security Testing (SAST) skill for code vulnerability analysis. Trigger when the user asks to: "analyze code for vulnerabilities", "review code security", "find security bugs", "do a SAST scan", "check for [vulnerability type] in code", "audit source code", or requests a security code…

EresusSecurity/appsec-skills · 100 tokens

eresus-php-audit

Deep PHP-specific security audit skill covering injection, deserialization, file operations, auth bypass, POP chain discovery, and CMS-specific patterns. Trigger when auditing PHP code: "audit this PHP app", "find PHP security issues", "check Laravel/WordPress for vulnerabilities", "PHP SAST review", "check for PHP…

EresusSecurity/appsec-skills · 92 tokens

eresus-python-audit

Deep Python-specific security audit skill with 50+ vulnerability class coverage across 7 categories. Trigger when auditing Python code: "audit this Python app", "find Python security issues", "check Flask/Django for vulnerabilities", "Python SAST review", "check for pickle vulnerabilities", "review this FastAPI code".…

EresusSecurity/appsec-skills · 101 tokens

eresus-pr-security-review

Security-focused pull request and diff review skill for finding newly introduced vulnerabilities, risky regressions, and missing security tests in changed code. Trigger when the user asks to: "review this PR for security", "check this diff for vulns", "do a security code review", "audit changed files", or wants…

EresusSecurity/appsec-skills · 90 tokens

eresus-remediator

Security remediation skill for fixing confirmed or likely SAST findings in source code. Trigger when the user asks to: "fix a vulnerability", "patch this security bug", "remediate SAST findings", "harden this endpoint", "make this auth flow safe", or wants code changes that remove a confirmed security issue while…

EresusSecurity/appsec-skills · 84 tokens