Skip to content
Account takeover Write-up Beginner

#BugBounty — ”How I was able to hack any user account via password reset?”

The password reset and email verification links used base64-encoded email addresses and timestamps without any signature or validation. An attacker could decode the link, change the email address to another user's, and reset their password, leading to account takeover.

Bikash Gupta Follow

Published on medium.com

#### Bikash Gupta

Bikash Gupta, 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. 5 min read.

Context

The target is a website the author refers to as www.example.com, which offers user accounts with a password reset (forget password) flow and an email verification flow for new sign-ups. Both flows are driven by links sent to the user by email. The password reset link takes the user to a page under /members/update-password/, and the verification link takes the user to /members/email-verification. In both cases the identifying data is carried in the URL path as Base64-encoded segments.

The author describes the issue as a critical but simple vulnerability found during a bug bounty hunt.

Setup

The only precondition described is an ordinary user interaction with the site: the author could not remember the password for an account on www.example.com and used the forget password function. No special role, paid plan or privileged access is mentioned. The tooling named in the report is Burp Suite, used both to inspect the reset link and to decode it with its built-in decoder. No versions are given.

Finding it

After requesting a password reset, the author received the reset email and noticed that the link contained Base64-encoded values. That alone is not a vulnerability, but it is a signal worth following: encoding is not protection, and anything a client can decode can be read and, more importantly, modified. The author inspected the link in Burp Suite and found this structure:

Text
https://www.example.com/members/update-password/<base64 encoded>/<base64 encoded2>
Image for post
Image for post From the original on medium.com

The image shows the reset link as it appeared when inspected in Burp Suite, with the two Base64 segments in the path.

Exploitation

Step 1: Decode the reset link

Using the Burp Suite decoder, the author decoded the two path segments. The first segment decoded to an email address followed by the company name:

Text
<email address>- -<company name>

The second segment decoded to a GMT timestamp followed by the company name again:

Text
<GMT +00 DateTime>- -<company name>

So the reset link is not a bearer secret at all. It is a readable, client-side encoding of the account identifier (the email address) plus the time at which the reset was requested. The company name appears to be a fixed suffix in both segments.

Step 2: Compare with the verification link

The author then signed up for a new account and looked at the verification email, which had the same shape:

Text
https://www.example.com/members/email-verification<base64 encoded>/<base64 encoded2>

Both the forget password link and the verification link use nothing but Base64 encoding. In each case the first segment decodes to the email address of the account being reset or verified, and the second decodes to the GMT timestamp of the request, both with the company name appended. The two flows share the same construction.

Step 3: Obtain a victim email address

The author visited the company's Facebook page and found many email addresses of valid user accounts in the comments. This is the only source of victim identifiers described in the report. The author considered resetting the password of one of those addresses but stopped, noting that it would not be ethical to test a real user's account without the company's permission, and that a separate test account should be used instead.

Step 4: Forge the link for another account

Because the first path segment is simply the Base64 encoding of the victim's email address plus the company name, an attacker who knows a victim's email address can construct the reset link for that account without ever receiving the email. The timestamp segment is likewise attacker-visible and attacker-controlled in the same way. Submitting the forged link to /members/update-password/ would, in the author's reasoning, let the attacker set a new password for the victim. The report does not show the forged request or the server's response; the reasoning is that the link carries no secret that the attacker cannot compute.

Root cause

The reset and verification links identify the account by an encoded email address and a timestamp, with no unguessable, server-side secret bound to the request. Base64 is an encoding, not a security control: it is trivially reversible and, more importantly, trivially forgeable by anyone who knows the input. A correct design would use a high-entropy random token stored server-side, tied to the account and to a short expiry, and invalidated after use. The report does not describe any server-side validation of the link.

Impact

An attacker who can learn a victim's email address can reset that user's password and take over the account. The report's example source of victim addresses is public comments on the company's Facebook page, but any source of valid addresses would do. The author notes that users should never share their email address publicly.

Fix

The author reported the vulnerability to the company, which patched it quickly. Based on the root cause, the fix would be to replace the encoded email and timestamp with a random, single-use token stored server-side and bound to the account and a short expiry, so that possession of the emailed link, not knowledge of the email address, is what authorises the reset.

Variants to test

  1. Encoded identifiers in reset or verification links. Request a reset and decode every path segment and query parameter. A positive result is a segment that decodes to an email address, user ID, username or timestamp, which you can then re-encode for another account you control.
  2. Predictable tokens. Compare tokens issued for two accounts you own. If the only difference is the account identifier or a counter, the token is forgeable.
  3. Timestamp-only binding. Request two resets for the same account at different times and check whether the token changes only in its timestamp portion. If so, the token is not a secret.
  4. Cross-flow reuse. Check whether the verification link and the reset link share the same construction, as they did here. A positive result is that a token from one flow is accepted by the other, or that both are forgeable in the same way.
  5. Token lifetime and reuse. After a successful reset, try the same link again. A positive result is that the link still works, which extends the window for an attacker who has obtained one.

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

