Any Account Takeover Through Privilege Escalation
An API endpoint intended for admins was accessible to lower-privileged users and disclosed password reset tokens, salts, and invitation tokens. A lower-privileged user could use an admin's reset token to change the admin's password and take over the account.
Published on shubhamchaskar.com
I have already shared one of the write-up on Privilege Escalation on Facebook’s product! If you haven’t read that yet you can check here.
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 was a product the researcher had been testing for a long time and considered one of his favourites. The report does not name the product or the program. The feature at the centre of the bug is an API endpoint that returns account data, including password reset tokens, salts and invitation tokens. According to the researcher, that endpoint was only meant to be available to an admin user.
The write-up is framed around a broader point: revisiting an old target pays off because new features are added regularly and can be missed by other testers. The researcher found the new feature through the product's newsletter, which announced newly added functionality.
Setup
The researcher used two accounts within the same organisation:
- An admin account, which was the account he held when he first found the endpoint.
- A lower privileged user account, used to test whether the endpoint enforced its intended restriction.
No specific tools, versions or request-capturing setup are described beyond logging in with each account and sending GET requests to the same API, and later capturing a password reset request.
Finding it
After receiving the newsletter email describing the newly added features, the researcher tested them. He noticed that one endpoint was disclosing a password reset token, a salt and an invitation token. That endpoint was intended to be reachable only by an admin user.
Because he was an admin at the time, the disclosure alone did not show a privilege boundary being crossed, so he tested the same API with the lower privileged account.
Exploitation
Step 1: Request the endpoint as a low privileged user
Logged in as the lower privileged user, he sent the same GET request to the API that the admin account used. The response returned the password reset token of an admin user to the lower privileged account.

The image shows a lower privileged user receiving the password reset token of an admin user.
A user ID is an MD5 hash that is accessible to everyone from the employees section, so the identifier needed to target an account is not secret. The response therefore handed the low privileged user the reset token for an admin, and the identifier needed to target an account is not secret.
Step 2: Use the leaked token to reset the admin password
With the admin's reset token in hand, the next step was to change the admin password and take over the account. He went to the forgot password page and requested a token for his own lower privileged (attacker) account. After receiving the password reset link, he captured the request and replaced the token with the admin's leaked token, then submitted a new admin password.
The request was successful and he took over the admin account. The same technique worked against any account in the same organisation.

The image shows the successful request that resulted in the admin account takeover.
He notes that it could have been a disaster if a cross-organisation account takeover had been possible; in this case the takeover was limited to accounts of the same organisation.

