Skip to content
Account takeover Disclosed report Beginner

2FA Bypass via Leaked Cookies

The report claims that after completing 2FA, copying session cookies to another browser grants access without the 2FA code. An attacker who steals cookies could bypass the second factor and access the account.

deepmarketer Follow

Originally disclosed on HackerOne

Medium 6.8 View original
  • Disclosed after 3 months

Summary: The discovered vulnerability allows for the bypass of Two-Factor Authentication (2FA) mechanisms through the exploitation of leaked cookies. By intercepting and utilizing these cookies, an attacker can gain unauthorized access to user accounts without the need for the second authentication factor, compromising the security of the system.

Description: The discovered vulnerability allows attackers to bypass Two-Factor Authentication (2FA) mechanisms by exploiting leaked cookies, compromising the security of user accounts within the hackerone. Two-Factor Authentication is a widely adopted security measure that adds an additional layer of protection beyond passwords, typically requiring users to provide a secondary authentication factor such as a code generated by an authenticator app . The vulnerability described herein enables attackers to bypass this additional security layer through the interception and utilization of session cookies, thus gaining unauthorized access to user accounts without the need for the secondary authentication factor.

Steps To Reproduce

  1. Navigate to the account settings and enable 2FA.

  2. Log out and log back in using valid credentials.

  3. Enter the required 2FA code to proceed.

4.Export session cookies using a cookie editor tool.

5.Paste the copied cookies into another browser

6 Access the account without providing the 2FA code,2FA Authentication bypassed.

Mitigation:

Introduce device-based Two-Factor Authentication (2FA) mechanisms that require additional verification steps when signing in from new or unrecognized devices, browsers, or locations. This adds an extra layer of security by verifying the identity of the user and the device being used for authentication.

Supporting Material/References

POC Attached

Impact

The vulnerability allows attackers to bypass Two-Factor Authentication (2FA) mechanisms by stealing and utilizing session cookies obtained through various means, such as man-in-the-middle (MitM) attacks using tools like Evilginx2. By exploiting this vulnerability, attackers can gain unauthorized access to user accounts without the need for the second authentication factor, compromising the security of the system and potentially leading to unauthorized data access, fraudulent transactions, or other malicious activities.

The original report as published on HackerOne, by deepmarketer. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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

HackerOne's own web application, www.hackerone.com, is the target here. The feature under scrutiny is Two-Factor Authentication (2FA), the second step that normally sits between a correct password and a usable session. As the report describes it, 2FA is a widely adopted measure that adds a layer beyond the password, typically asking for a code generated by an authenticator app.

The claim is that this second layer can be skipped entirely by reusing session cookies. If an attacker can obtain a victim's cookies, they can present them to the application and land in an authenticated session without ever supplying the 2FA code. The report classifies this as an authentication bypass and rates it medium severity, CVSS 6.8, under the generic "Improper Authentication" weakness.

Setup

The report does not name specific versions, browsers or cookie editor tools. What it does require is straightforward:

  1. A HackerOne account with 2FA enabled in the account settings.
  2. Valid credentials for that account, used to log out and log back in.
  3. The 2FA code for that account, entered once during the login flow.
  4. A cookie editor tool, used to export the session cookies from the browser.
  5. A second browser, into which the exported cookies are pasted.

The precondition that matters for the attack is the ability to obtain the victim's cookies. The report frames this as cookies "obtained through various means", and names man-in-the-middle attacks using tools such as Evilginx2 as one route.

Finding it

The report shows that cookies exported after a 2FA login are accepted in another browser without the code. Once a session has been established after a successful 2FA entry, the resulting cookies are sufficient on their own: presenting them elsewhere produces an authenticated session, and the application does not ask again for the second factor. In other words, the possession of the session cookie is treated as equivalent to having completed 2FA.

That is what makes the behaviour look wrong. A second factor is supposed to bind authentication to something the user has or knows beyond the password. If a copied cookie grants the same access as a full login, then anyone who captures that cookie inherits the completed 2FA state without ever proving the second factor.

Exploitation

Step 1: enable 2FA

Navigate to the account settings and enable 2FA. This puts the account into the state the rest of the steps depend on: a login that should require a second factor.

Step 2: log out and log back in

Log out and log back in using valid credentials. The password step succeeds as normal.

Step 3: enter the 2FA code

Enter the required 2FA code to proceed. At this point the session is fully authenticated, having passed both factors.

Step 4: export the session cookies

Export session cookies using a cookie editor tool. The report does not list the individual cookie names or values, so the exact set exported is not documented.

Step 5: paste the cookies into another browser

Paste the copied cookies into another browser. This simulates an attacker who has captured the cookies and is replaying them from their own client.

