Skip to content
Account takeover Write-up Intermediate

How I Got $250 For My Second Bug on HackerOne

A user could add a secondary email and link it to a Google account via OAuth. After the secondary email was removed and the Google account disconnected, the OAuth session remained active, allowing the attacker to still access and modify the victim's account.

Likith Teki Follow

Published on medium.com

Bounty$250 View original

{{media:0}}

Likith Teki, 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

This is a write-up of a private HackerOne program, so the target is referred to only as "domain.com". The feature in question is email management on an account: a user can hold two email addresses. The first is the primary email, the one used to create the account. The second is a secondary email, added later from the account settings. The application also supports linking a Google account through OAuth, and there is an option to disconnect that Google account.

Likith Teki
Likith Teki From the original on medium.com

The report was paid a $250 bounty, the author's second bug on HackerOne.

Setup

The researcher used two accounts and two browsers:

Browser Login method Email
Chrome primary email and password [redacted]
Firefox Google OAuth [redacted]

In the scenario, [redacted] is the secondary email added to the account, and [redacted] is the address the attacker later swaps it for. The two browsers are used to hold two sessions at once: one authenticated with the primary credentials, one authenticated through OAuth on the secondary address.

Finding it

The researcher became interested in the two-email functionality and started testing how the two addresses interact with login.

  1. Logging in with the secondary email and the account password failed, because the account had been created with the primary email.
  2. Logging in with the secondary email through Google OAuth succeeded, and gave access to the account.

That asymmetry, a secondary address that cannot be used for password login but can be used for OAuth login, is what prompted the deeper test: what happens to an OAuth session when the secondary email it was created from is removed from the account.

Exploitation

Step 1: establish both sessions

In Chrome, the researcher logged in with the primary email ([redacted]) and password. In Firefox, the researcher logged in with the secondary email ([redacted]) using Google OAuth. Both sessions now point at the same account.

Step 2: change the secondary email from the primary session

In Chrome, the secondary email was changed from [redacted] to [redacted] The Google account disconnect option was also disabled. At this point the account no longer lists [redacted] as its secondary address.

Step 3: reload the OAuth session

In Firefox, the session was reloaded. It was still active. The session created through OAuth on the now-removed secondary email had not been invalidated by the change.

Step 4: write from the stale session

From that still-active Firefox session, the researcher changed the account name and changed the secondary email from [redacted] back to [redacted] Both changes succeeded.

Step 5: confirm the write landed

The Chrome session was reloaded, and all the changes made from the stale Firefox session were reflected in it. The two sessions were still operating on the same account, and the session that should have lost its authority still had full write access.

Reproduction steps as reported

  1. Victim's actions:
    • Log in to the application using primary account credentials.
    • Add a secondary email address to the account.
    • Link the account to the secondary email's Google account using OAuth.
  2. Attacker's actions:
    • Gain access to the victim's session via Google authentication of the secondary email.
  3. Victim's actions:
    • Log in to the primary account.
    • Delete the secondary email address from the account.
    • Disconnect the Google account from the primary account.
  4. Attacker's actions:
    • Refresh the session in the attacker's browser.
  5. Observation:
    • The session remains active despite the disconnection.
    • The attacker can modify the victim's account data.

Root cause

The report describes the issue as a session management vulnerability. Removing the secondary email and disconnecting the Google account did not revoke the session that had been established through OAuth on that secondary email. The session stayed valid and kept full write access to the account.

In other words, the account-level change (unlinking the identity) and the session-level state (the authenticated session created from that identity) were not tied together: the application updated the account but did not invalidate sessions derived from the removed identity. The report does not describe the server-side implementation, so the exact mechanism is not stated.

Impact

As reported, the impact is twofold:

  • Unauthorised access: an attacker can gain unauthorised access to the victim's account by exploiting the vulnerability.
  • Privacy breach: access remains possible through a deleted but previously verified email address, compromising the privacy and security of user accounts.

The condition is that the attacker has at some point been able to authenticate through the secondary email's Google account, and that the victim later removes that secondary email and disconnects the Google account, as in the reproduction steps. The stale session then survives those removals and can still modify account data.

Fix

The report does not say what the program changed. The behaviour it describes implies that removing a secondary email, or disconnecting a linked Google account, should invalidate every session established through that identity, so that a refresh of the attacker's browser lands on an unauthenticated state and no writes are possible.