The researcher credits the newsletter subscription as the reason he found the bug, and says he notified the team as soon as he confirmed the issue.
Timeline
| Time (IST) | Event |
|---|---|
| 09 Nov 2020 00:51:03 | Bug reported |
| 10 Nov 2020 18:39:41 | Bug triaged |
| 12 Nov 2020 22:05:46 | Something good happened |
| 24 Feb 2021 08:26:54 | Bug patched |
Root cause
The endpoint that returns password reset tokens, salts and invitation tokens was intended for admin users only, but it did not enforce that restriction: a lower privileged user sending the same GET request received the same sensitive data. The report does not describe the server-side check that was missing or how authorisation was implemented, so the exact mistake in the code is not stated.
The second half of the chain is the reset flow itself: the token issued to one account could be submitted in place of another account's token, so possession of a leaked token was enough to set a new password.
Impact
Any lower privileged user could take over an admin account and any other normal user account within the same organisation. The researcher explicitly limits the impact to the same organisation: a cross-organisation takeover was not possible in his testing.
Fix
The report states only that the bug was patched on 24 Feb 2021. The restriction the endpoint was supposed to enforce, admin-only access, is the obvious place to start, together with binding a reset token to the account that requested it.
Variants to test
- Role checks on data-returning endpoints. Log in with the lowest privileged account you can create and replay every GET request an admin makes. A positive result is a response containing tokens, salts, invitation links or other secrets that the low privileged user should not see.
- Token substitution in reset flows. Request a reset for your own account, capture the request, and swap in a token belonging to another account. A positive result is a successful password change on the other account.
- Enumerable user identifiers. Check whether user IDs are exposed to all users, for example as MD5 hashes in an employees listing. A positive result is a stable identifier for every account that can be paired with a leaked token.
- New features after release notes. Subscribe to the target's newsletter or changelog and test each newly announced feature with every role you hold. A positive result is any feature that behaves differently for a low privileged user than for an admin.
What happened, in plain words
A security researcher had been testing the same product for a long time. The product is not named in the report, and neither is the company that runs it. One day he received an email newsletter from that product announcing new features. He decided to test those new features, and in one of them he found a serious flaw: a normal, low privileged user could obtain the password reset token of an administrator, then use that token to set a new password for the admin account and take it over.
To follow the story you only need to understand a handful of ideas, and each one is explained where it first appears. The short version is that the product had a web address (an API endpoint) that was supposed to answer only administrators, but it answered everyone. The answer contained secrets, including the token that lets someone reset an account's password. With that token, the researcher could pretend to be the admin and change the admin's password.
Why old targets are still worth testing
The researcher opens with a question that beginners often ask: this program is old, all the great hackers have already tested it, so how can I still find a bug? His answer is that products keep changing. New features are added regularly, and those new features may not have been tested by anyone yet, or the other testers may be busy with different programs.
He makes the point that finding a bug in a product that experts have already tested is encouraging, not embarrassing. It is a matter of perspective: the product is not frozen, so the surface to test keeps growing.
His practical advice is to subscribe to the target's newsletter. A newsletter is simply an email list a company uses to tell customers and subscribers about changes, new features and announcements. For a security tester it works like a changelog delivered to the inbox: it tells you exactly what is new, and new things are where fresh mistakes tend to be.
The bug
The researcher had tested this product for a long time and calls it one of his favourites. The newsletter email described newly added features, so he logged in and started testing them.
While testing, he noticed that one endpoint was disclosing three pieces of information: a password reset token, a salt and an invitation token. Before going further, here is what those words mean.
- An endpoint is a specific address on a web server that a program or a page can send a request to. Think of a restaurant: the menu is the website you see, and the endpoint is the kitchen window where a specific order is handed over. Each endpoint does one job, such as returning a list of employees or accepting a password change.
- An API (Application Programming Interface) is the set of those endpoints that a program talks to, usually exchanging data rather than web pages. When a page in your browser loads a list of employees, it often asks an API behind the scenes, and the API answers with data.
- A GET request is the simplest kind of request: it asks the server to give something back, without changing anything. Typing a web address into your browser and pressing Enter sends a GET request. The opposite kind, which sends data to change something, is usually a POST request.
- A password reset token is a long random string that a website gives you when you click "forgot my password". The site emails you a link containing that token, and when you open the link the site checks the token and lets you set a new password. It works like a cloakroom ticket: whoever holds the ticket can collect the coat, so the ticket must stay secret.
- A salt is a random value that a website mixes into a password before storing a scrambled version of it (a hash). Its purpose is to make stolen password data harder to crack. Seeing a salt leak is bad, but the reset token is the more dangerous item.
- An invitation token is a similar secret used when someone is invited to join an account or organisation. It is meant to be used once by the invited person.
The important detail is that this endpoint was only meant to be available to an admin user. An admin (administrator) is an account with the highest level of permission inside a workspace: it can manage other users, settings and data. A low privileged user is an ordinary account with fewer permissions, for example an employee who can see their own profile but not manage others.
When the researcher found the endpoint he was logged in as an admin, so seeing the data was expected. To find out whether the restriction was actually enforced, he logged in with his lower privileged account and sent the same GET request to the same API.
Step 1: asking for the data as a low privileged user
The test is simple in principle: take the exact request an admin makes, and make it again while logged in as the ordinary user. If the server answers with the same sensitive data, the permission check is missing.
That is what happened. The following image shows a lower privileged user receiving the password reset token of an admin user.

token leak to lower user
The response contained the admin's password reset token. The user ID needed to target the account is separately visible to everyone in the employees section. A user ID is the identifier a system uses internally for an account, and in this product it is an MD5 hash. An MD5 hash is the output of a mathematical function that turns any input into a fixed-length string of characters; the same input always gives the same output, and the output does not look like the input. Here the hash is not a secret at all: the researcher notes that every user can see these IDs in the employees section of the product. So the low privileged user had both the identifier of an admin account and that account's reset token.
Why does this matter so much? Because the two things needed to attack a specific account are now in the hands of someone who should never have had them. The identifier says which account to target, and the token is the key that unlocks the password change.
Step 2: using the leaked token to take over the admin account
With the admin's reset token in hand, the goal was to change the admin password. The researcher did not try to guess the old password. Instead he abused the normal password reset flow, which is the feature every website offers when you forget your password.
Here is the sequence he describes:
- He went to the forgot password page and requested a reset for his own low privileged account, the attacker account. This is the account he controls, so he can receive its reset email.
- He received the password reset link and captured the request that the page sends when the new password is submitted. Capturing a request means using a tool that sits between the browser and the server and lets you see and edit what is sent. The report does not name the tool.
- He replaced the token in that request with the admin's leaked token, and submitted a new password for the admin account.
- The server accepted it. The admin account was now under his control.
The reset step accepted the substituted token, and the report does not say why. In everyday terms: the cloakroom accepted any ticket, without checking whose coat it was attached to.
The following image shows the successful request that resulted in the admin account takeover.