Step 6: access the account

Access the account without providing the 2FA code. The session is accepted and the account is reachable; as the report puts it, 2FA authentication is bypassed.

The report includes a proof of concept as supporting material ("POC Attached"), but no request or response excerpts are reproduced in the text.

Root cause

The report shows that a session cookie exported after 2FA is accepted in another browser without the second factor. The 2FA gate exists only at login time; once passed, the resulting cookie is a bearer credential that carries the authenticated state with it. Anyone holding the cookie is treated as having passed 2FA.

The report's mitigation proposal asks for device-based verification when signing in from new or unrecognised devices, browsers or locations. The report's own mitigation proposal points in exactly this direction: it asks for device-based verification when signing in from new or unrecognised devices, browsers or locations. Existing defences, namely the 2FA prompt itself, did not stop the attack because the prompt is never reached on a replayed session.

Impact

An attacker who obtains a victim's session cookies can access the victim's account without the second factor. The report lists the routes by which cookies might be stolen, including man-in-the-middle attacks using tools such as Evilginx2.

The consequences it names are unauthorised access to user accounts, potentially leading to unauthorised data access, fraudulent transactions or other malicious activities. The severity assigned is medium, CVSS 6.8. The attack depends on first obtaining the victim's cookies.

Fix

The report proposes introducing device-based 2FA mechanisms that require additional verification steps when signing in from new or unrecognised devices, browsers or locations. The stated aim is to verify the identity of both the user and the device being used for authentication, so that a replayed cookie alone is not enough. The report does not describe any fix that was actually deployed.

Variants to test

  1. Cookie replay across browsers. Complete a full login with 2FA in one browser, export the cookies, and import them into a clean browser profile. A positive result is an authenticated session in the second browser with no 2FA prompt.
  2. Cookie replay after password change. Change the account password after exporting the cookies, then replay them. If the old session still works, session invalidation on credential change is also missing.
  3. Partial-session cookies. Capture the cookies present between the password step and the 2FA step, then try to use them to reach authenticated pages directly. A positive result is access to account functionality before the second factor is supplied.
  4. Device and user-agent changes. Replay the cookies with a different user agent or from a different network location. If the application accepts the session without any additional verification, device binding is absent.
  5. Long-lived sessions. Check how long a replayed cookie remains valid. A positive result is a session that survives well beyond what the application's own policy suggests.

Hunting notes

This class of bug hides in the boundary between the login flow and the session store. The signal during testing is simple: after completing 2FA, copy the cookies out and see whether a fresh client is treated as fully authenticated. If it is, the second factor is only protecting the login form, not the account.

It is worth testing on any application where 2FA is offered, particularly where sessions are long-lived or where the login flow spans multiple steps. The report's impact argument rests on the cookie theft precondition, which it illustrates with man-in-the-middle tooling such as Evilginx2; framing the finding that way, as a realistic capture-and-replay scenario rather than a theoretical one, is what gives the issue weight for a program.

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

What happened, in plain words

HackerOne runs a website at www.hackerone.com where people sign in to their accounts. Like many sites, it offers Two-Factor Authentication (2FA): after you type your password, the site asks for a second proof that it is really you, usually a short code from an app on your phone. The idea is that a stolen password alone is not enough to get in.

This report says that second step can be skipped. When you sign in successfully, the website gives your browser a small piece of data called a session cookie. That cookie is what the site checks on every later page to know who you are, so you do not have to type your password again and again. The researcher showed that copying the session cookies after a 2FA login into another browser gave access without the 2FA code. The site treats the cookie as proof that 2FA was already completed.

The report rates this as a medium severity issue, CVSS 6.8, under the weakness category "Improper Authentication". The catch, which the report itself stresses, is that an attacker first has to get hold of the victim's cookie. The report names man-in-the-middle attacks, using tools such as Evilginx2, as one way that could happen.

The target and the feature

The product

www.hackerone.com is HackerOne's own web application. A web application is simply a program you use through a browser: you open a page, the page shows forms and buttons, and when you submit something the browser sends your input to a server somewhere and shows you the reply.

Two-Factor Authentication

2FA is the second step that normally sits between a correct password and a usable session. "Session" here means the period during which the site remembers you as signed in. As the report describes it, 2FA is a widely adopted measure that adds a layer beyond the password, typically asking for a code generated by an authenticator app.

A simple comparison: a password is like a key to your front door. 2FA is like the door also asking for a code that changes every minute, so that someone who copied your key still cannot get in on their own.

Cookies

A cookie is a small label the website sticks on your browser. After you sign in, the site hands your browser a session cookie, and the browser shows that label back on every request. The server reads the label and knows "this is the person who signed in earlier". You never see this happen; it is automatic.

