Theoretically Possible To Practical Account Takeover
Published on ironfisto.medium.com
This one is the last account takeover I found and wanted to share about it. It was a good chain of IDOR with some recon and understanding of the application.
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 crypto mining web application built by a solo Russian developer. The feature at the centre of this write-up is password reset. The application also had a referral function that produced shareable links, and a second endpoint that consumed the referral source value. The withdrawal flow was multi-step and included identity verification, which is why the researcher notes the app looked secure at first glance. The impact of the takeover described here was limited to reading a victim's crypto asset balance, but the researcher went after account takeover anyway.
Setup
- Two accounts were registered with email addresses.
- The primary key of each account was noted. The primary key is a UUID.
- The reset password function was used with an email address, which produced a reset link of the following shape:
https://domain.tld/changePassword/{user-primary-key-id}/{reset-token}
No other tooling, versions or preconditions are described in the report.
Finding it
The reset link places the user's primary key in the URL path, next to the reset token. Seeing the UUID in the link was enough to make the researcher suspect the endpoint would accept a UUID that did not belong to the token. The plan was to keep the attacker's own reset token and swap the primary key for the victim's.
Exploitation
Step 1: Swap the primary key in the reset link
The attacker's own primary key in the link was replaced with the victim's primary key, keeping the attacker's reset token:
https://domain.tld/changePassword/{victim-primary-key-id}/{attacker-reset-token}
The resulting request was:
POST /changePassword/62c4ffb0-be57-11e8-a68e-8d01686939c8/[redacted] HTTP/1.1
with the body:
{"password":"urhacked"}
The path carries the account UUID and the reset token; the body carries the new password. The response was 200 and the password of the account identified by that UUID was changed. At this point the researcher could take over any account whose UUID was known, but that was a false claim in practice: neither the victim's email address nor the victim's UUID was known, so the two test accounts were only attacking each other. The attack was theoretical until the UUID could be obtained.
Step 2: Find a way to leak the UUID
The referral functionality produced links of this form:
https://domain.tld/?source=4vyryrtfhf
This gives a source referral value belonging to a user, but the referral link itself does not leak the UUID. A second endpoint was found that also takes the source referral parameter:
https://domain.tld/fast/4vyryrtfhf

