๐Ÿ” OWASP Top 10 Lab โ€” JWT Authentication Bypass

Category: A07: Identification and Authentication Failures

๐Ÿง  Vulnerability Type

๐ŸŽฏ Objective

Demonstrate authentication bypass by forging a JWT token using a disabled signature algorithm and escalating privileges to an administrative role.

๐Ÿ›  Lab Environment

๐Ÿ‘ฃ Steps to Reproduce

  1. Login and capture JWT token.
  2. Decode token header and payload.
  3. Modify header:
"alg": "none"
  1. Modify payload:
"role": "admin"
  1. Rebuild JWT without signature.
  2. Send forged token in Authorization header.

๐Ÿ’ฅ Impact

๐Ÿงช Proof of Concept

The application accepted a forged unsigned token, granting elevated privileges without server-side signature validation.

Original JWT Response

Original JWT Response

Original JWT Token

Original JWT Token

Modified JWT Token

Modified JWT Token

Modified JWT Response

Modified JWT Response

๐Ÿ›ก Mitigation

๐Ÿง  Key Learning

Never trust client-controlled authentication tokens without strict signature verification. Weak JWT validation can completely undermine authentication systems.

๐Ÿบ Personal Note

This lab demonstrates how subtle token validation flaws can lead to complete authentication compromise. JWT misconfigurations remain a common and high-impact bug bounty finding.