What happened, in plain words

A security researcher was hunting for bugs on a website (he calls it www.example.com) as part of a bug bounty programme. A bug bounty is an arrangement where a company invites outside people to look for security problems in its systems and report them, often in exchange for a reward. The researcher found that the website's password reset link was built from the user's email address and a timestamp, both merely Base64-encoded. He reported it, the company fixed it quickly, and he wrote the story up.

The key idea is simple. When you forget your password, most websites email you a special link. That link should contain a long, random, unguessable code, so that only the person who received the email can use it. On this site, the link instead contained the user's email address and the time of the request, both merely encoded with Base64. Base64 is a way of turning data into a string of letters and digits so it can travel safely inside a URL. It is not encryption and it is not a secret: anyone can decode it, and anyone can encode their own values. So an attacker could build the reset link for any account whose email address they knew, without ever receiving the email.

Background: the pieces involved

Before walking through the steps, here are the concepts you need.

  • User account: a record on a website that belongs to one person, protected by a password. Logging in proves you are that person.
  • Password reset (forget password) flow: the feature you use when you cannot remember your password. You enter your email address, the site sends you an email with a link, and clicking the link lets you set a new password.
  • Email verification flow: the feature a site uses to check that a new sign-up really owns the email address they typed in. The site sends a link to that address, and clicking it confirms the account.
  • URL: the address of a page, like https://www.example.com/members/update-password/. The part after the domain, here /members/update-password/, is called the path. Extra pieces can be added to the path, separated by slashes.
  • Base64: an encoding scheme. It takes any data (text, bytes) and represents it using 64 printable characters. It is used so that data can be placed inside URLs, emails and other text-only places without breaking them. Encoding is reversible by anyone; it provides no secrecy. Think of it like writing a message in a different alphabet: anyone who knows the alphabet can read it.
  • Token: a value that stands in for proof of something, usually a secret. In a well-built reset flow, the token is a long random string that the server remembers and checks. If you have the token, you can reset the password; if you do not, you cannot.
  • Burp Suite: a tool used by security testers to inspect and modify the traffic between a browser and a website. It can pause a request, show you exactly what is being sent, and let you change it before it goes on. It also has a built-in decoder for Base64 and other encodings.
  • Account takeover: a class of vulnerability where an attacker gains control of someone else's account, usually by changing its password or otherwise logging in as them.
  • IDOR (Insecure Direct Object Reference): a vulnerability where a system uses a real identifier (like an email address or a user ID) in a place where the user can see and change it, without checking that the user is allowed to act on that identifier. Here, the reset link directly references the account by its email address.

The setup

The researcher did not need any special access. He simply could not remember the password for his own account on www.example.com, so he clicked the forget password link. That is the only precondition described. The tool he used was Burp Suite, both to look at the reset link and to decode it with its built-in decoder. No version numbers are given.

Finding it

After requesting the reset, the researcher received the email and noticed that the link contained Base64-encoded values. That on its own is not a bug: plenty of sites encode data in URLs. But it is a signal worth following, because encoding is not protection. Anything the browser can decode, an attacker can decode too, and, more importantly, anything the browser can send, an attacker can change. The researcher inspected the link in Burp Suite and saw this structure:

Text
https://www.example.com/members/update-password/<base64 encoded>/<base64 encoded2>
Image for post
Image for post From the original on medium.com

The image shows the reset link as it appeared when inspected in Burp Suite, with the two Base64 segments in the path.

Line by line:

  • https://www.example.com is the site's domain.
  • /members/update-password/ is the path to the page that handles setting a new password.
  • <base64 encoded> is the first placeholder: a Base64 string that the site put there.
  • <base64 encoded2> is the second placeholder: another Base64 string.

The two placeholders are not literal text in the real link; they stand for the actual encoded values the researcher saw. The important observation is that the account is identified by data in the URL itself, not by a random secret stored on the server.

Exploitation

Step 1: Decode the reset link

Using the Burp Suite decoder, the researcher decoded the two path segments. The first segment decoded to an email address followed by the company name:

Text
<email address>- -<company name>

The second segment decoded to a GMT timestamp followed by the company name again:

Text
<GMT +00 DateTime>- -<company name>

Line by line:

  • <email address> is the address of the account the reset was requested for. This is the account identifier.
  • - - is a literal separator that appeared in the decoded text.
  • <company name> is a fixed suffix that appears in both segments.
  • <GMT +00 DateTime> is the date and time, in GMT (Greenwich Mean Time, the +00 time zone), when the reset was requested.

