InfoSec Write-ups

A collection of write-ups from the best hackers in the world on topics ranging from bug bounties and CTFs to vulnhub machines, hardware challenges and real life encounters. Subscribe to our weekly newsletter for the coolest infosec updates: https://weekly.infosecwriteups.com/

Follow publication

JWT (JSON Web Token) Security Risks: Common Vulnerabilities and Exploits Every Bug Hunter Should Know

Ever wondered how web apps authenticate users without storing sessions?

Elie Attieh
InfoSec Write-ups
Published in
4 min read6 days ago

--

Welcome to the realm of JSON Web Tokens (JWTs), a crucial component of secure authentication, API interactions, and modern web security. Whether you’re a developer, a penetration tester, or simply eager to understand token-based authentication, this guide will provide a clear and comprehensive breakdown.

What is a JWT?

A JSON Web Token (JWT) is a lightweight, self-contained token designed for securely exchanging information between parties in JSON format. Unlike traditional session-based authentication, JWTs enable stateless authentication, offering scalability, efficiency, and broad adoption in modern applications.

Structure of a JWT

A JWT is composed of three components, all Base64-encoded and separated by dots (.):

Header: Specifies the signing algorithm and token type.
Payload: Contains claims (user information, expiration, etc.).
Signature: Ensures the token’s integrity, stopping tampering.

Example of a JWT:

A real JWT looks like this:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.

eyJ1c2VySWQiOiIxMjM0NTY3ODkwIiwidXNlcm5hbWUiOiJqb2huZG9lIn0.

SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c

Why is JWT So Famous?

Stateless Authentication — No need for server-side sessions.
Compact & Fast — Ideal for mobile & web apps.
Secure Data Transmission — Encrypted & tamper-proof with signatures.
Cross-Domain Authentication — Perfect for APIs & Single Sign-On (SSO).

Bug Bounty & Penetration Testing: JWT Attacks

--

--

Published in InfoSec Write-ups

A collection of write-ups from the best hackers in the world on topics ranging from bug bounties and CTFs to vulnhub machines, hardware challenges and real life encounters. Subscribe to our weekly newsletter for the coolest infosec updates: https://weekly.infosecwriteups.com/

Written by Elie Attieh

Cyber Security Engineer | Microsoft Cloud Security | Penetration Tester | Intune | Vulnerability Assessment | Threat Intelligence | Microsoft Sentinel | SOC |

No responses yet