Medium severityJavaScript / TypeScriptAuthentication & SecretsMEDIUM confidence
JWT Decode Without Verify
jwt.decode() does not verify the token signature; using its output for authorization decisions lets attackers forge claims.
Standards mapping
- OWASP Top 10
- A02:2021 - Cryptographic Failures
- OWASP ASVS
- V3.5.3 (L1)
Vulnerable vs. safe
Flagged by this check
const claims = jwt.decode(token);Passes - the safe pattern
const verified = jwt.verify(token, secret, { algorithms: ["HS256"] });Why it matters & how to fix it
jwt.decode() does not verify the token signature; using its output for authorization decisions lets attackers forge claims. Use jwt.verify() with the signing key and explicit allowed algorithms.
References
Rule ID integsec-js-jwt-decode-without-verify - engine: Opengrep - license: MIT - Copyright (c) IntegSec Inc.
TurboPentest runs this check automatically
Connect a GitHub repo and this check runs on every white-box pentest - AI-validated and reported with proof, from $99 per target.
Start a pentestRelated checks
- JavaScript / TypeScript - Authentication & SecretsHardcoded JWT Secret
- JavaScript / TypeScript - Authentication & SecretsHardcoded Secret
- JavaScript / TypeScript - Authentication & SecretsInsecure Cookie Flags
- JavaScript / TypeScript - Authentication & SecretsJWT Algorithm None
- JavaScript / TypeScript - Authentication & SecretsTLS Verification Disabled
- Python - Authentication & SecretsDjango Hardcoded Secret Key