Variants to test

  1. Remove a linked OAuth identity while a session created from it is open, then refresh. A positive result is that the session is still authenticated and can still write to the account.
  2. Change the secondary email while a session created from the old secondary email is open, then refresh. A positive result is that the old session still acts on the account.
  3. Disconnect the Google account and then attempt a write (name change, email change) from the OAuth session. A positive result is that the write succeeds and is visible from another session.
  4. Repeat with other linked identity providers, if the application supports them, following the same sequence: link, log in through the provider, unlink from another session, refresh the provider session.
  5. Check whether the stale session can re-add the removed secondary email, as in the reported test where [redacted] was changed back to [redacted] A positive result is that the removed address can be restored from the session that should no longer have authority.

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

What happened, in plain words

A security researcher found a way to keep control of someone else's account after the owner had removed the thing that gave the researcher access in the first place. The account allowed two email addresses: a primary one used to sign up, and a secondary one added later in settings. The site also let you link a Google account through a system called OAuth, and let you unlink it again.

The researcher discovered that a session opened through Google OAuth on the secondary email stayed alive even after the owner deleted that secondary email and disconnected the Google account. The session could still change the account's name and email. The researcher reported it to the private bug bounty program on HackerOne and was paid $250, their second bug on the platform.

Likith Teki
Likith Teki From the original on medium.com

The pieces you need to know

Before the steps make sense, here are the ideas involved, explained from scratch.

  • Account: your personal space on a website, protected by a login. Think of it as a locker that only opens with your key.
  • Primary email: the address you used when you first created the account. It is the account's original identity.
  • Secondary email: a second address you can add later in the account settings, for example so notifications reach you somewhere else. It is an extra key to the same locker.
  • OAuth: a way to log in to one website using another company's account, such as "Sign in with Google". You never give the website your Google password; Google confirms who you are and the website trusts that confirmation. Think of it as a bouncer at a club who accepts a friend's written note instead of checking your ID himself.
  • Session: the state of being logged in. When you log in, the website gives your browser a small piece of data (often called a cookie or a token) that it presents on every later request so the site remembers you. Think of it as a wristband you get at the door: as long as you wear it, staff let you back in without checking your ID again.
  • Session management vulnerability: a flaw in how a site creates, tracks or ends sessions. The classic problem is a session that should have ended but did not, so someone keeps access they should have lost.
  • Bug bounty program: a scheme where a company invites researchers to test its systems and pays for valid reports. A private program is one you can only join by invitation.
  • Bounty: the money paid for a valid report. Here it was $250.

Setting up the test

The researcher used two accounts and two browsers, so that two separate sessions could be open at the same time against the same account.

Browser Login method Email
Chrome primary email and password [redacted]
Firefox Google OAuth [redacted]

In this scenario, [redacted] is the secondary email added to the account, and [redacted] is the address the researcher later swaps it for. Two browsers are used because each browser keeps its own session: one logged in with the primary credentials, one logged in through OAuth on the secondary address. Having both open lets you watch what one session does to the other.

Finding it

The researcher became interested in the two-email feature and started testing how the two addresses interact with login.

  1. Logging in with the secondary email and the account password failed, because the account had been created with the primary email.
  2. Logging in with the secondary email through Google OAuth succeeded, and gave access to the account.

That asymmetry is the interesting part: a secondary address that cannot be used for password login but can be used for OAuth login. It raised the obvious follow-up question: what happens to an OAuth session when the secondary email it was created from is removed from the account? If the site forgets to end that session, the person who logged in through it keeps their wristband after the door should have been closed.

Exploitation

Step 1: establish both sessions

In Chrome, the researcher logged in with the primary email ([redacted]) and password. In Firefox, the researcher logged in with the secondary email ([redacted]) using Google OAuth. Both sessions now point at the same account. This is the starting position: two valid wristbands for one locker.

Step 2: change the secondary email from the primary session

In Chrome, the secondary email was changed from [redacted] to [redacted] The Google account disconnect option was also disabled. At this point the account no longer lists [redacted] as its secondary address. In everyday terms, the owner has taken the spare key off the ring and cancelled the friend's note.

Step 3: reload the OAuth session