The important property, and the heart of this report, is that a cookie is a bearer credential. "Bearer" means: whoever holds it is treated as the owner. It is like a cloakroom ticket. The attendant does not check your face, only the ticket. If someone else picks up your ticket, they get your coat.

The vulnerability class

An authentication bypass means getting past a login check without satisfying it properly. Here the check being bypassed is the 2FA step. The report files it under the generic "Improper Authentication" weakness, which is a broad label for cases where a system does not verify identity the way it should.

Setup

The report does not name specific versions, browsers or cookie editor tools. What it does require is straightforward:

  1. A HackerOne account with 2FA enabled in the account settings.
  2. Valid credentials for that account, used to log out and log back in.
  3. The 2FA code for that account, entered once during the login flow.
  4. A cookie editor tool, used to export the session cookies from the browser.
  5. A second browser, into which the exported cookies are pasted.

A cookie editor tool is a browser add-on that lets you look at the cookies your browser is holding and copy them out as text. The second browser stands in for the attacker's own computer: it is a clean client that has never signed in, so anything it can reach must be coming from the pasted cookie.

The precondition that matters for the attack is the ability to obtain the victim's cookies. The report frames this as cookies "obtained through various means", and names man-in-the-middle attacks using tools such as Evilginx2 as one route. A man-in-the-middle attack is when the attacker quietly sits between you and the website, passing messages back and forth, and can read or copy what goes past, including your cookie.

Finding it

The report shows that cookies exported after a 2FA login are accepted in another browser without the code. In plain terms: the site asks for the code while you are going through the sign-in pages, but once that is done, the cookie it gives you is enough on its own. Present that cookie anywhere else and you get a signed-in session, and the site does not ask again for the second factor. Possession of the session cookie is treated as equivalent to having completed 2FA.

That is what makes the behaviour look wrong. A second factor is supposed to tie your sign-in to something you have or know beyond the password. If a copied cookie grants the same access as a full login, then anyone who captures that cookie inherits the completed 2FA state without ever proving the second factor. The lock is on the front door only; the key to the back door is the cookie.

Exploitation

The report lays the attack out as six steps. Each one is listed below with the reason it is there.

Step 1: enable 2FA

Navigate to the account settings and enable 2FA. This puts the account into the state the rest of the steps depend on: a login that should require a second factor. Without 2FA switched on there would be nothing to bypass.

Step 2: log out and log back in

Log out and log back in using valid credentials. The password step succeeds as normal. Logging out first makes sure you are starting from a fresh sign-in, exactly as a real user would, rather than reusing a session that was already open.

Step 3: enter the 2FA code

Enter the required 2FA code to proceed. At this point the session is fully authenticated, having passed both factors. This is the moment the site hands your browser the cookie that carries the "already passed 2FA" state.

Step 4: export the session cookies

Export session cookies using a cookie editor tool. The report does not list the individual cookie names or values, so the exact set exported is not documented. The point of this step is to take a copy of the credential the site will trust later.

Step 5: paste the cookies into another browser

Paste the copied cookies into another browser. This simulates an attacker who has captured the cookies and is replaying them from their own client. Replaying means simply presenting the same data again from somewhere else.

Step 6: access the account

Access the account without providing the 2FA code. The session is accepted and the account is reachable; as the report puts it, 2FA authentication is bypassed. No code was typed in the second browser, yet the site let it in, which is the proof of the finding.

The report includes a proof of concept as supporting material ("POC Attached"), but no request or response excerpts are reproduced in the text.

Root cause

The report shows that a session cookie exported after 2FA is accepted in another browser without the second factor. The 2FA gate exists only at login time; once passed, the resulting cookie is a bearer credential that carries the authenticated state with it. Anyone holding the cookie is treated as having passed 2FA.

The report's mitigation proposal asks for device-based verification when signing in from new or unrecognised devices, browsers or locations. Binding means tying the session to something specific about the original client, so that the same cookie used from a different place looks suspicious. The report's own mitigation proposal points in exactly this direction: it asks for device-based verification when signing in from new or unrecognised devices, browsers or locations. The existing defence, the 2FA prompt itself, did not stop the attack because the prompt is never reached on a replayed session.

Impact

An attacker who obtains a victim's session cookies can access the victim's account without the second factor. The report lists the routes by which cookies might be stolen, including man-in-the-middle attacks using tools such as Evilginx2.

The consequences it names are unauthorised access to user accounts, potentially leading to unauthorised data access, fraudulent transactions or other malicious activities. The severity assigned is medium, CVSS 6.8. The attack depends on first obtaining the victim's cookies. CVSS is a scoring system that turns the characteristics of a flaw into a number, so that programs can compare issues consistently.

