JWT Attacks: A Comprehensive Analysis of JSON Web Token Vulnerabilities

Added:

OAuth Basics
JWT Usage
Common Attacks
Signature Validation
Bypass Attack
Issuer Validation
Expiry Bypass

OAuth Basics

4:04
Playing Section
  • 1

    Explains OAuth using a toy box analogy with friends and adults.

  • 2

    Tokens are issued by a trusted party for resource access.

The fundamental structure of JSON Web Tokens (JWTs), including the distinct roles of the Header, Payload, and Signature components.
Basic cryptographic principles, specifically the difference between symmetric signing (such as HMAC) and asymmetric signing (such as RSA/ECDSA).
The mechanics of stateless authentication and session management in modern web applications.
Data encoding schemes commonly used in web technologies, specifically Base64 and Base64URL encoding.
Advanced JWT exploitation techniques, including Key ID (kid) path traversal, JWKS (JSON Web Key Set) spoofing, and JKU header injection.
Implementing secure token lifecycle management, including token revocation strategies (e.g., blocklists, refresh token rotation) and secure client-side storage.
Applying JWTs securely within enterprise federation protocols such as OAuth 2.0 and OpenID Connect (OIDC).
Automating JWT security assessments using penetration testing tools like Burp Suite extensions (JWT Editor) and specialized command-line tools like jwt_tool.
247 views7likes34:58@bsidestampaOriginal Release: 2024-05-08

JSON Web Tokens (JWTs) are widely used for authentication and session management but are vulnerable to several high-severity attacks when improperly implemented. The four primary vulnerabilities include: (1) Unvalidated signatures, which allow attackers to tamper with tokens and impersonate users or escalate privileges; (2) Unvalidated issuer claims, which enable attackers to use tokens from unauthorized issuers; (3) Expiration validation bypasses, which allow replay of expired tokens indefinitely; and (4) Lack of audience validation, which permits tokens intended for one service to access other services. These vulnerabilities fall under the OWASP category of broken authentication and are typically implementation failures that can be fixed by using established JWT libraries, enabling proper validation checks, and avoiding custom authentication implementations.