Description
Under the default configuration, Devise-Two-Factor versions >= 2.2.0 & < 6.0.0 generate TOTP shared secrets that are 120 bits instead of the 128-bit minimum defined by RFC 4226. Using a shared secret shorter than the minimum to generate a multi-factor authentication code could make it easier for an attacker to guess the shared secret and generate valid TOTP codes.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| devise-two-factor | devise-two-factor | 4.0.0 – < 6.0.0, 1.0.0 | 6.0.0 |
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 | No fix yet | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 16.04 LTS | ruby-devise-two-factor | No fix yet | — |
Show 2 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu Pro 22.04 LTS | ruby-devise-two-factor | 4.0.0-2ubuntu0.1~esm1 | USN-7050-1 |
| Ubuntu Pro 20.04 LTS | ruby-devise-two-factor | 3.1.0-2ubuntu0.1~esm1 | USN-7050-1 |
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| RubyGems | devise-two-factor | >= 4.0.0, < 6.0.0 | 6.0.0 | GHSA-qjxf-mc72-wjr2 |
| RubyGems | devise-two-factor | 1.0.0 | — | GHSA-qjxf-mc72-wjr2 |
Advisories 1
- USN-7050-1 ruby-devise-two-factor vulnerabilities Ubuntu Security Notices (USN) · Apr 27, 2026