Fix

The report proposes introducing device-based 2FA mechanisms that require additional verification steps when signing in from new or unrecognised devices, browsers or locations. The stated aim is to verify the identity of both the user and the device being used for authentication, so that a replayed cookie alone is not enough. The report does not describe any fix that was actually deployed.

Variants to test

These are further experiments in the same spirit, useful for anyone learning how this class of bug is probed. Each one changes a single thing and watches whether the site still lets the replayed session through.

  1. Cookie replay across browsers. Complete a full login with 2FA in one browser, export the cookies, and import them into a clean browser profile. A positive result is an authenticated session in the second browser with no 2FA prompt.
  2. Cookie replay after password change. Change the account password after exporting the cookies, then replay them. If the old session still works, session invalidation on credential change is also missing. Invalidation means deliberately cancelling old sessions when something security-relevant changes.
  3. Partial-session cookies. Capture the cookies present between the password step and the 2FA step, then try to use them to reach authenticated pages directly. A positive result is access to account functionality before the second factor is supplied.
  4. Device and user-agent changes. Replay the cookies with a different user agent or from a different network location. If the application accepts the session without any additional verification, device binding is absent. A user agent is the short description of browser and operating system that your browser sends with each request.
  5. Long-lived sessions. Check how long a replayed cookie remains valid. A positive result is a session that survives well beyond what the application's own policy suggests.

Hunting notes

This class of bug hides in the boundary between the login flow and the session store. The signal during testing is simple: after completing 2FA, copy the cookies out and see whether a fresh client is treated as fully authenticated. If it is, the second factor is only protecting the login form, not the account.

It is worth testing on any application where 2FA is offered, particularly where sessions are long-lived or where the login flow spans multiple steps. The report's impact argument rests on the cookie theft precondition, which it illustrates with man-in-the-middle tooling such as Evilginx2; framing the finding that way, as a realistic capture-and-replay scenario rather than a theoretical one, is what gives the issue weight for a program.

Glossary

  • 2FA (Two-Factor Authentication): a sign-in step that asks for a second proof beyond the password, typically a code from an authenticator app.
  • Account settings: the pages on a website where you change things about your account, such as turning 2FA on or off.
  • Authentication: the process of proving who you are to a system, usually with a password and possibly a second factor.
  • Authentication bypass: getting past a login check without satisfying it properly.
  • Authenticator app: a phone app that generates short codes that change every minute, used as a second factor.
  • Bearer credential: a piece of data that grants access to whoever holds it, with no further check of identity, like a cloakroom ticket.
  • Binding (device binding): tying a session to a specific device or client, so the same session used elsewhere can be spotted.
  • Browser: the program you use to view websites, such as Chrome or Firefox.
  • Browser profile: a separate set of settings and stored data inside a browser, effectively a clean identity for testing.
  • Cookie: a small piece of data a website stores in your browser and reads back on later requests, often used to remember that you are signed in.
  • Cookie editor tool: a browser add-on that lets you view, copy and paste cookies.
  • Credentials: the details you use to sign in, such as a username and password.
  • CVSS: a scoring system that turns the characteristics of a security flaw into a number, so issues can be compared consistently.
  • Evilginx2: a tool named in the report for man-in-the-middle attacks that can capture session cookies.
  • Export (cookies): copying cookies out of a browser as text so they can be used elsewhere.
  • Improper Authentication: a broad weakness category for systems that do not verify identity the way they should.
  • Invalidation (session invalidation): deliberately cancelling existing sessions, for example when a password changes.
  • Login flow: the sequence of pages and checks a user goes through to sign in.
  • Man-in-the-middle (MitM) attack: an attack where someone sits between you and a website, relaying messages and reading or copying what passes through.
  • Medium severity: a rating band indicating a real but not the most severe kind of issue.
  • Password: the secret you type to prove your identity at sign-in.
  • Proof of concept (POC): a demonstration, often screenshots or a recording, showing that an attack really works.
  • Replay: presenting captured data, such as a cookie, again from another client to see whether it is accepted.
  • Request and response: the message your browser sends to a server, and the message the server sends back.
  • Root cause: the underlying design or coding reason a flaw exists.
  • Server: the computer that runs a website and answers requests from browsers.
  • Session: the period during which a website remembers you as signed in.
  • Session cookie: the cookie that carries your signed-in state, checked by the site on each request.
  • Session store: the place on the server side where information about active sessions is kept.
  • User agent: the short description of browser and operating system that your browser sends with each request.
  • Web application: a program you use through a browser, where forms and buttons send your input to a server.
  • Weakness category: a label used to group similar kinds of security flaws.

More from HackerOne

View all

The newest disclosed reports for this program.

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.