jwt-library-flaws

Detect implementation vulnerabilities in JWT library verification logic during code review.

Updated Jan 21, 2019
One-click install
npx skills add https://github.com/jtdowney/dotfiles --skill jwt-library-flaws
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: jwt-library-flaws
Source: https://github.com/jtdowney/dotfiles/tree/main/dot_claude/skills/jwt-library-flaws
Command: npx skills add https://github.com/jtdowney/dotfiles --skill jwt-library-flaws

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps identify and prevent critical security vulnerabilities within the implementation of JSON Web Token (JWT) libraries themselves, rather than just how they are used.

Core Features & Use Cases

  • Vulnerability Detection: Pinpoints common flaws in JWT verification logic, such as algorithm confusion, improper handling of the 'none' algorithm, and insecure key management.
  • Code Review Aid: Assists developers and security auditors in systematically checking JWT library code for known weaknesses.
  • Use Case: When reviewing a new authentication library that uses JWTs, use this Skill to ensure its token verification logic is robust against common bypass techniques.

Quick Start

Analyze the provided JWT library code for implementation flaws.

Frequently Asked Questions about jwt-library-flaws

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check JWT libraries for algorithm confusion vulnerabilities during code review?

To check JWT libraries for algorithm confusion vulnerabilities during code review, analyze the token verification logic to ensure the server strictly enforces the expected algorithm, preventing attackers from swapping RS256 tokens for HS256 to forge signatures using public keys.

What is the 'none' algorithm bypass in JWT authentication and how do I prevent it?

The 'none' algorithm bypass in JWT authentication allows attackers to bypass signature validation by setting the algorithm to 'none'. Prevent this flaw by ensuring the JWT library explicitly rejects unsigned tokens and enforces strict algorithm selection.

How do I audit JWT verification logic for insecure key management flaws?

Audit JWT verification logic for insecure key management flaws by reviewing how key IDs (kid) are handled, ensuring attackers cannot manipulate header parameters to point verification to insecure keys or traverse file systems.

What are common JWT signature validation vulnerabilities to look for in security audits?

Common JWT signature validation vulnerabilities to look for in security audits include algorithm confusion, bypassing the 'none' algorithm, and improper key management, all of which allow attackers to forge tokens and bypass authentication.

Can I use this approach to review authentication code for any new JWT library implementation?

Yes, you can use this approach to review authentication code for any new JWT library implementation, applying a comprehensive checklist to systematically evaluate verification logic, algorithm handling, and cryptography for known weaknesses.