Skip to content
Account takeover Write-up Intermediate

How I (Ethically) Hacked My College Portal with a JWT Token —

The student portal used a hardcoded, weak secret key to sign JSON Web Tokens (JWTs), allowing anyone who guessed the key to forge tokens and impersonate any user, including students, faculty, and possibly administrators. The author demonstrated this by brute-forcing the key and creating a forged token that granted access to another account.

Tamilselvan A K Follow

Published on medium.com

👋 Hey readers, I’m Tamilselvan A K, a 2nd-year student in AI & DS at Rajalakshmi Engineering College and an aspiring ethical hacker. This is the story of how I discovered a serious JWT vulnerability in our college’s student portal — even though it wasn’t intended for security testing — and how I responsibly disclosed…

Tamilselvan A K, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Impact

An attacker could forge tokens to impersonate any user, leading to account takeovers, access to private academic records, and potential privilege escalation including administrator impersonation.

What the attacker needed

Access to the portal; ability to intercept HTTP traffic; knowledge of JWT structure

The fix

The issue was fixed by using a strong, random secret key stored securely, as the team acknowledged using development secrets and confirmed it was fixed.

How it was found

  1. Log in using own credentials.
  2. Intercept the HTTP request using Burp Suite.
  3. Copy the JWT token from the request cookie.
  4. Decode the token via jwt.io.
  5. Run a brute-force attack using a Python script to guess the secret key.
  6. Successfully identify the key: 'secret'.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A JSON Web Token (JWT) is like a digital ID card that a website gives you after you log in. The website signs it with a secret key so it can check later that the card is real. If that secret key is easy to guess, anyone can make a fake ID card and pretend to be someone else.

What is Account takeover?

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.

More by Tamilselvan A K

View all

1 more disclosed report, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Account takeover

The lesson behind this report.

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.