The response from that endpoint exposed the victim's UUID, as shown in the screenshot captioned "SEE VICTIM UUID". With the UUID in hand, the missing piece of the chain was available.
Step 3: Collect UUIDs at scale
Using Google dorks, the researcher was able to collect as many source parameters of users as desired, resolve each one to a UUID through the /fast/ endpoint, and thereby take over any user account on the application.
Step 4: Complete the takeover
The attacker uses their own account to obtain a reset password token, then places the victim's UUID in the reset password link alongside that token. The password change request from Step 1 then applies to the victim's account.
Root cause
The reset password endpoint trusts the account identifier supplied in the URL path and does not bind the reset token to the account it was issued for. A token generated for one account is accepted when presented with another account's UUID, so possession of any valid token plus a target UUID is enough to set the target's password. The referral feature exposes the UUID: the source referral value is public by design, and the /fast/{source} endpoint resolves that value to the account UUID. The two weaknesses combine into a full account takeover chain. The report does not describe the server-side code, so the exact validation logic is not shown.
Impact
An attacker who can obtain a victim's UUID can change that victim's password and take over the account. The report frames the direct impact as knowing the amount of crypto assets the victim holds. The withdrawal process was multi-step and included identity verification. The attack requires a valid reset token from an attacker-controlled account and a victim UUID, the latter obtainable from any publicly shared referral source value via the /fast/ endpoint. The researcher notes the takeover was rewarded with a fraction of ETH.
Fix
The report does not state what was changed. The design fix implied by the chain is to bind the reset token to the account it was issued for, so that a token presented with a different UUID is rejected, and to stop resolving a public referral source value to the account's UUID on the /fast/ endpoint.
Variants to test
- Reset links that carry a user identifier in the path or query: request a reset for your own account, then substitute another account's identifier while keeping your token. A positive result is a
200and a password change on the other account. - Referral or invite endpoints that accept a short public code: request the endpoint with a code you control and inspect the response for internal identifiers such as UUIDs, numeric IDs or email addresses. A positive result is any identifier that can be fed into another endpoint.
- Public profile or share pages that embed a
source,reforinviteparameter: check whether any related endpoint resolves that parameter to a stable account identifier. - Password reset tokens reused across accounts: take a token issued for account A and present it with account B's identifier in every place the application accepts it (path, query, body). A positive result is acceptance rather than an error.
- Google dorking for the referral parameter pattern to enumerate public codes, then resolving each through the consumer endpoint. A positive result is a mapping from public codes to account identifiers at scale.
What happened, in plain words
A security researcher found a way to take over other people's accounts on a crypto mining website. Crypto mining is the process of using a computer to do calculations that earn cryptocurrency, and a crypto mining web app is a site where people manage that activity and hold a balance of coins.
The site was built by one developer working alone. At first it looked well protected, because moving coins out of an account was not a single click: the site asked for several steps and checked who you were. But the researcher still went looking for a way to take over accounts, even though the direct effect was only being able to see how much crypto another person held.
The takeover worked by combining two separate weaknesses. The first was in the password reset feature: the link used to set a new password contained an identifier for the account, and the site did not check that the identifier matched the person the reset link was issued to. The second was in the referral feature: a public share link contained a short code, and a second page on the site turned that public code into the account's private identifier. Put together, anyone could collect public referral codes, turn them into account identifiers, and reset the matching account's password.
This article walks through the same steps the researcher took, explaining each idea from scratch.
Background concepts
Before the steps, a few words that come up constantly.
- A web application is a website that does things for you rather than only showing text: you log in, you change settings, you move money. Behind the page you see, a program on the server receives your actions and responds.
- An endpoint is one specific address on that server that accepts one kind of action. Think of a large office building: the building is the application, and each counter inside is an endpoint. One counter handles password resets, another handles referrals.
- A request is the message your browser sends to an endpoint. It has a method (such as
GETto fetch something orPOSTto send data), a path (which counter), headers (extra information about the message) and sometimes a body (the data itself). - A response is the server's reply. A status code of
200means the server accepted and processed the request successfully. Codes in the 400s usually mean the request was rejected. - A UUID is a long identifier that looks random, for example
62c4ffb0-be57-11e8-a68e-8d01686939c8. Applications use it as the primary key of a record: the unique label for one account in the database. It is not a password, but it is meant to be hard to guess. - A reset token is a long random string the site generates when you ask to reset your password. It is proof that the request came from someone who controls the email address on the account.
- IDOR stands for Insecure Direct Object Reference. It means the application lets you name an object (an account, an order, a file) directly in the request, and does not check that the object belongs to you. Everyday comparison: a cloakroom that hands out a numbered ticket, but gives you any coat you ask for as long as you say the right number.
- Account takeover means an attacker gains control of someone else's account, usually by changing the password so the real owner is locked out.
- A referral feature gives each user a shareable link with a short code. When a new person signs up through that link, the original user gets credit. The code is public by design, because it is meant to be posted and shared.
- Google dorking means using search engine queries to find pages that contain a particular pattern, such as a URL parameter with a certain name. It is a way of finding publicly indexed pages at scale.
Setting up the test
The researcher did not attack a stranger's account first. The safe way to test an access-control weakness is to create two accounts you own and try to make one act on the other. If it works, you have proven the flaw without touching anyone else.
- Two accounts were registered, each with an email address.
- The primary key of each account was noted. The primary key is a UUID.
- The reset password function was used with an email address, which produced a reset link of the following shape:
https://domain.tld/changePassword/{user-primary-key-id}/{reset-token}
Line by line: https://domain.tld is the site. /changePassword/ is the endpoint that handles setting a new password. {user-primary-key-id} is the account's UUID, placed directly in the address. {reset-token} is the random proof string. The curly braces are placeholders: in a real link they are replaced by actual values.
Why this matters: the account identifier is sitting in the URL, in plain view, right next to the token. That is the first hint that the endpoint might trust whatever identifier you put there.
Finding the weakness
The reset link places the user's primary key in the URL path, next to the reset token. Seeing the UUID in the link was enough to make the researcher suspect the endpoint would accept a UUID that did not belong to the token. The plan was to keep the attacker's own reset token and swap the primary key for the victim's.
In plain terms: the token proves you asked for a reset. The UUID says which account to reset. If the server checks the token but never checks that the token was issued for that UUID, then any valid token can be paired with any account.
Exploitation
Step 1: Swap the primary key in the reset link
The attacker's own primary key in the link was replaced with the victim's primary key, keeping the attacker's reset token:
https://domain.tld/changePassword/{victim-primary-key-id}/{attacker-reset-token}
Line by line: the path is unchanged, the endpoint is the same, but the first placeholder now holds the victim's UUID and the second still holds the token the attacker legitimately received for their own account. Nothing else is altered.
The resulting request was:
POST /changePassword/62c4ffb0-be57-11e8-a68e-8d01686939c8/[redacted] HTTP/1.1
Line by line: POST is the method, used when you are sending data that changes something on the server. /changePassword/ is the endpoint. 62c4ffb0-be57-11e8-a68e-8d01686939c8 is the account UUID in the path. [redacted] is the reset token in the path. HTTP/1.1 states the version of the protocol used to talk to the server.
with the body:
{"password":"urhacked"}
Line by line: the body is a small JSON object. JSON is a text format for structured data, made of names and values in curly braces. Here the name is password and the value is the new password the attacker wants to set. The server reads this and, if it accepts the request, stores it as the account's new password.
The path carries the account UUID and the reset token; the body carries the new password. The response was 200 and the password of the account identified by that UUID was changed. At this point the researcher could take over any account whose UUID was known, but that was a false claim in practice: neither the victim's email address nor the victim's UUID was known, so the two test accounts were only attacking each other. The attack was theoretical until the UUID could be obtained.
Why this step was taken: it isolates the first weakness. By proving that a token from account A works with the UUID of account B, the researcher shows the server does not bind the two together. But a real attacker still needs the victim's UUID, and that is the next problem.
Step 2: Find a way to leak the UUID
The referral functionality produced links of this form:
https://domain.tld/?source=4vyryrtfhf
Line by line: https://domain.tld/ is the site's home page. ? starts the query string, the part of a URL that carries parameters. source=4vyryrtfhf is one parameter named source with the value 4vyryrtfhf, a short public code that identifies the referring user.
This gives a source referral value belonging to a user, but the referral link itself does not leak the UUID. A second endpoint was found that also takes the source referral parameter:
https://domain.tld/fast/4vyryrtfhf
Line by line: the same site, a different endpoint /fast/, and the same short code placed directly in the path instead of the query string. The code is the only thing the attacker needs to supply.

