"remember_user_token" is not getting revoked - Attacker able to takeover victim account
GitLab's 'remember me' token was not revoked when a user revoked an active session, allowing an attacker who had stolen the token to log in again and create a new session. This could lead to account takeover even after the victim believed the session was terminated.
GitLab
Originally disclosed on GitLab
- Fixed in 3 months
- Disclosed after 3 months
HackerOne report #896225 by vaib25vicky on 2020-06-11, assigned to @ngeorge1:
Summary
Gitlab user have a option to revoke active session which deletes the user session and prevent attacker to access his account. BUT the remember_user_token is not getting revoked and with the help of only this token one is able to login as well as able to create new _gitlab_session token.
Steps to reproduce
(Step-by-step guide to reproduce the issue, including:)
- login as
testUserand chooseremember meoption - copy
remember_user_tokenand open new browser or incognito window - on new browser/incognito window login as
testUseragain - from original browser/window delete active session by going over settings
- refresh new browser/incognito window , you'll see your session has been revoked
- Now, paste the
remember_user_tokenand its value and refresh - Voila, you are login as
testUseragain even when session get revoked. - Go to cookies and you'll see a new
_gitlab_sessiontoken has also been created.
Impact
remember_user_token is not getting revoked - Attacker able to takeover victim account
What is the current bug behavior?
remember_user_token is not getting revoked along with session token
What is the expected correct behavior?
remember_user_token should also get revoke along with session cookie beacuse then there is no point of revoking only session token. Attacker can again login to the victim account even when he has revoke the session and access his sensitive information or change his settings
Output of checks
This bug happens on GitLab.com
Please let me know if you need more info.
Cheers,
Vaibhav Singh
Impact
remember_user_token is not getting revoked even when user opt to revoke the session and allowing an attacker to access the vicitm account again using only remember_user_token
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 session revocation logic only invalidated the session cookie and did not revoke the persistent 'remember me' token.
Impact
An attacker who has obtained the remember_user_token can regain access to the victim's account even after the victim revokes the session, potentially leading to account takeover.
What the attacker needed
Attacker has stolen remember_user_token; victim revokes session
The fix
The remember_user_token should be revoked along with the session cookie when a user revokes a session.
How it was found
- Log in as testUser and choose the 'remember me' option.
- Copy the remember_user_token and open a new browser or incognito window.
- In the new window, log in as testUser again.
- From the original browser, delete the active session via settings.
- Refresh the new window to confirm the session is revoked.
- Paste the remember_user_token and refresh to log in again as testUser, and observe a new _gitlab_session token is created.
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.
When you log in with 'remember me', the site gives your browser a special token so you stay logged in. If you later revoke a session, that token should also stop working, but here it didn't. So someone who stole the token could still get back into your account.
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.