Skip to content
Back to skills

Jwt Security

ASecurity

Audits how an app signs, verifies, stores and expires JSON Web Tokens, and fixes algorithm confusion, weak secrets and unsafe browser storage.

  • 3 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added November 15, 2026
ai-agentsrustgosecurity

Security analysis

A100/100

Scanned November 15, 2026

npx -y skills add workspace-templates/ai-agent-templates --skill jwt-security --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Jwt Security?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Jwt Security
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/workspace-templates-jwt-security/badge)](https://www.skillsdirectory.com/skills/workspace-templates-jwt-security)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: jwt-security
description: Audits how an app signs, verifies, stores and expires JSON Web Tokens, and fixes algorithm confusion, weak secrets and unsafe browser storage.
---

# JWT security

Find where tokens are issued and verified, then check each against the failure list below.

## Steps

1. Search for the library calls (`jwt.sign`, `jwt.verify`, `jsonwebtoken`, `jose`, `PyJWT`, `jjwt`) and decoding without verification (`decode`, `jwt_decode` used for decisions).
2. Verification must pin the algorithm: pass an explicit `algorithms` list (for example only `RS256`). Reject `none`. Never let the token header choose the key type, which enables confusion between RS256 and HS256.
3. Secrets: HS256 keys must be random and at least 32 bytes, loaded from the environment. Flag short, guessable or committed keys. Prefer asymmetric keys when other services only verify.
4. Claims: require `exp` with short lifetimes (5 to 15 minutes for access tokens), check `iss` and `aud`, and use `nbf` where relevant. Never put secrets or personal data in the payload; it is only encoded.
5. Lookup by `kid` must use an allowlist, never a file path or query.
6. Storage: do not keep tokens in localStorage or sessionStorage. Use an `HttpOnly`, `Secure`, `SameSite` cookie, or hold the token in memory with a refresh cookie.
7. Refresh and revocation: rotate refresh tokens on use, store them hashed, and keep a denylist or version counter so logout and password change take effect.

## Rules

- A decoded token is untrusted until verified.
- Do not invent a custom signing scheme.

## Report

Per issue: `path:line`, why it is exploitable, the replacement code. End with the safe settings you recommend.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.