Skip to content
Account takeover Write-up Beginner

How I found my first critical vulnerability which came from forgetting my own password on the target site

The password reset confirmation page exposed the reset code in the URL before the user opened the email, and the same code was accepted by the activation endpoint. An attacker who knew a victim's email address could request a reset, read the code from the response, and set a new password without access to the victim's inbox.

Muhammad Sufyan Follow

Published on medium.com

Bug Bounty

Muhammad Sufyan, on 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. 6 min read.

Context

The target was a large identity provider: a SaaS platform that other companies plug into so their own users can sign in and verify themselves. Its product is proving that people are who they claim to be, and its customers are businesses that have handed that problem over to it. The researcher cannot name the target, but notes that this product context matters for the impact section later.

The feature involved is the password reset flow: the user enters an email address, the application sends a reset link, and the emailed link lets the user set a new password. On this platform the flow also had an activation endpoint, the one the emailed link would normally hit, which accepted the reset code as a parameter.

Setup

The researcher registered an account on the target and mapped the application, pulled apart the JavaScript and looked for the usual doors: IDORs on every object with an ID, parameter pollution, and anything in the invite flow. Hours were spent specifically on the organization and role logic, because that is where the money usually is on a platform like this. No tooling, interception or special versions are mentioned in the report. The finding came from an ordinary research account whose session had expired.

Finding it

After the first session the researcher closed the laptop, left the notes in a folder and considered the program done. Three or four days later, on a dead evening, the notes were opened again for one more pass. The session had expired, and the password did not work. Two other passwords used for throwaway research accounts did not work either.

So the forgot password link was used, not as a tester but as an irritated user who wanted back into his own account. The email address was typed in, submit was hit, and the application showed the usual "we have sent you an email" screen. While waiting for the mail, the researcher read the address bar. There was a long hash looking value sitting in it:

Text
success?[redacted]

The first guess was a CSRF token, a flow identifier, or some state value tying the page back to the request, which is almost always what such a value is. Then the email arrived and the reset link was opened like a normal person would. The same value was in that link.

The value the application had printed on a confirmation page, before the inbox was touched at all, was the same value it had just emailed as proof that the inbox was owned. That makes the email decorative: the secret was already handed to whoever filled in the form.

Exploitation

Step 1: request a reset and read the confirmation page

The researcher went back and did it deliberately. A reset was requested, and the value was copied straight off the confirmation screen, ignoring the inbox completely. The application had an activation endpoint, the one the emailed link would normally hit, and it took that same code as a parameter.

Step 2: feed the code to the activation endpoint

The value from the confirmation screen was supplied to the activation endpoint without reading a single email. The application dropped the researcher straight onto the set a new password screen.

Step 3: set a new password and log in

A new password was set and used to log in. No email, no second factor, no verification of any kind was needed. Total time from forgetting the password to standing inside a fully reset account was about ten minutes, and the researcher had not sat down to test anything at all.

The researcher is explicit that this was done against his own account only. A list of company employee addresses was sitting right there and the temptation to prove impact "properly" was real, but showing that the flow leaks the code for your own account is a complete proof. Doing it to a stranger is a crime with extra steps.

Root cause

Stated the way it belongs in a report: the application was exposing the password reset code in the response to whoever requested the reset. The person who requests the reset no longer has to be the person who owns the inbox. Type in someone's email address, read the code the application hands back to you, change their password.

The researcher's analysis of why this kind of bug survives is that reset flows are one of the last places in a modern application where somebody has to hand roll something security critical. Login is usually a library, sessions are usually a library, but password reset is glue code: generate a code, email it, look it up, expire it, swap the password. Every one of those five steps is a decision somebody made by hand. Nobody looks at it: not the developers, because it works and users stop complaining, and not testers, because the confirmation page is the most boring screen in the application. The report does not describe the server side implementation, so the precise reason the code was rendered into the confirmation page is not stated.

Impact

The report states that whoever requests the reset no longer needs to own the inbox, so typing in someone's email address and reading the returned code would let you change their password. On this specific product, the researcher's follow up comment to triage described what a compromised account could reach: invite users, change roles and permissions, reach client configuration, logs, event data, billing, and delete the organization. An account takeover on a personal blog and an account takeover on an identity platform are the same technical bug and completely different reports.

