PII Leakage via IDOR + Weak PasswordReset = Full Account Takeover
The password reset link validated only the user ID, so an attacker who knew a victim's user ID could reset their password. An IDOR endpoint leaked user IDs and email addresses, enabling enumeration and full account takeover.
Published on medium.com
Hello Hunters, this is a quick write up on one of my recent findings on a bug bounty program. Before jumping into the vulnerability, let us get familiarized with few terms.
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.
Context
The target is a bug bounty program whose name the researcher withholds, referring to it throughout as redacted.com. The feature under test is the standard forgot-password flow at https://redacted.com/forgotpassword, which emails a reset link to the address registered on the account. The report is about what that link contains, how the server validates it, and how a second flaw elsewhere on the site supplies the missing piece needed to abuse it.
Two terms frame the finding. PII, personally identifiable information, is any data that could identify a specific individual, such as a username or user ID, and PII leakage is the exposure of that data. Account takeover is a flaw in the application's logic that lets an attacker take full control of another user's account.
Setup
The researcher tested with an ordinary account of their own. The report does not describe any special role, tooling or version. The only precondition that matters is that the attacker can obtain a reset link for their own account, which any registered user can do, and that they can reach the site's public endpoints.
Finding it
The first observation came from the reset link itself. Requesting a password reset produced a link of this shape:
The link still worked after the password had been changed, which the researcher flags as odd: a reset token that survives the very action it authorises is not being invalidated. Requesting a second reset produced another link:
Comparing the two, the first two path segments differ, the timestamp differs, but the final segment is identical in both links.

Exploitation
Step 1: decode the last segment
The final part of the URL is base64. Decoding it gives:
[redacted]+++588588killer+++588588
Here 588588 is the researcher's own user ID and [redacted] is their own email address. The remaining string, the gibberish-looking asdfghjkl9182737465000, is not explained in the report. The middle timestamp in the path, for example 1597486704, is a Unix timestamp.
Step 2: work out which part the server checks
After experimenting with the link, the researcher found that the server validated only the last part of the URL, the user ID, when processing the password reset:
In other words, knowing a victim's user ID was enough to change that victim's password. The report says only the last part of the URL, the user ID, was validated by the server.
Step 3: find where user IDs leak
The remaining problem was obtaining user IDs. After a couple of days of reconnaissance the researcher found an IDOR in an endpoint referenced from a JavaScript file. The endpoint needed only the userID parameter and returned sensitive information belonging to that ID: username, email address and even residence address.
rand carries the user ID and request is a fixed value in the example. Because the endpoint answers per ID, the researcher could enumerate email addresses for each user ID by brute force. The report notes in passing that user ID 1 belonged to the admin.
Step 4: chain the two flaws
The full sequence, as the researcher summarises it:
- Enumerate the user ID and email address from the endpoint.
- Reset the password using the leaked user ID.
- Log in with the new password.
- Full account takeover.
Root cause
The reset flow trusts a value the attacker controls. The user ID sits in the URL, and the server validated only that part when processing the reset. The email address and the other components of the base64 segment are present but are not what the server checks, so they provide no protection. The link also stayed valid after a successful password change, so a used link keeps working. The IDOR on the verification endpoint then removes the only practical obstacle, the secrecy of the user ID, by returning the email address and other personal data for a given ID.
Impact
An attacker who knows a user ID can change that user's password and log in as them. With the IDOR endpoint, IDs can be enumerated, so the attack can be aimed at any user whose ID is reachable; the report notes that user ID 1 belonged to the admin. Once inside, the researcher notes that the site stored personal information such as bank account number, PAN, Aadhaar card and other sensitive data, which could then be accessed from the victim's account. The report does not give figures for how many accounts were affected.
Fix
The changes the finding calls for are to stop treating the user ID as the authority for a reset, to bind the reset to a server-side token that is invalidated when the password changes, and to require authentication or a proper authorisation check on the verification endpoint so that it returns data only for the requesting user.
Variants to test
- Decode the base64 segments of reset links on other targets and look for a user ID, email or timestamp that the server might accept on its own. A positive result is a link whose final segment can be swapped for another user's ID and still resets the password.
- Reuse a reset link after changing the password. A positive result is the link still working, which points to tokens that are not invalidated.
- Look for endpoints referenced in JavaScript files that take an ID parameter and return profile data. A positive result is another user's username, email or address coming back for an ID you do not own.
- Try low IDs such as 1 on such endpoints. A positive result is an administrative account's data being returned.
What happened, in plain words
A security researcher was testing a website that runs a bug bounty programme. A bug bounty programme is a scheme where a company invites outside people to look for security mistakes in its systems and pays or credits them for reporting what they find. The programme in this report does not allow its name to be disclosed, so the researcher calls it redacted.com throughout.
The feature the researcher looked at is the one almost every website has: the "forgot password" page. You type in your email address, the site sends you an email containing a special link, and clicking that link lets you set a new password. The report is about what is inside that link, how the website's server checks it, and how a second mistake elsewhere on the same site supplied the missing piece needed to abuse the first one.
Two ideas frame the whole finding. The first is PII, short for personally identifiable information: any data that could identify a specific person, such as a username or a user ID. PII leakage means that kind of data is exposed to someone who should not see it. The second is account takeover: a flaw in the way an application is built that lets an attacker take full control of another person's account, in this case by changing their password and logging in as them.
The two ideas behind the finding
Before the technical part, it helps to have a picture of what a password reset link actually is. When you ask a site to reset your password, the site cannot simply believe that whoever clicks the link is you. Anyone could type your email address into the form. So the site puts a secret value, called a token, into the link it emails you. The token is like a cloakroom ticket: the person at the desk hands you a numbered ticket, and when you come back with that ticket you get your coat. The number itself means nothing to anyone else, but the desk recognises it. A reset link works the same way: the long random-looking string in the URL is the ticket, and the server should only accept it from the person who received the email.
A user ID is different. It is just a number the site uses internally to tell accounts apart, like a customer number on a loyalty card. It is not secret in the way a token is, and it should never be enough on its own to prove who you are.
Setting up
The researcher tested with an ordinary account of their own. There was no special role, no special tool and no particular software version involved. The only things needed were the ability to request a reset link for your own account, which any registered user can do, and the ability to reach the site's public pages.
Finding it
The first clue came from the reset link itself. Asking for a password reset produced a link shaped like this:
Reading it piece by piece: https://redacted.com is the site, /forgot_password/ is the page that handles resets, and then come several chunks separated by slashes. The first chunk, 5f12cc7079f273.12051864, looks like a random identifier. The second, 1597479504, is a number. The last chunk is a long string of letters, digits, + signs and = signs, which is the tell-tale look of base64 encoding. Base64 is a way of writing arbitrary data using only ordinary text characters, so that it can travel safely inside a web address.
The researcher noticed something odd: the link still worked after the password had been changed. That matters because a reset link is supposed to be a one-time ticket. Once it has been used to set a new password, it should stop working, otherwise an old email sitting in an inbox remains a key to the account forever.
Requesting a second reset produced another link:
Comparing the two links side by side: the first chunk is different, the number in the middle is different, but the final chunk is exactly the same in both. That is the observation the researcher highlights.

