jwt
Skill15 starsChanged 42 days agoMITView on GitHub
Expert JSON Web Token (JWT) assistance covering RS256/HS256 signing, claims validation, expiration, and refresh token rotation. Use when securing APIs, signing auth tokens, or debugging invalid signature errors.
6 other projects use a version of this.
Adopted by
Most recently taken up by
- mahumadad/quarrytheir own version, first seen Nov 8, 2026
- ScaleDockHQ/scaledock-skillstheir own version, first seen Oct 2, 2026
- emre-guler/websectheir own version, first seen Aug 27, 2026
- anurag-azure/skillstheir own version, first seen Jun 27, 2026
- sunilgentyala/OmniRedtheir own version, first seen Jun 4, 2026
- Sorcha-Platform/Sorchatheir own version, first seen Jan 24, 2026
Used with
Projects with it also use ssti and xss.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
SubhiSecSkillssti
Hunt Server-Side Template Injection (SSTI) in Jinja2, Twig, Freemarker, Velocity, Smarty, ERB, Handlebars, Mustache, and Spring (SpEL). Use when input is reflected in a way that suggests template rendering — error pages, email templates, PDF generators, dynamic content systems.
Also in 3 projects that use this
SubhiSecSkillxss
Hunt reflected, stored, and DOM-based Cross-Site Scripting (XSS) including CSP bypass, polyglot payloads, mutation XSS (mXSS), markdown XSS, and template XSS. Use when the user has identified a parameter or input that reflects to the page, or wants to test for XSS in a specific input.
Also in 3 projects that use this
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 6
- sunilgentyala/OmniRed★ 5same name
- emre-guler/websec★ 2same name
- Sorcha-Platform/Sorcha★ 2same name
- mahumadad/quarry★ 1same name
- ScaleDockHQ/scaledock-skills★ 1same name
- anurag-azure/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository350 other files it gives its agents.
- airflowSkill
- catboostSkill
- claudeSkill
- comfyuiSkill
- cursor-aiSkill
- dalleSkill
- daskSkill
- dbtSkill
- deepseekSkill
- fastaiSkill
- geminiSkill
- github-copilotSkill
- huggingfaceSkill
- jaxSkill
- jupyterSkill
- kerasSkill
- langchainSkill
- lightgbmSkill
- llamaindexSkill
- llamaSkill
- matplotlibSkill
- midjourneySkill
- mistralSkill
- mlflowSkill
- nltkSkill
- numpySkill
- ollamaSkill
- openai-gptSkill
- opencvSkill
- pandasSkill
- perplexitySkill
- plotlySkill
- polarsSkill
- pytorchSkill
- raySkill
- scikit-learnSkill
- seabornSkill
- spacySkill
- sparkSkill
- stable-diffusionSkill
- tensorflowSkill
- vaexSkill
- weights-biasesSkill
- whisperSkill
- xgboostSkill
- api-gatewaySkill
- clean-architectureSkill
- cqrsSkill
- domain-driven-designSkill
- event-drivenSkill
- event-sourcingSkill
- graphqlSkill
- grpcSkill
- hexagonalSkill
- microservicesSkill
- modular-monolithSkill
- monolithSkill
- rest-apiSkill
- sagaSkill
- serverlessSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 4 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 113
Use RS256 asymmetric signing with jwks-rsa public key retrieval:
- Distinctive: line 145
Keep Access Token Expiration Brief (5-15 Minutes): Pair short-lived access tokens with secure refresh token rotation to minimize leakage …
- Very specific: line 146
Always Validate iss, aud, and exp Claims: Never verify signature alone.
- Distinctive: line 147
Use Asymmetric RS256 or EdDSA Algorithms: Never use symmetric HS256 for multi-service architectures where sharing secrets is a liability.
- Distinctive: line 152
Put sensitive PII or secrets in the payload: JWT payloads are merely base64 encoded and can be read by anyone with access to the token.
- Distinctive: line 154
Create unbounded token sizes: Keep claims minimal.
“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
JSON Web Token (JWT)
JWT is a compact, URL-safe means of representing claims to be transferred between two parties. The claims are encoded as a JSON object that is used as the payload of a JSON Web Signature (JWS) or JSON Web Encryption (JWE).
When to Use
- Stateless Authorization Tokens: Transmitting verified user identity and permission claims between microservices without database session lookups.
- OAuth 2.0 / OpenID Connect Bearer Tokens: Serving signed access and ID tokens across distributed web and mobile applications.
- Short-Lived Temporary Access Grants: Generating signed, time-limited tokens for password resets, email verification, or file downloads.
- Decoupled Microservice Verification: Allowing independent microservices to verify token signatures locally using shared public keys (JWKS).
Quick Start
Header.Payload.Signature
// Header
{
"alg": "RS256",
"typ": "JWT"
}
// Payload (Claims)
{
"sub": "1234567890", // Subject (User ID)
"name": "John Doe",
"iat": 1516239022, // Issued At
"exp": 1516242622, // Expiration
"role": "admin"
}
// Signature
HMACSHA256(
base64UrlEncode(header) + "." +
base64UrlEncode(payload),
secret)Core Concepts
JWT Structure (Header.Payload.Signature)
A compact, URL-safe base64url-encoded string consisting of three cryptographic segments:
eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiZXhwIjoxNzI3NDIwNDAwfQ.XwG...
───────────────────────────────────── ────────────────────────────────────────────────────────────────────────── ───────
│ │ │
Header Payload Signature
(Algorithm & Token Type) (Registered & Custom Claims) (Cryptographic Proof)Asymmetric RS256 Signing (Private Key Signs, Public Key Verifies)
Authentication servers sign tokens with a private key; downstream microservices verify with the public key:
import jwt from "jsonwebtoken";
import fs from "fs";
const privateKey = fs.readFileSync("private.key");
const publicKey = fs.readFileSync("public.key");
// Sign token (Auth Server)
const token = jwt.sign(
{ sub: "usr_415", role: "admin", orgId: "org_99" },
privateKey,
{
algorithm: "RS256",
expiresIn: "15m",
issuer: "https://auth.example.com",
audience: "https://api.example.com",
},
);
// Verify token (Resource Server / API)
const claims = jwt.verify(token, publicKey, {
algorithms: ["RS256"],
issuer: "https://auth.example.com",
audience: "https://api.example.com",
});JSON Web Key Sets (JWKS) Automated Key Rotation
Resource servers dynamically fetch verified public keys without hardcoding static files:
import { createRemoteJWKSet, jwtVerify } from "jose";
const JWKS = createRemoteJWKSet(
new URL("https://auth.example.com/.well-known/jwks.json"),
);
const { payload } = await jwtVerify(token, JWKS, {
issuer: "https://auth.example.com",
audience: "https://api.example.com",
});Common Patterns
Asymmetric Token Verification with Key Rotation (JWKS)
Problem: Hardcoding symmetric HMAC secrets creates key leakage risks across microservices.
Solution:
Use RS256 asymmetric signing with jwks-rsa public key retrieval:
import jwt from "jsonwebtoken";
import jwksClient from "jwks-rsa";
const client = jwksClient({
jwksUri: "https://auth.example.com/.well-known/jwks.json",
cache: true,
rateLimit: true,
});
function getKey(header, callback) {
client.getSigningKey(header.kid, (err, key) => {
callback(null, key ? key.getPublicKey() : null);
});
}
export function verifyToken(token) {
return new Promise((resolve, reject) => {
jwt.verify(token, getKey, { algorithms: ["RS256"] }, (err, decoded) => {
if (err) reject(err);
else resolve(decoded);
});
});
}Best Practices
Do:
- Keep Access Token Expiration Brief (5-15 Minutes): Pair short-lived access tokens with secure refresh token rotation to minimize leakage windows.
- Always Validate
iss,aud, andexpClaims: Never verify signature alone; ensure the token is targeted for your API and not expired. - Use Asymmetric RS256 or EdDSA Algorithms: Never use symmetric HS256 for multi-service architectures where sharing secrets is a liability.
- Explicitly Whitelist Expected Algorithms: Enforce
algorithms: ['RS256']in verification options to prevent algorithm confusion attacks (noneor HS256).
Don't:
- Put sensitive PII or secrets in the payload: JWT payloads are merely base64 encoded and can be read by anyone with access to the token.
- Store JWTs in browser localStorage: Store auth tokens in HttpOnly, Secure, SameSite cookies to protect against XSS token theft.
- Create unbounded token sizes: Keep claims minimal; large tokens bloat every HTTP header and degrade network latency.
Troubleshooting
| Error | Cause | Solution |
TokenExpiredError | exp time passed. | Refresh the token using a Refresh Token. |
JsonWebTokenError | Malformed or Signature mismatch. | Check secret/public key and token integrity. |
References
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