The researcher notes that the same bug with a weaker writeup would be a triage note about an information leak, and cannot prove that the follow up comment changed the severity.

Fix

The report does not describe the code change. It records that the program confirmed it had reproduced the issue, shipped a fix the same evening, and agreed it was as critical as reported. On retest, the researcher confirmed the reset code is no longer exposed anywhere in the flow.

Variants to test

  • Request a password reset for your own account and read the confirmation page and its URL for any value that also appears in the emailed link. A positive result is a token in the confirmation response that the activation endpoint accepts without the email being opened.
  • Submit the reset request and inspect the full response body and headers, not just the rendered page, for the reset code or a link containing it. A positive result is the code appearing anywhere in the response to the requester.
  • Try the activation endpoint directly with a code taken from the confirmation screen, skipping the email entirely. A positive result is landing on the set a new password screen.
  • Check whether the reset code is tied to the requesting session or IP, or accepted from any client. A positive result is the code working from a different session or client than the one that requested it.
  • Repeat the same reading of confirmation screens in other hand rolled flows (email verification, invite acceptance, MFA enrolment) for values that are also delivered out of band. A positive result is a secret shown to the requester before the out of band channel is used.
  • When a leak is confirmed on your own account, write the impact in terms of what that account can reach in the specific product, as the researcher did with organization roles, client configuration, logs, event data, billing and deletion.

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. 13 min read.

What happened, in plain words

A security researcher spent a whole evening testing a website and found nothing. He closed his laptop and mentally wrote the target off. Three or four days later he came back out of boredom, could not remember his own password, and used the site's "forgot password" link like any ordinary user would. While waiting for the email to arrive, he glanced at the address bar of the confirmation page and noticed a long random-looking value sitting in the URL. When the email finally arrived, the reset link contained exactly the same value. That meant the website had handed him the secret code before he had proved he owned the email inbox at all. The report states that whoever requests the reset no longer needs to own the inbox, so the code returned on screen would let them set a new password. He confirmed it on his own account only, wrote it up, and the company fixed it in roughly twenty four hours from the moment the right engineer saw it.

This article walks through the whole story for someone who has never done security testing. Every technical idea is explained from scratch the first time it appears.

The target and the feature

The researcher cannot name the company, but he describes what it is: a large identity provider. An identity provider is a service that other companies plug into so that their own users can sign in and prove who they are. Think of it like a passport office that many different shops rely on: instead of each shop checking your identity itself, it asks the passport office. The platform's entire product is proving that people are who they claim to be, and its customers are businesses that have handed that problem over to it. That detail matters later, when we talk about impact.

The feature involved is the password reset flow. A flow here just means a sequence of screens a user walks through. The password reset flow works like this: the user enters an email address, the application sends a reset link to that address, and the emailed link lets the user set a new password. The point of sending the link by email is to prove the person asking for the reset actually controls that inbox. If you can receive the email, you own the address.

On this platform the flow also had an activation endpoint. An endpoint is a specific address on a server that does one job when it is contacted, like a particular counter in a large office building. The activation endpoint is the one the emailed link would normally hit when clicked, and it accepted the reset code as a parameter. A parameter is a named piece of information passed along with a request, like writing a reference number on a form so the clerk knows which file to pull.

Setup: the first session

The researcher registered an account on the target and mapped the application. Mapping means clicking around and noting what pages exist, what they do, and how they connect. He also pulled apart the JavaScript. JavaScript is the programming language that runs inside your browser and makes pages interactive; reading it can reveal hidden addresses and logic the page uses. He looked for the usual doors:

  • IDORs on every object with an ID. An IDOR (Insecure Direct Object Reference) is when a website uses a simple identifier, like a number in a URL, to decide which record to show, and does not check that you are allowed to see that record. It is like a hotel that hands out room keys numbered 1 to 100 and never checks which room you booked.
  • Parameter pollution. This is when an attacker sends the same parameter more than once, or in unexpected forms, hoping the application reads one value while a security check reads another.
  • Anything in the invite flow, the screens used to invite other people into an account or organisation.

Hours were spent specifically on the organisation and role logic, because that is where the money usually is on a platform like this. Roles and permissions are the rules about who can do what inside an account: an owner can delete things, a member can only read. Bugs there tend to be valuable because they let one user act as another.

