ESLint InterlaceESLint Interlace
Plugin: jwt

Overview

JSON Web Token security patterns and validation rules

Live from GitHub

This content is fetched directly from README.md on GitHub and cached for 1 hour.

AI-Optimized Security

Every rule includes CWE, OWASP, and CVSS metadata for AI assistants to provide precise, context-aware fixes.


ESLint Interlace Logo

Security validation for JSON Web Tokens (JWT) implementation (signing, verification).

NPM VersionNPM DownloadsPackage LicenseCodecovSince Dec 2025

Description

This plugin provides Security validation for JSON Web Tokens (JWT) implementation (signing, verification). By using this plugin, you can proactively identify and mitigate security risks across your entire codebase.

Philosophy

Interlace fosters strength through integration. Instead of stacking isolated rules, we interlace security directly into your workflow to create a resilient fabric of code. We believe tools should guide rather than gatekeep, providing educational feedback that strengthens the developer with every interaction.

Getting Started

npm install eslint-plugin-jwt --save-dev

๐Ÿ’ก What You Get

  • 13 Security Rules - Algorithm attacks, replay prevention, claim validation
  • 6 JWT Libraries - jsonwebtoken, jose, express-jwt, @nestjs/jwt, jwks-rsa, jwt-decode
  • 2025 Research - "Back to the Future" replay attack prevention (LightSEC 2025)
  • AI-Optimized - Structured messages for GitHub Copilot, Cursor, Claude assistance
  • CWE References - Every rule maps to Common Weakness Enumeration

โš™๏ธ Configuration Presets

PresetDescription
recommendedRecommended preset - balanced security
strictStrict preset - maximum security (includes 2025 research)
legacyLegacy preset - migration mode
allAll rules preset

๐Ÿ“š Supported Libraries

LibrarynpmDownloadsDetection
jsonwebtokenSigning, Verification, Decoding
joseVerification (Fix Suggestion)
jwt-decodeUnsafe Decoding

๐Ÿค– AI-Optimized Messages

Every rule uses formatLLMMessage for structured output:

๐Ÿ”’ CWE-347 OWASP:A02-Crypto CVSS:9.8 | Using alg:"none" bypasses signature verification
   Fix: Remove "none" and use RS256, ES256, or other secure algorithms
   https://nvd.nist.gov/vuln/detail/CVE-2022-23540

By providing this structured context (CWE, OWASP, Fix), we enable AI tools to reason about the security flaw rather than hallucinating. This allows Copilot/Cursor to suggest the exact correct fix immediately.

By structuring errors with specific CWE codes, OWASP categories, and direct fix suggestions, this format allows AI coding assistants to autonomously identify, explain, and resolve security vulnerabilities with high confidence.

Rules

Legend

IconDescription
๐Ÿ’ผRecommended: Included in the recommended preset.
โš ๏ธWarns: Set towarn in recommended preset.
๐Ÿ”งAuto-fixable: Automatically fixable by the --fix CLI option.
๐Ÿ’กSuggestions: Providing code suggestions in IDE.
๐ŸšซDeprecated: This rule is deprecated.
RuleCWEOWASPCVSSDescription๐Ÿ’ผโš ๏ธ๐Ÿ”ง๐Ÿ’ก๐Ÿšซ
no-algorithm-confusionCWE-347A02:20259.8ESLint rule documentation for no-algorithm-confusion๐Ÿ’ผ๐Ÿ’ก
no-algorithm-noneCWE-347A02:20259.8ESLint rule documentation for no-algorithm-none๐Ÿ’ผ๐Ÿ’ก
no-decode-without-verifyCWE-345A08:20257.5ESLint rule documentation for no-decode-without-verify๐Ÿ’ผโš ๏ธ๐Ÿ’ก
no-hardcoded-secretCWE-798A05:20257.9ESLint rule documentation for no-hardcoded-secret๐Ÿ’ผ๐Ÿ’ก
no-sensitive-payloadCWE-359A01:20255.3ESLint rule documentation for no-sensitive-payload๐Ÿ’ผโš ๏ธ๐Ÿ’ก
no-timestamp-manipulationCWE-294A05:20257.5ESLint rule documentation for no-timestamp-manipulation๐Ÿ’ผ๐Ÿ’ก
no-weak-secretCWE-326A02:20257.5ESLint rule documentation for no-weak-secret๐Ÿ’ผ๐Ÿ’ก
require-algorithm-whitelistCWE-757A02:20257.5ESLint rule documentation for require-algorithm-whitelist๐Ÿ’ผโš ๏ธ๐Ÿ’ก
require-audience-validationCWE-287A07:20255.3ESLint rule documentation for require-audience-validation๐Ÿ’ก
require-expirationCWE-613A04:20255.3ESLint rule documentation for require-expiration๐Ÿ’ผโš ๏ธ๐Ÿ’ก
require-issued-atCWE-294A04:20255.3ESLint rule documentation for require-issued-at๐Ÿ’ก
require-issuer-validationCWE-287A07:20255.3ESLint rule documentation for require-issuer-validation๐Ÿ’ก
require-max-ageCWE-294A04:20255.3ESLint rule documentation for require-max-age๐Ÿ’ก

Part of the Interlace ESLint Ecosystem โ€” AI-native security plugins with LLM-optimized error messages:

PluginDownloadsDescription
eslint-plugin-secure-codingGeneral security rules & OWASP guidelines.
eslint-plugin-pgPostgreSQL security & best practices.
eslint-plugin-cryptoNodeJS Cryptography security rules.
eslint-plugin-jwtJWT security & best practices.
eslint-plugin-browser-securityBrowser-specific security & XSS prevention.
eslint-plugin-express-securityExpress.js security hardening rules.
eslint-plugin-lambda-securityAWS Lambda security best practices.
eslint-plugin-nestjs-securityNestJS security rules & patterns.
eslint-plugin-mongodb-securityMongoDB security best practices.
eslint-plugin-vercel-ai-securityVercel AI SDK security hardening.
eslint-plugin-import-nextNext-gen import sorting & architecture.

๐Ÿ“„ License

MIT ยฉ Ofri Peretz

ESLint Interlace Plugin

View README.md on GitHub โ†’

On this page

No Headings