jwt-attacks

jwt-attacks is a skill for Claude Code, Codex from forefy/.context. It costs 44 tokens per session (3,279 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

Written for no agent in particular: nothing here depends on one.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is kh = {**hdr, "alg": "HS256", "kid": "../../../../../../../dev/null", "k": ""}.

Good fit Use it to crack weak HMAC secrets offline and test captured tokens for algorithm confusion, signature removal, key injection, and related JWT validation flaws.

Compare 6 skills from other repositories ↓
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/forefy/.context
agentmods
npx agentmods add skills/forefy/.context/jwt-attacks

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/github.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/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-attacks

Your own site · 80×15
<a href="https://agentmods.dev/skills/forefy/.context/jwt-attacks"><img src="https://agentmods.dev/badge/skills/forefy/.context/jwt-attacks.svg" alt="Reviewed on agentmods" width="80" 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,279 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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: 5 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 Privilege Escalation · line 38
    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 40
    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 109
    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 112
    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 38
    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.
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.00044 $0.03279
Opus 5.5 $0.00018 $0.01312
Sonnet 5.5 $0.00009 $0.00656
Haiku 4.5 $0.00004 $0.00328

Measured 1mo ago against content hash 4e6e788c5f34, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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.

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 · 194 lines

How it starts

The opening of the file, as written. The whole thing — 194 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 · 194 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. 1mo ago Changed · +2 lines 4e6e788c5f34
  2. 1mo ago Changed · +1 lines 0366051b0649
  3. 1mo 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 (153 stars, last pushed yesterday), licensed MIT. It adds 44 tokens to every session and 3,279 once invoked, about $0.0002 per session on Opus 5.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-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-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-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

eresus-variant-analysis

GHSA/CVE variant analysis workflow for finding similar vulnerability patterns across a codebase. Trigger when the user asks to: "find variants of this CVE", "GHSA variant analysis", "find similar bugs", "hunt for the same pattern", "are there other places with this vulnerability?", or when a known vulnerability is…

EresusSecurity/appsec-skills · 85 tokens