Description
Tinfoil Devise-two-factor before 2.0.0 does not strictly follow section 5.2 of RFC 6238 and does not "burn" a successfully validated one-time password (aka OTP), which allows remote or physically proximate attackers with a target user's login credentials to log in as said user by obtaining the OTP through performing a man-in-the-middle attack between the provider and verifier, or shoulder surfing, and replaying the OTP in the current time-step.
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 12 | ruby-devise-two-factor | 2.0.0-1 | — |
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| RubyGems | devise-two-factor | < 2.0.0 | 2.0.0 | GHSA-x489-jjwm-52g7 |
References
- https://github.com/tinfoil/devise-two-factor/blob/master/UPGRADING.md
- [oss-security] 20150917 Re: CVE Request: TOTP Replay Attack in Ruby library mailing-list
- [oss-sercurity] 20150620 CVE Request: MITM & Shoulder-surfing vuln in Ruby OTP/HOTP/TOTP library "ROPT" mailing-list
- 76789 vdb-entry
- https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=798466
- https://github.com/tinfoil/devise-two-factor/issues/45#issuecomment-139335608