Skip to content
Account takeover Disclosed report Beginner

Previously created sessions remain active after activating 2FA

GitLab did not invalidate existing user sessions when two-factor authentication was activated. An attacker with an already active session could continue using the account without ever providing a second factor.

GitLab

Originally disclosed on GitLab

  • Fixed in 12 months
  • Disclosed after 12 months

HackerOne report #676772 by xanbanx on 2019-08-19, assigned to jmatos_bgtvf:

Summary

I found a security problem related to your 2FA implementation. GitLab does not purge user sessions when 2FA gets activated. Instead, they are kept alive without 2FA ever was needed for them.

Steps to reproduce

  1. Create 2 session on two devices now named session A and B
  2. On session A, go to the user settings and activate 2FA
  3. On session B, reload the page. Session B is still active although it was not logged in with 2FA and can use GitLab normally.

Impact

Sessions without 2FA are kept alive when 2FA gets activated. So these sessions are still usable although 2FA was activated.

Examples

This happens on gitlab.com

What is the current bug behavior?

Older sessions are kept active when 2FA gets activated.

What is the expected correct behavior?

When 2FA gets activated, all older sessions should be purged forcing them to re-login with 2FA.

Impact

See above.

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

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the application did not revoke or re-authenticate existing sessions when the 2FA setting was enabled.

Impact

Sessions that existed before 2FA was enabled remained usable without a second factor, so an attacker holding such a session could keep accessing the account.

What the attacker needed

Attacker already has an active session; victim enables 2FA

The fix

When 2FA is activated, all older sessions should be purged so they must log in again with 2FA.

How it was found

  1. Create two sessions on two devices, called session A and session B.
  2. On session A, go to user settings and activate 2FA.
  3. On session B, reload the page and observe that it is still active and can use GitLab normally.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

Two-factor authentication (2FA) adds a second proof of identity, such as a code from a phone, on top of a password. This report says that if someone turned on 2FA, any browser that was already logged in stayed logged in without ever needing that second code. So an attacker who already had a session could keep using the account even after the owner tried to secure it.

What is Account takeover?

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.

More from GitLab

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.