Code & Engineering

JWT Verification Review

Reviews ONE piece of code that verifies JSON Web Tokens for the five mistakes that let a forged or stale token in, and lists only those, one line each with a fixed code, the function, why it hurts and the fix - or exactly No findings. It catches an algorithm taken from the token header or no fixed algorithm list, an expiry check switched off, neither audience nor issuer checked, a payload read with decode where verify is needed, and a signing secret written into the source. It leaves out the safe look-alikes, such as an algorithm list fixed in the verify call, an audience compared in a second step, and a decode that only reads the key id. Use to review login middleware, to audit token handling in a service, or to check an API before release.

JWT Verification Review is a tested SKILL.md that reviews ONE piece of code that verifies JSON Web Tokens for the five mistakes that let a forged or stale token in, and lists only those, one line each with a fixed code, the function, why it hurts and the fix - or exactly No findings; an agent buys it once for $0.01 over x402.

Tested 2026-10-26No code, no hidden instructionsv1.0.0 · 6.6 KB · perpetual license

Not for

OAuth redirect flows, session cookies that are not tokens, key rotation schedules, token storage in the browser and the internals of a library. It reads one piece of pasted verification code and judges only what is written in it.

Tested, honestly

Tested 2026-10-26 with a strong and a weak model.

SonnetStrong model, claude-sonnet-5-5
Right on all 3 cases, read by hand. On the orders middleware it found the expiry check switched off and the secret typed into the source, and left out the algorithm list fixed to one name and the audience compared in a second step. On the session reader it found the algorithm taken from the token header and the admin decision read with decode, and left out the header read for the key id and the audience and issuer already passed to verify. On the clean billing verifier it answered exactly No findings.
HaikuWeak model, claude-haiku-5-5
Right on all 3 cases, read by hand. It matched the strong model on both planted modules, with sound fixes, and kept every safe look-alike out of its list: the fixed algorithm list, the second-step audience check, the key-id read and the key loaded from a file. On the clean verifier it answered exactly No findings.

Full test summary

Example

Our own test text, before and after the skill ran. Excerpts only.

English · claude-sonnet-5-5

Before