No tooling, interception or special versions are mentioned in the report. Interception would mean using a proxy tool to sit between the browser and the server and read or modify traffic; the researcher did not need any of that. The only precondition for the finding was an ordinary research account and a session that had expired. A session is the server's memory of you being logged in; it expires after a while, and then you have to log in again.

Finding it

After the first session the researcher closed the laptop, left the notes in a folder and considered the program done. Three or four days later, on a dead evening, he opened the notes again for one more pass. His session had expired, and his password did not work. Two other passwords he uses for throwaway research accounts did not work either.

So he used the forgot password link, not as a tester but as an irritated user who wanted back into his own account. He typed his email address, hit submit, and the application showed the usual "we have sent you an email" screen. While waiting for the mail, he read the address bar. There was a long hash-looking value sitting in it:

Text
success?[redacted]

Line by line, in plain words:

  • success is the name of the page the application sent him to after submitting the form. It is the confirmation screen.
  • ? marks the start of the query string, the part of a URL that carries extra information to the page. Everything after the question mark is data, not a folder or file name.
  • token= is the name of the parameter. A token is a short piece of data, usually random-looking, that stands in for something else, like a claim ticket at a cloakroom. You hand in the ticket and get the coat; you do not need to describe the coat.
  • xxxxxxxxxxxxxxxxxxxxxxxxxxxx is where the actual value sat. The researcher replaced it with x's so the real value is not published.

His first guess was a CSRF token, a flow identifier, or some state value tying the page back to his request. A CSRF token (Cross-Site Request Forgery token) is a random value a site puts in a form to make sure the form was submitted from its own pages and not forged by another website; it is a common defence, and such values are almost always harmless. A flow identifier is just a label for "this particular attempt". These are the most common reasons a random value appears in a URL, which is exactly why nobody gives it a second thought.

Then the email arrived and he opened the reset link like a normal person would. The same value was in that link.

The value the application had printed on a confirmation page, before the inbox was touched at all, was the same value it had just emailed as proof that the inbox was owned. That makes the email decorative: the secret was already handed to whoever filled in the form.

Exploitation

Step 1: request a reset and read the confirmation page

The researcher went back and did it deliberately. He requested a reset and copied the value straight off the confirmation screen, ignoring his inbox completely. The application had an activation endpoint, the one the emailed link would normally hit, and it took that same code as a parameter. The reason for this step is to separate the two halves of the flow: the part that gives you a code, and the part that uses the code. If the first half already gives you the code, the second half does not care where you got it from.

Step 2: feed the code to the activation endpoint

He supplied the value from the confirmation screen to the activation endpoint without reading a single email. The application dropped him straight onto the set a new password screen. In other words, the server accepted the code as valid proof, even though the email had never been opened. The check that was supposed to happen (did this person receive the mail?) was effectively skipped.

Step 3: set a new password and log in

He set a new password and used it to log in. No email, no second factor, no verification of any kind was needed. Second factor means a second proof of identity beyond the password, such as a code from a phone app. Total time from forgetting the password to standing inside a fully reset account was about ten minutes, and he had not sat down to test anything at all.

The researcher is explicit that this was done against his own account only. A list of company employee addresses was sitting right there and the temptation to prove impact "properly" was real, but showing that the flow leaks the code for your own account is a complete proof. Doing it to a stranger is a crime with extra steps. This is the ethical line in security testing: you may test what you own or what you are authorised to test, and you never touch another person's account to make a demonstration look more impressive.

Root cause

Stated the way it belongs in a report: the application was exposing the password reset code in the response to whoever requested the reset. The response is what the server sends back to the browser after a request; here it included the secret code. The person who requests the reset no longer has to be the person who owns the inbox. Type in someone's email address, read the code the application hands back to you, change their password.

The researcher's analysis of why this kind of bug survives is that reset flows are one of the last places in a modern application where somebody has to hand-roll something security critical. Hand-rolled means written from scratch by the team rather than taken from a well-tested library. Login is usually a library, sessions are usually a library, but password reset is glue code: generate a code, email it, look it up, expire it, swap the password. Every one of those five steps is a decision somebody made by hand. Nobody looks at it: not the developers, because it works and users stop complaining, and not testers, because the confirmation page is the most boring screen in the application. The report does not describe the server-side implementation, so the precise reason the code was rendered into the confirmation page is not stated.

Impact

