Skip to content
Account takeover Write-up Intermediate

How I found a Zero-Click Account Tack over via password rest link

The password reset workflow accepted a client-supplied email parameter to decide which account's password was changed, without checking it against the account bound to the recovery token. An attacker could use a recovery token from their own account to change another user's password, leading to account takeover.

cyghost Follow

Published on cyghost.medium.com

Cybersecurity

seif nasr, on cyghost.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.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 3 min read.

Context

This write-up looks at a password reset workflow in a web application and at how the server ties a recovery token to the account whose password is being changed. Password recovery is a sensitive feature because it brings together three things that must stay correctly linked on the server side: the recovery token, the account identifier, and the password change itself. The author's question was whether the application actually enforced that link.

The affected organisation, target, endpoints, complete requests and other identifying details are deliberately left out of the write-up, so the discussion stays on the security lesson. What follows is the reasoning and the test method, not a reproducible request set.

Setup

The testing used accounts the author controlled. Two test accounts were needed for the account-binding test: one to start the recovery process and one to receive the password change. No tools, versions or specific roles are described beyond using the application's own password recovery functionality and inspecting the HTTP requests it produces.

Finding it

The author started by running the password recovery flow with a test account, receiving the recovery link, and going through the reset process. Inspecting the HTTP requests involved in changing the password turned up one detail worth attention: the request included a parameter named Email.

That parameter appeared to identify the account associated with the password change. The question that followed was whether the server independently verified the account tied to the recovery token, or whether it trusted the email address supplied in the request. If the latter, the token would not really be bound to an account at all.

Exploitation

Step 1: Start recovery for the first account

The author initiated the password recovery process for the first of the two controlled test accounts and inspected the password change request that followed.

Step 2: Examine how Email is handled

The focus was on the Email parameter in that request and on whether the recovery token was securely bound to the account whose password was being changed. During testing, the application did not properly enforce that relationship: the server accepted a password change request in which the account identifier did not correspond to the account associated with the original recovery operation.

Step 3: Confirm the impact

A successful HTTP response alone would not have been enough to establish account takeover, so the author verified the resulting behaviour with the controlled accounts. The password change affected the second test account, even though recovery had originally been started for the first account. The changed credentials were then used to authenticate to the second test account, confirming that the recovery context of one account could be used to change another account's password.

Root cause

The underlying problem was a failure to enforce the relationship between the recovery token and the target account. The behaviour suggested insufficient server-side validation of the account identity during password recovery: the account receiving the password change was taken from a client-supplied parameter rather than derived from the validated token. A secure implementation should:

  • Bind each recovery token to one specific account.
  • Derive the authorised account from the validated token.
  • Reject requests when the token and requested account do not match.
  • Invalidate the recovery token after a successful password change.
  • Test account boundaries to prevent similar regressions.

Client-supplied parameters should never be sufficient on their own to determine which account receives a sensitive security operation.

Impact

If the same behaviour were exploitable against real users, an attacker could potentially take over an account without requiring the victim to interact with a recovery link. The impact would depend on the affected account's data, functionality and privileges. The author frames this as a potential account takeover, demonstrated only against accounts under their own control.

Fix

The write-up does not say what the affected organisation changed, if anything. The guidance it gives is the list above: bind each token to one account, derive the authorised account from the validated token, reject mismatches between token and requested account, and invalidate the token after a successful password change.

Variants to test

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 12 min read.

What happened, in plain words

A security researcher was looking at a very ordinary feature that almost every website has: the "forgot my password" button. When you use it, the site emails you a special link. Clicking that link lets you set a new password. Behind the scenes, the site has to keep track of one simple fact: this link belongs to this account, and nobody else.

The researcher found that this site did not keep track properly. When you finally submit your new password, your browser sends a small piece of information to the server that says which account the password change is for. The server believed that information instead of checking it against the link that was actually used. So a person could start the password reset for their own account, then change the account name in that final request to a second account they controlled, and the server would change that account's password.

That is called account takeover: getting into someone else's account without their permission. The researcher proved it only with two test accounts they owned, never against a real user. The write-up deliberately hides the company, the website address, the exact requests and everything else that would let someone repeat it. What is left is the lesson, and that is what this article walks through, step by step, for someone who has never done security testing before.

The idea behind the bug

What a password reset actually does

When you click "forgot password" on a website, three things happen in a rough sequence:

  1. You type in your email address (or username) and press a button.
  2. The website creates a long random string of characters, called a token, and emails you a link containing it. The token is like a cloakroom ticket: it is worthless to anyone else, it is only good for one visit, and it proves you were the person who handed in the coat.
  3. You open the link, type a new password, and your browser sends the token and the new password back to the server. The server checks the token, works out which account it belongs to, and saves the new password there.