The response from that endpoint exposed the victim's UUID, as shown in the screenshot captioned "SEE VICTIM UUID". With the UUID in hand, the missing piece of the chain was available.
Why this step was taken: the first weakness only becomes a real attack when the attacker can learn the target's UUID. The referral code is public and shareable, so if any page on the site turns that public code into the private identifier, the identifier is no longer secret.
Step 3: Collect UUIDs at scale
Using Google dorks, the researcher was able to collect as many source parameters of users as desired, resolve each one to a UUID through the /fast/ endpoint, and thereby take over any user account on the application.
In plain terms: referral links are meant to be posted publicly, so search engines index them. A search query that matches the source= pattern returns many such links. Each code can then be fed to /fast/, which returns the matching UUID. The result is a list of accounts and their identifiers, ready to be attacked one by one.
Step 4: Complete the takeover
The attacker uses their own account to obtain a reset password token, then places the victim's UUID in the reset password link alongside that token. The password change request from Step 1 then applies to the victim's account.
Why this order matters: the token must be genuine, so the attacker requests a reset for an account they control and receives a valid token by email. The UUID must belong to the victim, and Step 2 supplies it. Neither piece alone is enough; together they let the attacker set the victim's password.
Root cause
The reset password endpoint trusts the account identifier supplied in the URL path and does not bind the reset token to the account it was issued for. A token generated for one account is accepted when presented with another account's UUID, so possession of any valid token plus a target UUID is enough to set the target's password. The referral feature exposes the UUID: the source referral value is public by design, and the /fast/{source} endpoint resolves that value to the account UUID. The two weaknesses combine into a full account takeover chain. The report does not describe the server-side code, so the exact validation logic is not shown.
A useful comparison: a hotel that gives you a key card for your own room, but the door lock only checks that the card is valid, not which room it belongs to. Any valid card opens any door, as long as you know the room number. And the room numbers are printed on the public guest list.
Impact
An attacker who can obtain a victim's UUID can change that victim's password and take over the account. The report frames the direct impact as knowing the amount of crypto assets the victim holds. The withdrawal process was multi-step and included identity verification. The attack requires a valid reset token from an attacker-controlled account and a victim UUID, the latter obtainable from any publicly shared referral source value via the /fast/ endpoint. The researcher notes the takeover was rewarded with a fraction of ETH.
Fix
The report does not state what was changed. The design fix implied by the chain is to bind the reset token to the account it was issued for, so that a token presented with a different UUID is rejected, and to stop resolving a public referral source value to the account's UUID on the /fast/ endpoint.
In everyday terms: the door lock should check that the key card belongs to the room, and the guest list should not print room numbers at all.
Variants to test
If you want to look for similar problems on sites you are allowed to test, these are the patterns to try. Always use accounts you own, and only test systems that permit it.
- Reset links that carry a user identifier in the path or query: request a reset for your own account, then substitute another account's identifier while keeping your token. A positive result is a
200and a password change on the other account. - Referral or invite endpoints that accept a short public code: request the endpoint with a code you control and inspect the response for internal identifiers such as UUIDs, numeric IDs or email addresses. A positive result is any identifier that can be fed into another endpoint.
- Public profile or share pages that embed a
source,reforinviteparameter: check whether any related endpoint resolves that parameter to a stable account identifier. - Password reset tokens reused across accounts: take a token issued for account A and present it with account B's identifier in every place the application accepts it (path, query, body). A positive result is acceptance rather than an error.
- Google dorking for the referral parameter pattern to enumerate public codes, then resolving each through the consumer endpoint. A positive result is a mapping from public codes to account identifiers at scale.
Glossary
- Account takeover: gaining control of another person's account, usually by changing their password.
- API: a set of endpoints a program exposes so other programs (or a browser) can ask it to do things.
- Body: the part of a request that carries data, such as a new password.
- Crypto mining: using computing power to perform calculations that earn cryptocurrency.
- Endpoint: one specific address on a server that accepts one kind of action.
- Google dorking: using search engine queries to find pages matching a pattern, such as a URL parameter name.
- Header: extra information attached to a request or response, such as the content type.
- HTTP: the protocol browsers and servers use to exchange requests and responses.
- IDOR (Insecure Direct Object Reference): a flaw where the application lets you name an object directly and does not check that it belongs to you.
- JSON: a text format for structured data, made of names and values.
- Method: the verb of a request, such as
GETto fetch orPOSTto send and change data. - Parameter: a named value in a URL, such as
source=4vyryrtfhf. - Path: the part of a URL after the domain that names the endpoint, such as
/changePassword/. - Primary key: the unique label for a record in a database, here a UUID.
- Query string: the part of a URL after
?that carries parameters. - Referral: a feature that gives each user a shareable link with a short code, so new sign-ups can be credited to them.
- Request: the message a browser sends to a server asking it to do something.
- Reset token: a long random string issued when a password reset is requested, proving the requester controls the account's email.
- Response: the server's reply to a request, including a status code.
- Status code: a number in the response saying what happened, such as
200for success. - UUID: a long, hard-to-guess identifier used as a record's primary key.
- Web application: a website that performs actions for users, not just displays text.