agentleFS
awarexoneawarexone/AXguard/jwt-security/SKILL.md

jwt-security

Skill18 starsChanged 3 months agoMITView on GitHub

Analyze JWT implementation flaws — use when reviewing alg confusion, none algorithm, missing verify, weak secrets, or claim validation gaps (A07:2021 / API2:2023 / auth.jwt rules).

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    After AXguard hits auth.jwt-none-algorithm, auth.jwt-decode-without-verify, or weak HMAC secrets.

    line 42
  2. Distinctive:

    Ensure clock skew windows are reasonable.

    line 70
  3. Distinctive:

    Verify/decode call site

    line 74
  4. Distinctive:

    Test keys clearly not used in production configs

    line 82
  5. Distinctive:

    Always verify with allowlisted algorithms and keyed material from a secrets manager/JWKS.

    line 86
  6. Distinctive:

    Do not put sensitive PII in JWT bodies unless necessary.

    line 89

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

JWT Security

Purpose

Encode defensive analysis of JSON Web Tokens: signature verification, algorithm handling, claim validation, and secret/key management mistakes that enable impersonation.

When to Use / When Not to Use

Use when:

  • APIs accept JWTs (access/refresh/ID tokens), custom jose usage, or jwt.decode without verify.
  • After AXguard hits auth.jwt-none-algorithm, auth.jwt-decode-without-verify, or weak HMAC secrets.

Do not use when:

  • Opaque server-side session IDs only (session-security).
  • Full OAuth/OIDC protocol issues beyond JWT crypto (pair with oauth-security).

Security Concepts

JWTs are client-held assertions. Verify signature with an allowlisted algorithm before trusting claims. alg=none, RS↔HS confusion, and decode without verify are classic failures. Claims (exp, nbf, aud, iss, sub) must be enforced explicitly.

Threat Model

Attacker goals:

  1. Forge tokens (none alg, weak secret, key confusion).
  2. Reuse tokens outside intended audience/issuer.
  3. Privilege escalation via mutable claims trusted from token without server check.
  4. Persist access via non-rotating refresh tokens.

Analysis Workflow

  1. Find JWT create/verify call sites and libraries.
  2. Confirm verification is mandatory on every trust decision; ban decode-only auth.
  3. Allowlist algorithms (e.g., RS256/ES256); reject none; never select alg from header alone unchecked.
  4. Assess secret strength for HMAC; prefer asymmetric keys with proper rotation (JWKS).
  5. Validate exp/nbf/aud/iss/sub; treat role claims as hints only unless issuer is trusted and authZ still applied.
  6. Review refresh token storage, rotation, and revocation.
  7. Ensure clock skew windows are reasonable; log verify failures.

Evidence Requirements

  • Verify/decode call site
  • Missing verification, alg weakness, or claim gap
  • Impact: impersonation / privilege escalation

False Positive Controls

  • Display-only decode of already-verified tokens
  • Internal tools using JWT with strong secrets and full verify (still review claim authZ)
  • Test keys clearly not used in production configs

Remediation

  1. Always verify with allowlisted algorithms and keyed material from a secrets manager/JWKS.
  2. Enforce standard claims; keep tokens short-lived.
  3. Rotate and revoke refresh tokens; bind to client where appropriate.
  4. Do not put sensitive PII in JWT bodies unless necessary; assume readable.
  5. Centralize token validation middleware.

Verification

Find JWT sinks → Enforce verify+alg allowlist+claims → Re-run axguard → Confirm none/decode-only paths gone

Related Skills

  • authentication-analysis, oauth-security, authorization-analysis
  • session-security, api-security
  • security-triage, security-remediation

Framework Mapping

  • CWE-287
  • OWASP A07:2021
  • OWASP API2:2023 Broken Authentication

References

Research Provenance

Primary sources:

  • OWASP A07:2021; OWASP API2:2023; CWE-287 (accessed 2026-09-15)

Secondary / internal:

  • AXGuard rules/auth.json, rules/advanced.json JWT patterns, /axguard-auth
  • AwareXone Agentic-Bug-Hunter JWT methodology (concepts only; not copied)

Datasets:

  • UVID HF dataset — category linkage concepts only (MIT license metadata review 2026-09-15)

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.