const jwt = require('jsonwebtoken'); const SECRET = 'k9Zp2-vQx7mL4tRw-81fd30'; function requireAuth(req, res, next) { const token = (req.headers.authorization || '').replace('Bearer ', ''); try { const claims = jwt.verify(token, SECRET, { algorithms: ['HS256'], ignoreExpiration: true, }); if (claims.aud !== 'orders-api') { return res.sendStatus(403); }…

After

NO-EXP-CHECK — requireAuth, `ignoreExpiration: true` — the expiry check is switched off, so a stolen or old token stays valid forever — remove the option so `exp` is enforced HARDCODED-SECRET — requireAuth, `const SECRET = 'k9Zp2-vQx7mL4tRw-81fd30'` — the signing secret is in the source and in version control, so anyone with the code can forge tokens — read it from the environment or a secret…

What is in the file

  • What the standards say, as published on 26 October 2026
  • The answer
  • The codes
  • Rules
  • Work in this order
  • Short example

Languages

English. Tried in: English.

License

Perpetual, non-exclusive; use and modify for yourself incl. paid work; no resale or republishing. Holder: Georgi Kalchev, aiskills402.com. Full terms.

Versions

Current version 1.0.0, updated 2026-10-26. Whoever bought an earlier version gets new ones free through the same re-download token.

  1. v1.0.0 · 2026-10-26

    First release, written in the light-test batch of 26 October 2026 (three cases, price $0.01). The idea is ours; no foreign skill was opened, facts come from public documentation (see notes/ideas.md). Output: see the skill description.

    Test: three cases written by hand (two planted, each with a safe look-alike, one clean control), one run on Claude Sonnet and one on Claude Haiku, no run without the skill, no iteration on the skill rules after the runs. `test/control.mjs` shows that the checks pass on the ideal answers and fail on realistic wrong ones. See `test-summary.json` for the verdicts read by hand.

    One wording change after the runs: the reason on the last line of the short example was reworded so that no sentence of SKILL.md repeats in the public example; rules and codes are unchanged, no re-run.

FAQ

Algorithm list fixed to one name: reported?

No. A fixed list in the verify call is the accepted form, whichever algorithm it names. The line is for a list taken back from the token header, for allowing none, or for a call that gives no list at all.

Audience compared by hand after verify: reported?

No. Comparing the claim in a second step counts as checking it, and one of audience or issuer is enough. The line appears only when neither is compared anywhere in the code.

What code went into the test?

Three small Node modules of our own. An orders middleware with a literal secret and expiry ignored, a session reader that trusts the header for the algorithm and uses decode to find admins, and a billing verifier that is correct. Claude Sonnet and Claude Haiku each reviewed every module once.

What does a sound verifier return?

Just the sentence No findings., nothing around it. A real problem arrives as its own line carrying a code, a function name, what goes wrong and how to repair it. The skill does not list what it looked at and approved.

Share

Read this page as Markdown: /skills/jwt-verification-review.md.

More in Code & Engineering

  • Terraform Plan Risk Review

    Code & Engineering

    SKILL.md · v1.0.0 · 6.2 KB

    Reviews the text of ONE terraform plan for the four changes that can lose data or open a door, and lists only those, one line each with a fixed code, the resource, why it hurts and the fix - or exactly No findings. It catches a database, bucket or disk that the plan destroys or replaces, an ingress rule open to the whole internet on a port other than web, encryption switched off, and a rebuild forced only because an id changes upstream. It leaves out the safe look-alikes, such as a tag changed in place, a stateless server replaced because of a new image, and a web port open to the world. Use to read a plan before terraform apply, to review a pull request that shows plan output, or to check what a change will destroy.

    $0.01once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 26 Oct 2026

  • Kubernetes Manifest Review

    Code & Engineering

    SKILL.md · v1.0.0 · 6.4 KB

    Reviews ONE Kubernetes Pod or Deployment manifest for the five settings that most often make a workload unsafe or unpredictable, and lists only those, one line each with a fixed code, the container or volume, why it hurts and the fix - or exactly No findings. It catches a container that is privileged or may run as root, an image with no tag or the latest tag, a container with no memory limit, a secret value written as a literal in env, and a hostPath volume. It leaves out the safe look-alikes, such as a pod that sets runAsNonRoot, an image pinned by digest, a read-only configMap volume and a secret read through secretKeyRef. Use to review a manifest before it is applied, to audit a repository of deployments, or to check a Pod that keeps being killed.

    $0.01once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 26 Oct 2026

  • CORS Config Review

    Code & Engineering

    SKILL.md · v1.0.0 · 6.2 KB

    Reviews CORS code or server configuration (an Express or Flask handler, an nginx block, a framework setting) for the five mistakes that let a hostile web page read private responses, and lists only those, one line each with a fixed code, the place, why it is dangerous and the fix - or exactly No findings. It catches a request Origin copied into the allow header while cookies are allowed, a wildcard origin together with credentials, the null origin allowed, an origin check by suffix, substring or an unanchored pattern, and a per-origin allow header sent without Vary Origin. It leaves out the safe look-alikes, such as an exact allow-list with credentials and a public read-only API that answers with a wildcard and no credentials. Use to review CORS code before release, to audit a gateway config, or to debug a browser CORS error that looks like a server mistake.

    $0.01once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 19 Oct 2026

  • IAM Policy Review

    Code & Engineering

    SKILL.md · v1.0.0 · 6.2 KB

    Reviews ONE AWS IAM policy (an identity policy, or a bucket policy) written as JSON for the five grants that hand out far more than a job needs, and lists only those, one line each with a fixed code, the statement, why it is dangerous and the fix - or exactly No findings. It catches every action on every resource or a whole service on every resource, iam:PassRole on any role, Allow combined with NotAction, a public principal with no condition, and actions that let a holder raise their own rights such as creating a policy version or attaching a policy. It leaves out the safe look-alikes, such as a public principal narrowed to an organization, read-only access to one bucket, and a Deny with NotAction. Use to review a policy before attaching it, to audit a role, or to check a bucket policy for public access.

    $0.01once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 19 Oct 2026