What’s Vulnerable › Vulnerabilities
CVE-2024-8796: Insufficient Default OTP Shared Secret Length
- Severity: medium (CVSS 5.3 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 0.6% probability of exploitation in the next 30 days
- Public exploit or detection template: none known
- Published: 2024-09-17 · updated 2026-06-17
- Weakness: CWE-331
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
- devise-two-factor: from 4.0.0 before 6.0.0; 1.0.0 — fixed in 6.0.0
How to fix
Upgrade to a fixed version: devise-two-factor 6.0.0. Check the vendor advisory for mitigations.
References
Get alerted when CVE-2024-8796 or the next vulnerability affects your stack