In Firefox, the session was reloaded. It was still active. The session created through OAuth on the now-removed secondary email had not been invalidated by the change. Reloading is the simplest test of whether a session still works: if the page comes back logged in, the wristband is still being accepted.

Step 4: write from the stale session

From that still-active Firefox session, the researcher changed the account name and changed the secondary email from [redacted] back to [redacted] Both changes succeeded. This is the important part: the session was not merely viewable, it could still make changes. The researcher even put the removed address back, undoing the owner's removal.

Step 5: confirm the write landed

The Chrome session was reloaded, and all the changes made from the stale Firefox session were reflected in it. The two sessions were still operating on the same account, and the session that should have lost its authority still had full write access. Seeing the change in the other browser proves it was saved on the server, not just displayed locally.

Reproduction steps as reported

  1. Victim's actions:
    • Log in to the application using primary account credentials.
    • Add a secondary email address to the account.
    • Link the account to the secondary email's Google account using OAuth.
  2. Attacker's actions:
    • Gain access to the victim's session via Google authentication of the secondary email.
  3. Victim's actions:
    • Log in to the primary account.
    • Delete the secondary email address from the account.
    • Disconnect the Google account from the primary account.
  4. Attacker's actions:
    • Refresh the session in the attacker's browser.
  5. Observation:
    • The session remains active despite the disconnection.
    • The attacker can modify the victim's account data.

Root cause

The report describes the issue as a session management vulnerability. Removing the secondary email and disconnecting the Google account did not revoke the session that had been established through OAuth on that secondary email. The session stayed valid and kept full write access to the account.

In other words, the account-level change (unlinking the identity) and the session-level state (the authenticated session created from that identity) were not tied together: the application updated the account but did not invalidate sessions derived from the removed identity. The report does not describe the server-side implementation, so the exact mechanism is not stated.

Impact

As reported, the impact is twofold:

  • Unauthorised access: an attacker can gain unauthorised access to the victim's account by exploiting the vulnerability.
  • Privacy breach: access remains possible through a deleted but previously verified email address, compromising the privacy and security of user accounts.

The condition is that the attacker has at some point been able to authenticate through the secondary email's Google account, and that the victim later removes that secondary email and disconnects the Google account, as in the reproduction steps. The stale session then survives those removals and can still modify account data.

Fix

The report does not say what the program changed. The behaviour it describes implies that removing a secondary email, or disconnecting a linked Google account, should invalidate every session established through that identity, so that a refresh of the attacker's browser lands on an unauthenticated state and no writes are possible.

Variants to test

  1. Remove a linked OAuth identity while a session created from it is open, then refresh. A positive result is that the session is still authenticated and can still write to the account.
  2. Change the secondary email while a session created from the old secondary email is open, then refresh. A positive result is that the old session still acts on the account.
  3. Disconnect the Google account and then attempt a write (name change, email change) from the OAuth session. A positive result is that the write succeeds and is visible from another session.
  4. Repeat with other linked identity providers, if the application supports them, following the same sequence: link, log in through the provider, unlink from another session, refresh the provider session.
  5. Check whether the stale session can re-add the removed secondary email, as in the reported test where [redacted] was changed back to [redacted] A positive result is that the removed address can be restored from the session that should no longer have authority.

Glossary

  • Primary email: the address used to create the account.
  • Secondary email: an additional address added later in the account settings.
  • OAuth: a way to log in to one site using another company's account, such as "Sign in with Google", without sharing your password with the site.
  • Session: the state of being logged in, kept alive by a cookie or token your browser sends with each request.
  • Cookie: a small piece of data a website stores in your browser, often used to remember your session.
  • Token: a piece of data, similar in purpose to a cookie, that proves your session to the server.
  • Session management vulnerability: a flaw in how a site creates, tracks or ends sessions, such as a session that stays valid after it should have ended.
  • Private program: a bug bounty program you can only join by invitation.
  • HackerOne: a platform that hosts bug bounty programs.
  • Revoke: to cancel or invalidate, for example ending a session so it no longer works.
  • Stale session: a session that is still accepted even though the reason it was created no longer applies.
  • Identity provider: the outside service, such as Google, that confirms who you are during OAuth login.
  • Write access: the ability to change data, not just view it.

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.