The important part is step 3. The server must decide which account to change based on the token, because the token is the thing the server itself created and handed out. Anything else the browser sends along with it is just a claim, and claims can be edited.

What a parameter is

When your browser talks to a website, it sends a request. A request is a short message with a few parts: the address being asked for, some headers (extra labels, like which browser you use), and sometimes a body (the data you are submitting, such as a form).

A parameter is one named piece of data inside that request. If a form has a field called Email, then the request will contain something like Email=[redacted]. The name on the left of the equals sign is the parameter name; the value on the right is what you typed. Parameters are just text, and text in a request can be changed by anyone who knows how to use their browser's developer tools or an intercepting proxy.

What "binding" means

Binding here means tying two things together so firmly that one cannot be used without the other. Think of a hotel key card: the card is bound to room 412. If you wave it at room 413, the lock refuses, because the lock checks the card against the room, not against what you tell it.

In a password reset, the token must be bound to one account. The server should look up the token, find the account it was issued for, and change that account's password. It should never ask the browser "and which account did you say this was for?"

What the researcher suspected

The researcher noticed that the final password change request contained a parameter named Email. That parameter looked like it was telling the server which account the change applied to. If the server trusted it, then the token was not really bound to anything: it was just a pass that let you change whichever account you named.

Setting up the test

The testing used accounts the researcher controlled. That matters for two reasons. First, it is legal and ethical: you are only ever touching your own property. Second, it makes the result unambiguous: if account B's password changes, there is no doubt about whose account it was.

Two test accounts were needed:

  • Account A, used to start the password recovery and receive the recovery link.
  • Account B, the account that the researcher would try to change the password of, using A's recovery link.

No special tools, software versions or user roles are described in the write-up. The only things used were the application's own password recovery feature and a way to look at the HTTP requests it produces. In a browser, that is the Network tab of the developer tools; an intercepting proxy is another common way, but the write-up does not name one.

Finding it

Step 1: Walk through the normal flow

The researcher started by using the password recovery feature with a test account, exactly as a normal user would. They received the recovery link by email and went through the reset process, setting a new password.

Why do this first? Because you cannot spot what is unusual until you know what normal looks like. Running the feature once, slowly, and watching every request it makes gives you a map of the workflow. Only then can you ask useful questions about it.

Step 2: Look at the request that changes the password

While inspecting the HTTP requests involved in changing the password, one detail stood out: the request included a parameter named Email.

Why is that interesting? Because a password change request only needs two things: the token (to prove the request came from the person who owns the account) and the new password (to set). An extra Email field suggests the server is being told which account to act on, rather than working it out from the token. That is a design smell, the security equivalent of a form that asks you to write down your own credit limit.

Step 3: Ask the right question

The question that followed was simple and precise: does the server independently verify the account tied to the recovery token, or does it trust the email address supplied in the request?

If the answer is the second one, then the token is not bound to an account at all. It is a general-purpose key that opens whichever door you name. That is the whole vulnerability in one sentence.

Testing the account binding

Step 1: Start recovery for the first account

The researcher initiated the password recovery process for the first of the two controlled test accounts (account A) and inspected the password change request that followed.

At this point the researcher holds a valid recovery token that the server issued for account A. That token is genuine. Nothing has been forged. The only thing that will change is the Email value in the final request.

Step 2: Examine how Email is handled

The focus was on the Email parameter in that request, and on whether the recovery token was securely bound to the account whose password was being changed.

During testing, the application did not properly enforce that relationship. The server accepted a password change request in which the account identifier did not correspond to the account associated with the original recovery operation.

In plain words: the researcher sent a request carrying A's token but naming B's email address, and the server said yes. It did not stop to check that the token and the email belonged together. It treated the email in the request as the truth.

Step 3: Confirm the impact

A successful HTTP response alone would not have been enough to establish account takeover. This is an important habit in security testing: a server saying "200 OK" does not prove anything happened. Plenty of applications return a cheerful success page and quietly do nothing.

So the researcher verified the resulting behaviour with the controlled accounts:

  1. The password change affected the second test account (account B), even though recovery had originally been started for the first account (account A).
  2. The changed credentials were then used to authenticate to account B, and the login worked.

That second check is the one that turns a suspicious response into a demonstrated vulnerability. Logging in with the new password proves the password really changed on B, and that the researcher now controls B's login without ever having access to B's email inbox.

Why this is serious

The underlying problem was a failure to enforce the relationship between the recovery token and the target account. The account receiving the password change was taken from a client-supplied parameter rather than derived from the validated token.

"Client-supplied" means it came from the browser, which means it came from the attacker. "Derived from the validated token" means the server worked it out itself from something it created and can check.

