Improper Authentication via previous backup code login
An attacker who already knew a victim's password could log in with that old password even after the victim changed it, by replaying a previously captured two-factor backup-code login response. This let the attacker keep access to the account without knowing the new password.
Originally disclosed on HackerOne
- Triaged in 4 days
- Fixed in 24 days
- Paid in 3 days
- Disclosed after 33 days
HI Basecamp,
I would like to report Improper Authentication in basecamp. Attacker is able to login at victim account once victim update his password.
attacker knows with victims email █████████ password uhn)(*123HH
victim updates his password uhn)(*123HHjcc
Step To Reproduce
==Attacker==
-
Step1 attacker know victim password and logs in
-
Step2 attacker enables 2fa in victims account.
-
Step3 attacker logs out and login back in victim account, 2fa will be prompter, attacker gaves 2fa backup code and send request to repeater and captures the response.
██████
- Step4 attacker now removes 2fa from victim account and logout.
==Victim==
- Step5 victim logs in and
changes password.fromuhn)(*123HHtouhn)(*123HHjcc
==Attacker==
-
Step6 attacker logins in
victim accountwith ==previous known password== and changes ==Step6 response with Step3 response.== -
Attacker logged in victims account even he dose not know new password of victim.
Video POC attached for your reference. ████
Thanks, @fuzzsqlb0f
Impact
Improper Authentication.
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 server accepted a replayed authentication response tied to a previous backup-code login without invalidating it when the password changed.
Impact
An attacker who already knew the old password could regain access to the victim's account after a password change, without knowing the new password.
What the attacker needed
Attacker knows the victim's password; attacker can capture a login response
How it was found
- The attacker, who knows the victim's password, logs in.
- The attacker enables two-factor authentication on the victim's account.
- The attacker logs out, logs back in, supplies a backup code, and captures the response.
- The attacker removes two-factor authentication and logs out.
- The victim logs in and changes the password.
- The attacker logs in with the old password and swaps in the captured response, gaining access.
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.
The attacker saved a response from an earlier backup-code login and reused it after the victim changed the password, and it still worked.
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.