So the reset link is not a secret at all. It is a readable encoding of the account's email address plus the time the reset was requested. The company name is a fixed suffix in both segments. Anyone who knows a victim's email address can produce the first segment themselves, and the timestamp is not secret either.

Step 2: Compare with the verification link

The researcher then signed up for a new account and looked at the verification email, which had the same shape:

Text
https://www.example.com/members/email-verification<base64 encoded>/<base64 encoded2>

Line by line:

  • https://www.example.com is the same domain.
  • /members/email-verification is the path to the page that confirms a new account's email address.
  • <base64 encoded> and <base64 encoded2> are again two Base64 segments, in the same positions as in the reset link.

Both the forget password link and the verification link use nothing but Base64 encoding. In each case the first segment decodes to the email address of the account being reset or verified, and the second decodes to the GMT timestamp of the request, both with the company name appended. The two flows share the same construction.

Step 3: Obtain a victim email address

The researcher visited the company's Facebook page and found many email addresses of valid user accounts in the comments. This is the only source of victim identifiers described in the report. He considered resetting the password of one of those addresses but stopped, noting that it would not be ethical to test a real user's account without the company's permission, and that a separate test account should be used instead. That is a good habit: when you test, use accounts you own or accounts the company has explicitly given you permission to use.

Step 4: Forge the link for another account

Because the first path segment is simply the Base64 encoding of the victim's email address plus the company name, an attacker who knows a victim's email address can construct the reset link for that account without ever receiving the email. The timestamp segment is likewise visible and controllable in the same way. Submitting the forged link to /members/update-password/ would, in the author's reasoning, let the attacker set a new password for the victim. The report does not show the forged request or the server's response; the reasoning is that the link carries no secret the attacker cannot compute.

Root cause

The reset and verification links identify the account by an encoded email address and a timestamp, with no unguessable, server-side secret bound to the request. Base64 is an encoding, not a security control: it is trivially reversible and, more importantly, trivially forgeable by anyone who knows the input. A correct design would use a high-entropy random token stored server-side, tied to the account and to a short expiry, and invalidated after use. The report does not describe any server-side validation of the link.

Impact

An attacker who can learn a victim's email address can reset that user's password and take over the account. The report's example source of victim addresses is public comments on the company's Facebook page, but any source of valid addresses would do. The author notes that users should never share their email address publicly.

Fix

The researcher reported the vulnerability to the company, which patched it quickly. Based on the root cause, the fix would be to replace the encoded email and timestamp with a random, single-use token stored server-side and bound to the account and a short expiry, so that possession of the emailed link, not knowledge of the email address, is what authorises the reset.

Variants to test

If you want to look for similar problems on sites you are allowed to test, here are the checks the technical write-up lists. Each one is a small experiment you can do with your own accounts.

  1. Encoded identifiers in reset or verification links. Request a reset and decode every path segment and query parameter. A positive result is a segment that decodes to an email address, user ID, username or timestamp, which you can then re-encode for another account you control.
  2. Predictable tokens. Compare tokens issued for two accounts you own. If the only difference is the account identifier or a counter, the token is forgeable.
  3. Timestamp-only binding. Request two resets for the same account at different times and check whether the token changes only in its timestamp portion. If so, the token is not a secret.
  4. Cross-flow reuse. Check whether the verification link and the reset link share the same construction, as they did here. A positive result is that a token from one flow is accepted by the other, or that both are forgeable in the same way.
  5. Token lifetime and reuse. After a successful reset, try the same link again. A positive result is that the link still works, which extends the window for an attacker who has obtained one.

Glossary

  • Base64: an encoding scheme that represents data using 64 printable characters, used to carry data inside URLs and emails. It is reversible by anyone and provides no secrecy.
  • Bug bounty: an arrangement where a company invites outside people to look for security problems in its systems and report them, often in exchange for a reward.
  • Burp Suite: a tool used by security testers to inspect and modify the traffic between a browser and a website, with a built-in decoder for Base64 and other encodings.
  • Email verification flow: the feature a site uses to check that a new sign-up really owns the email address they typed in, by sending a link to that address.
  • GMT: Greenwich Mean Time, the time zone at +00 offset from UTC.
  • High-entropy random token: a long random value with so many possible outcomes that guessing it is impractical.
  • Password reset (forget password) flow: the feature you use when you cannot remember your password; the site emails you a link that lets you set a new one.
  • Path: the part of a URL after the domain, for example /members/update-password/.
  • Token: a value that stands in for proof of something, usually a secret; in a well-built reset flow it is a long random string the server remembers and checks.
  • URL: the address of a page on the web.

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.