* Industrial espionage and state actors - somebody setting up a camera to record the monitor and reusing the token
* Phishing site - the token can be reused, and then redirected to original site. There wouldn't even be an error
* Keylogger
* Somebody logging in while sharing the screen during a Zoom call
* Somebody standing over the shoulder, etc.
Considering this could be prevented with a single if statement, and how important 2FA is in protecting accounts, that's certainly my impression.
The password can be found out through other means, e.g. (password reuse, phishing, keylogger, etc.)
For comparison, the exact same vulnerability was rated as medium severity (5.3/10) - high impact, but difficult to exploit
(How do you log used codes, check if a code was previously used, and clean up old used codes in a single if statement?)
Check the last login/session/whatever for that account and if it was within the period of the TOTP that was submitted, force a relog.
Allowing re-use violates the RFC:
Note that a prover may send the same OTP inside a given time-step
window multiple times to a verifier. The verifier MUST NOT accept
the second attempt of the OTP after the successful validation has
been issued for the first OTP, which ensures one-time only use of an
OTP.
* https://datatracker.ietf.org/doc/html/rfc6238#section-5This is actually the only "MUST NOT" in the entire RFC (besides the definition of the term in §2).
That said, someone with the level of access required to exploit this vulnerability isn't going to be stopped because GitLab patches it. There are plenty of other things they could do with that kind of access.
And to your other point, you're right, if your adversary already has a keylogger running on your device you're pretty much screwed in any case.
Given the engineering effort of tracking used tokens and the relatively low exploitability it seems odd to generalize to the entire organization based on this.