admin account takeover
The researcher states that the same technique worked against any account in the same organisation. An organisation here is the shared workspace that groups users together, like a company account on a business product. He adds that it could have been a disaster if a cross-organisation takeover had been possible, meaning an attacker from one company taking over an account in another company. In his testing that was not possible: the takeover stayed inside the same organisation.
How he found it, and what he did next
The researcher credits the newsletter subscription as the reason he found the bug. The new feature had been announced by email, he tested it, and the flaw was there. As soon as he confirmed the issue he notified the team.

Dark Truth
Timeline
| Time (IST) | Event |
|---|---|
| 09 Nov 2020 00:51:03 | Bug reported |
| 10 Nov 2020 18:39:41 | Bug triaged |
| 12 Nov 2020 22:05:46 | Something good happened |
| 24 Feb 2021 08:26:54 | Bug patched |
Triaged means the receiving team reviewed the report and accepted it as a real issue. Patched means the flaw was fixed in the product.
Why it worked
Two separate weaknesses combined.
First, the endpoint that returns password reset tokens, salts and invitation tokens was meant for admins only, but it did not enforce that rule. A low privileged user sending the same GET request received the same sensitive data.
Second, the reset flow itself accepted a token issued for one account when it was submitted for another. Possession of a leaked token was enough to set a new password.
Impact
Any low privileged user could take over an admin account and any other normal user account within the same organisation. The researcher explicitly limits the impact to the same organisation: a cross-organisation takeover was not possible in his testing.
Fix
The report states only that the bug was patched on 24 February 2021. The restriction the endpoint was supposed to enforce, admin-only access, is the obvious place to start, together with binding a reset token to the account that requested it.
Variants to test
These are the same ideas generalised, so you can look for similar bugs on other products.
- Role checks on data-returning endpoints. Log in with the lowest privileged account you can create and replay every GET request an admin makes. A positive result is a response containing tokens, salts, invitation links or other secrets that the low privileged user should not see.
- Token substitution in reset flows. Request a reset for your own account, capture the request, and swap in a token belonging to another account. A positive result is a successful password change on the other account.
- Enumerable user identifiers. Check whether user IDs are exposed to all users, for example as MD5 hashes in an employees listing. A positive result is a stable identifier for every account that can be paired with a leaked token.
- New features after release notes. Subscribe to the target's newsletter or changelog and test each newly announced feature with every role you hold. A positive result is any feature that behaves differently for a low privileged user than for an admin.
Glossary
- Account takeover: gaining control of someone else's account, usually by changing its password or session, so you can act as that person.
- Admin (administrator): an account with the highest permissions in a workspace, able to manage users, settings and data.
- API (Application Programming Interface): the set of addresses a program uses to exchange data with a server, as opposed to web pages meant for humans.
- Capturing a request: using a tool between browser and server to see and edit the traffic that is sent.
- Cross-organisation: involving two different organisations or company workspaces; a cross-organisation takeover would mean attacking an account in another company.
- Endpoint: a specific address on a server that performs one job when it receives a request.
- Forgot password flow: the feature that emails a reset link so a user who forgot their password can set a new one.
- GET request: a request that asks the server to return something without changing data.
- Hash (MD5): the fixed-length output of a mathematical function applied to some input; MD5 is one such function, and here it is used to produce user IDs.
- Invitation token: a secret string used to accept an invitation to join an account or organisation.
- IST: Indian Standard Time, the time zone used in the timeline.
- Low privileged user: an ordinary account with fewer permissions than an admin.
- Newsletter: an email list a company uses to announce news and new features to subscribers.
- Organisation: the shared workspace that groups users together, such as a company account on a business product.
- Password reset token: a long random string issued during a password reset that proves the holder is allowed to set a new password.
- Patched: fixed in the product.
- Privilege escalation: gaining a higher level of permission than your account was given, for example a normal user acting as an admin.
- Salt: a random value mixed into a password before hashing, to make stored password data harder to crack.
- Triaged: reviewed and accepted as a real issue by the receiving team.
- User ID: the identifier a system uses for an account; here an MD5 hash visible to all users in the employees section.