Exploiting JWT Token Leads To IDOR
The unsubscribe request carried a JWT whose payload included a user identifier, and the server trusted that identifier without checking it against the authenticated session. An attacker could change the identifier to unsubscribe any other user from marketing emails.
Published on medium.com
Hi, Ajak Amico’s welcome back to another blog today. In this blog, I will show how I found an IDOR vulnerability by exploiting JWT token, this specific attack can unsubscribe users from marketing email without users interaction so Before starting, if you haven’t subscribed to our channel, do subscribe, guys.
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
Root cause
Likely the server trusted the user identifier inside the JWT payload without verifying that the token belonged to the authenticated user making the request.
Impact
An attacker could unsubscribe arbitrary users from marketing emails without their interaction; the report notes the target was hosted by a third party and the issue was out of scope.
What the attacker needed
A newsletter subscription; ability to capture and modify requests
How it was found
- Subscribe to the newsletter and open the unsubscribe link from the email.
- Capture the unsubscribe request in a proxy and note the JWT in it.
- Decode the JWT and change the user identifier in the payload to another value.
- Replace the original token with the modified one and forward the request.
- Observe that the other account is unsubscribed while the attacker's own account is not.
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 a signed piece of data a site gives you after you log in, and it often contains your user ID. Here the site read the user ID from the token but never checked that the token really belonged to the person making the request, so editing the ID let the author act as someone else. This is called an insecure direct object reference (IDOR): using an identifier you were not meant to control to reach another person's data.
What is IDOR?
One user can read or change another user's data, usually by changing an identifier the server trusts without checking who is asking. One of the most paid bug classes on web programs.