The image shows the two links next to each other, with the point being that the last part of the URL is identical in both.
Working out what the link contains
Step 1: decode the last chunk
The final part of the URL is base64, so it can be decoded back into readable text. Decoding it gives:
[redacted]+++588588killer+++588588
Line by line, in plain words: the string starts with 588588, which is the researcher's own user ID, the internal number the site uses for their account. Next comes [redacted], which is the researcher's own email address. Then comes a run of characters, asdfghjkl9182737465000, that looks like gibberish; the report does not explain what it is. After that, the same user ID and email appear again between +++ separators, and the string ends with the user ID once more.
So the link is not a random secret at all. It is a bundle of information about the account, written in a form that anyone can read by decoding it. The middle number in the URL path, for example 1597486704, is a Unix timestamp: a way of recording a moment in time as a count of seconds since 1 January 1970, which is a common convention on servers.
Step 2: work out which part the server actually checks
After experimenting with the link, the researcher found that when the server processed a password reset, it validated only the last part of the URL, the user ID:
In this snippet the final piece has been replaced with the label [VALIDATED_PART] to mark the spot the server trusts. The practical meaning is stark: knowing a victim's user ID was enough to change that victim's password. The report says only the last part of the URL, the user ID, was validated by the server. The server was treating the user ID as proof of identity, which is like a bank accepting your account number as proof that you are the account holder.
Step 3: find where user IDs leak
The remaining problem was getting hold of other people's user IDs. After a couple of days of reconnaissance, meaning exploratory checking of the site's pages and files, the researcher found an IDOR in an endpoint referenced from a JavaScript file. Two terms need unpacking here.
An endpoint is simply a web address on a server that does something when it is called, rather than showing a normal page. Think of a restaurant: the menu is the website you see, and the kitchen door where orders are handed in is the endpoint. An API is the general name for this arrangement, where one piece of software asks another for data in a structured way.
IDOR stands for Insecure Direct Object Reference. It means the site takes a reference to an object, such as a user ID, straight from the request and hands back the matching data without checking whether the person asking is allowed to see it. The everyday comparison is a hotel where room numbers are written on the keys: if reception will open any room for anyone who says the number out loud, the number is doing the job that a lock should be doing.
A JavaScript file is a file of code that a website sends to your browser to make pages interactive. Such files often contain the addresses the page calls behind the scenes, which is why researchers read them: they reveal endpoints that are not linked anywhere visible.
The endpoint the researcher found needed only the userID parameter and returned sensitive information belonging to that ID: username, email address and even residence address.
Reading this request in plain words: https://redacted.com/razor/verify_email is the endpoint. Everything after the ? is the query string, a set of named values sent along with the request. rand=588588 is a parameter named rand carrying the value 588588, which is the user ID. request=wcq is a second parameter with a fixed value in this example. The & simply separates the two.
Because the endpoint answers per ID, the researcher could enumerate email addresses for each user ID by brute force. Enumerating means walking through a list of values one after another, and brute force means trying many values systematically rather than cleverly. If the endpoint returns a different answer for each ID, then asking for ID 1, then 2, then 3 and so on eventually maps out the accounts. The report notes in passing that user ID 1 belonged to the admin, the account with the most power on the site.
Step 4: chain the two flaws
The full sequence, as the researcher summarises it:
- Enumerate the user ID and email address from the endpoint.
- Reset the password using the leaked user ID.
- Log in with the new password.
- Full account takeover.
Each step depends on the one before. The endpoint supplies the ID, the reset flow accepts the ID as authority, and the new password gives access. Neither flaw alone would be enough: the reset flow needs an ID to aim at, and the endpoint needs a way to turn an ID into a working attack.
Why it worked
The reset flow trusts a value the attacker controls. The user ID sits in the URL, and the server validated only that part when processing the reset. The email address and the other components of the base64 chunk are present but are not what the server checks, so they provide no protection at all. The link also stayed valid after a successful password change, so a used link keeps working.
The IDOR on the verification endpoint then removes the only practical obstacle, which is the secrecy of the user ID, by returning the email address and other personal data for a given ID.
What an attacker could do
An attacker who knows a user ID can change that user's password and log in as them. With the IDOR endpoint, IDs can be enumerated, so the attack can be aimed at any user whose ID is reachable; the report notes that user ID 1 belonged to the admin. Once inside, the researcher notes that the site stored personal information such as bank account number, PAN, Aadhaar card and other sensitive data, which could then be accessed from the victim's account. The report does not give figures for how many accounts were affected.
How to fix it
The changes the finding calls for are to stop treating the user ID as the authority for a reset, to bind the reset to a server-side token that is invalidated when the password changes, and to require authentication or a proper authorisation check on the verification endpoint so that it returns data only for the requesting user.
Things worth trying on other sites
- Decode the base64 segments of reset links on other targets and look for a user ID, email or timestamp that the server might accept on its own. A positive result is a link whose final segment can be swapped for another user's ID and still resets the password.
- Reuse a reset link after changing the password. A positive result is the link still working, which points to tokens that are not invalidated.
- Look for endpoints referenced in JavaScript files that take an ID parameter and return profile data. A positive result is another user's username, email or address coming back for an ID you do not own.
- Try low IDs such as 1 on such endpoints. A positive result is an administrative account's data being returned.
Glossary
- Bug bounty programme: a scheme where a company invites outside researchers to find security flaws and rewards them for reporting them.
- PII (personally identifiable information): any data that could identify a specific person, such as a username or user ID.
- PII leakage: the exposure of personally identifiable information to someone who should not see it.
- Account takeover: a flaw that lets an attacker take full control of another person's account.
- Forgot-password flow: the feature where a site emails a link that lets you set a new password.
- Token: a secret value, usually a long random string, that a site uses to recognise that a request comes from the person it was issued to.
- User ID: the internal number a site uses to tell accounts apart.
- Base64: a way of writing arbitrary data using ordinary text characters so it can travel inside a web address; it is encoding, not encryption, and anyone can decode it.
- Unix timestamp: a moment in time recorded as the number of seconds since 1 January 1970.
- Endpoint: a web address on a server that does something when it is called, rather than showing a normal page.
- API: the general arrangement where one piece of software asks another for data in a structured way.
- Parameter: a named value sent along with a request, usually after the
?in a URL. - Query string: the part of a URL after the
?that carries parameters. - JavaScript file: a file of code a website sends to your browser to make pages interactive; it often reveals endpoints the page calls.
- IDOR (Insecure Direct Object Reference): a flaw where a site takes a reference such as a user ID straight from the request and returns the matching data without checking whether the requester is allowed to see it.
- Reconnaissance: exploratory checking of a site's pages and files to learn how it is built.
- Enumerate: to walk through a list of values one after another to map out what exists.
- Brute force: trying many values systematically rather than cleverly.
- Admin: the account with the most power on a site.