attacking-jwt

attacking-jwt is a skill for Claude Code from trilwu/secskills. It costs 0 tokens per session (3,267 once invoked), scanned A, original, MIT.

A security-testing guide for JSON Web Tokens, or JWTs, which are signed text tokens that applications use to identify users and their permissions. It focuses on cases where a server accepts a token without correctly checking its signature.

In plain words
What is it for?
Use it to test tokens in headers, cookies, browser storage, or URLs; check signature enforcement, algorithm confusion, weak secrets, header-based key selection, and claim tampering.
Why use it?
It helps find authentication and authorization failures caused by trusting token-supplied settings, weak signing secrets, or unsafe token headers. These mistakes can let someone alter roles or other claims.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

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

Part of the secskills-offense plugin — 40 skills shipped together

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/trilwu/secskills
agentmods
npx agentmods add skills/trilwu/secskills/attacking-jwt

Made for: Claude Code.

Or install secskills-offense, the plugin that ships this one along with the rest of its 40 skills.

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 attacking-jwt

README.md
[![agentmods](https://agentmods.dev/badge/skills/trilwu/secskills/attacking-jwt.svg)](https://agentmods.dev/skills/trilwu/secskills/attacking-jwt)
Your own site
<a href="https://agentmods.dev/skills/trilwu/secskills/attacking-jwt"><img src="https://agentmods.dev/badge/skills/trilwu/secskills/attacking-jwt.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,267 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.1 $0.00000 $0.03267
Opus 5 $0.00000 $0.01633
Sonnet 5 $0.00000 $0.00653
Haiku 4.5 $0.00000 $0.00327

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

Security

Grade A, and why

attacking-jwt 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 2d 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 -s https://target/.well-known/jwks.json
secskills-offense/skills/attacking-jwt/SKILL.md · 289 lines

How it starts

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

Attacking JWT

A JWT is not a credential you are meant to read — it is a signature-verification decision the server makes on bytes you control. Every field, including the alg header that tells the server how to check the signature, is attacker-supplied. The classic failures all come from the server trusting the token's own header to decide how to verify it, or from a secret weak enough to recover offline.

Only against systems you are authorized to test.

When to Use

  • A request carries a token in three base64url parts joined by dots, typically starting with eyJ (the encoded {" of the header)
  • An Authorization: Bearer <token> header is present
  • A session, access_token, id_token, or remember-me value lives in a cookie, localStorage, sessionStorage, or a query parameter
  • The application authenticates or authorizes based on a signed token rather than a server-side session
  • You control any claim (sub, role, admin, aud, iss) and want to see whether the signature is actually enforced

When NOT to Use

  • The wider web-application methodology — use testing-web-applications
  • API authentication and authorization generally — use testing-apis
  • The cryptographic primitives themselves (HMAC, RSA, ECDSA design) — use reviewing-cryptography
  • The OAuth/OIDC flow that issues the token, redirect_uri and PKCE abuse — use attacking-oauth-oidc
  • Cloud IAM tokens (AWS STS, GCP, Azure AD access tokens) as an access primitive — use exploiting-cloud-platforms

Decode and Inspect First

A JWT is header.payload.signature, each part base64url (no padding, - and _ instead of + and /). The first two parts are plaintext; only the signature is protected.

# jwt_tool: the fastest way to read a token and see every claim
python3 jwt_tool.py <token>

# By hand, no tools, no network
echo '<header>'  | tr '_-' '/+' | base64 -d 2>/dev/null; echo
echo '<payload>' | tr '_-' '/+' | base64 -d 2>/dev/null; echo

Read the full file on GitHub · 289 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. 2d ago First seen · 289 lines · 0 tokens per session scan A 79461dfc6968

Subscribe to this mod's changes

attacking-jwt is a skill published in the GitHub repository trilwu/secskills (135 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,267 tokens. 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-09-03.

Related

Other skills, from other repositories

build-mcp-server

This skill should be used when the user asks to "build an MCP server", "create an MCP", "make an MCP integration", "wrap an API for Claude", "expose tools to Claude", "make an MCP app", or discusses building something with the Model Context Protocol. It is the entry point for MCP server development — it interrogates…

anthropics/claude-plugins-official · 111 tokens

data-manager-api-setup

Guides developers through client library installation and authentication setup steps for the Data Manager API. Use this skill when a user is getting started with the Data Manager API and needs to setup their local environment, install the client library, or setup access to the API. Don't use for implementing audience…

google/skills · 86 tokens

workers-best-practices

Reviews and authors Cloudflare Workers code against production best practices. Load when writing new Workers, reviewing Worker code, configuring wrangler.jsonc, or checking for common Workers anti-patterns (streaming, floating promises, global state, secrets, bindings, observability). Biases towards retrieval from…

cloudflare/skills · 72 tokens

new

Create a new project to start development quickly.

clacky-ai/openclacky · 10 tokens

skd-edit

Точечное редактирование схемы компоновки данных 1С (СКД). Используй когда нужно модифицировать существующую СКД — добавить поля, итоги, фильтры, параметры, изменить текст запроса.

Nikolay-Shirokov/cc-1c-skills · 55 tokens

skd-info

Анализ структуры схемы компоновки данных 1С (СКД) — наборы, поля, параметры, варианты. Используй для понимания отчёта — источник данных (запрос), доступные поля, параметры.

Nikolay-Shirokov/cc-1c-skills · 52 tokens