If the same behaviour were exploitable against real users, an attacker could potentially take over an account without requiring the victim to interact with a recovery link. That last part is what makes it a zero-click attack: the victim does not have to click anything, open an email, or notice anything at all.

The impact would depend on the affected account's data, functionality and privileges. An account that only stores a display name is a small problem; an account that can move money or administer other users is a very large one. The researcher frames this as a potential account takeover, demonstrated only against accounts under their own control.

The root cause

The behaviour suggested insufficient server-side validation of the account identity during password recovery. "Server-side" is the key phrase: the check has to happen on the server, because anything the browser does can be bypassed by the person using the browser.

A secure implementation should:

  • Bind each recovery token to one specific account.
  • Derive the authorised account from the validated token.
  • Reject requests when the token and requested account do not match.
  • Invalidate the recovery token after a successful password change.
  • Test account boundaries to prevent similar regressions.

Client-supplied parameters should never be sufficient on their own to determine which account receives a sensitive security operation.

What the fix would look like

The write-up does not say what the affected organisation changed, if anything. The guidance it gives is the list above: bind each token to one account, derive the authorised account from the validated token, reject mismatches between token and requested account, and invalidate the token after a successful password change.

In everyday terms, the server should behave like the hotel lock, not like a receptionist who takes your word for which room is yours. The token is the card; the room number is looked up from the card, never from what the guest says.

Variants to test

Once you understand the shape of a bug like this, you can look for the same shape elsewhere.

Each of these is the same question asked in a slightly different place: is the server deciding who you are from something it can verify, or from something you handed it?

Lessons learned

This investigation reinforced an important lesson in web application security: a parameter's presence in an HTTP request does not mean the server should trust it.

When testing authentication and recovery workflows, it is important to understand how the application links tokens, identities and sensitive actions. The real question is not simply whether a parameter can be changed. It is whether changing it breaks a security boundary, and whether that impact can be demonstrated safely.

For someone starting out, the practical habits are:

  • Run the feature normally first and watch the requests.
  • Look for fields that name an account, a user or an identifier in a request that already carries a token.
  • Change one thing at a time, on accounts you own.
  • Confirm the effect by logging in, not by reading the response code.
  • Write down what you did, so the finding can be explained to someone else.

Glossary

  • Account takeover: gaining control of someone else's account, usually by changing its password or session, without their permission.
  • Authentication: the process of proving who you are, typically by logging in with a username and password.
  • Binding: tying two things together so one cannot be used without the other, such as a recovery token being tied to exactly one account.
  • Body: the part of an HTTP request that carries submitted data, such as form fields.
  • Browser developer tools: the built-in panel in a browser (often opened with F12) that shows the requests a page makes and lets you inspect them.
  • Client: the program making the request, normally your browser.
  • Client-supplied: coming from the browser, and therefore controllable by whoever is using the browser.
  • Credentials: the information used to log in, such as a username and password.
  • Derive: work something out from other data, for example getting the account from a validated token rather than from a form field.
  • Developer tools Network tab: the section of browser developer tools that lists every request the page sends and receives.
  • Email parameter: a named field in a request whose value is an email address, here used to name the account a password change applies to.
  • Endpoint: the specific address on a server that handles a particular action, such as the address that processes a password change.
  • Header: an extra label sent with an HTTP request or response, such as the browser type or content type.
  • HTTP: the language browsers and web servers use to exchange requests and responses.
  • HTTP response: the server's reply to a request, including a status code such as 200 OK.
  • Intercepting proxy: a tool that sits between your browser and the server so you can read and edit requests before they are sent.
  • Invalidate: make something no longer valid, such as cancelling a token after it has been used.
  • Parameter: one named piece of data in a request, written as a name and a value.
  • Password recovery / password reset: the feature that lets you set a new password after proving you can receive email at the account's address.
  • Privileges: the permissions an account has, such as being an administrator.
  • Regression: a bug that reappears after it was fixed, or a new bug of the same kind.
  • Request: the message a browser sends to a server asking it to do something.
  • Root cause: the underlying reason a vulnerability exists, as opposed to its visible symptom.
  • Server: the computer that runs the website and answers requests.
  • Server-side validation: checking data on the server, where the user cannot tamper with the check.
  • Session: a period during which the server remembers who you are, usually tracked with a cookie or token.
  • Status code: the three-digit number in an HTTP response, such as 200 for success.
  • Test account: an account you created yourself and control, used for safe testing.
  • Token: a long random string issued by the server that proves a request came from someone who was given it, such as a password recovery link.
  • Username: the name that identifies an account, sometimes an email address.
  • Vulnerability: a weakness in software that allows someone to do something they should not be able to do.
  • Zero-click: an attack that works without the victim doing anything, such as clicking a link or opening a file.

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.