An attacker who knows a victim's email address can request a reset, read the code from the response, and change the victim's password, leading to account takeover. Account takeover means logging in as someone else and having full control of their account. On this specific product, the researcher's follow-up comment to triage described what a compromised account could reach: invite users, change roles and permissions, reach client configuration, logs, event data, billing, and delete the organisation. Triage is the first stage of a bug bounty report, where a reviewer checks whether the report is real and how serious it is.

An account takeover on a personal blog and an account takeover on an identity platform are the same technical bug and completely different reports. On a blog, the worst case is someone posting nonsense in your name. On an identity platform, a compromised account can reach organisation settings, client configuration, logs, event data and billing.

The researcher notes that the same bug with a weaker writeup would be a triage note about an information leak, and cannot prove that the follow-up comment changed the severity.

Fix

The report does not describe the code change. It records that the program confirmed it had reproduced the issue, shipped a fix the same evening, and agreed it was as critical as reported. On retest, the researcher confirmed the reset code is no longer exposed anywhere in the flow.

Variants to test

These are the same checks written as things you could try on a program you are allowed to test, always on your own account:

  • Request a password reset for your own account and read the confirmation page and its URL for any value that also appears in the emailed link. A positive result is a token in the confirmation response that the activation endpoint accepts without the email being opened.
  • Submit the reset request and inspect the full response body and headers, not just the rendered page, for the reset code or a link containing it. Headers are the extra lines of information the server sends alongside the page, like the label on a parcel. A positive result is the code appearing anywhere in the response to the requester.
  • Try the activation endpoint directly with a code taken from the confirmation screen, skipping the email entirely. A positive result is landing on the set a new password screen.
  • Check whether the reset code is tied to the requesting session or IP, or accepted from any client. An IP address is the numeric label a network uses to identify a connection. A positive result is the code working from a different session or client than the one that requested it.
  • Repeat the same reading of confirmation screens in other hand-rolled flows (email verification, invite acceptance, MFA enrolment) for values that are also delivered out of band. Out of band means through a separate channel, such as email or SMS, rather than on the page itself. MFA (multi-factor authentication) is logging in with more than one proof, such as a password plus a phone code. A positive result is a secret shown to the requester before the out-of-band channel is used.
  • When a leak is confirmed on your own account, write the impact in terms of what that account can reach in the specific product, as the researcher did with organisation roles, client configuration, logs, event data, billing and deletion.

Glossary

  • Account takeover: logging in as another person and controlling their account.
  • Activation endpoint: the specific server address that the emailed reset link normally contacts to confirm the code.
  • API: a defined set of addresses and rules a program uses to talk to a server, like a service counter with named windows for each job.
  • CSRF token: a random value placed in a form to prove the form came from the site itself and not from a forged page.
  • Endpoint: a specific address on a server that performs one job when contacted.
  • Flow: a sequence of screens a user walks through to complete a task.
  • Glue code: small custom code written to connect larger pieces together, often by hand.
  • Hand-rolled: written from scratch by the team instead of taken from a tested library.
  • Headers: extra information lines the server sends with a response, separate from the page content.
  • Identity provider: a service that other companies rely on to confirm who their users are.
  • IDOR: a bug where a site uses a simple identifier to pick a record and fails to check that you are allowed to see it.
  • Interception: using a tool to sit between browser and server to read or change traffic.
  • IP address: the numeric label a network uses to identify a connection.
  • JavaScript: the language that runs in the browser and makes pages interactive.
  • MFA: logging in with more than one proof of identity, such as a password plus a phone code.
  • Out of band: delivered through a separate channel such as email or SMS rather than on the page.
  • Parameter: a named piece of data passed along with a request.
  • Parameter pollution: sending the same parameter more than once or in unexpected forms so different parts of the application read different values.
  • Password reset flow: the screens where a user asks for a reset link by email and then sets a new password.
  • Query string: the part of a URL after the question mark that carries extra data to the page.
  • Response: what the server sends back to the browser after a request.
  • Roles and permissions: the rules about who can do what inside an account.
  • Second factor: a second proof of identity beyond the password.
  • Session: the server's memory that you are logged in, which expires after a time.
  • Token: a short random-looking value that stands in for something else, like a cloakroom ticket.
  • Triage: the first review stage of a bug bounty report, checking whether it is real and how serious it is.

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.