Devise-Two-Factor Authentication Uses Insufficient Default OTP Shared Secret Length
CVE-2024-8796GHSA-qjxf-mc72-wjr2
What to do
Partial vendor fix. Follow the primary source's mitigation guidance and check back for a fix.
This page has no inventory attached, so it cannot say whether you are affected. A vendor fix is not proof that your deployment is fixed.
Affected packages
RubyGems devise-two-factor
- Affected
- >= 4.0.0, < 6.0.0>= 1.0.0, <= 1.0.0
- Fixed in
- 6.0.0
Sources
- GitHub Advisory Database and maintainer security advisories on GitHub
GitHub-reviewed advisory GHSA-qjxf-mc72-wjr2 lists affected ranges: RubyGems devise-two-factor >=4.0.0 =1.0.0 <=1.0.0
VerifiedObserved Structured GitHub Advisory Database record (type=reviewed) from the GitHub REST API.
Severity and exploitation
- Exploitation
- No confirmed exploitation recorded. Patch Next marks exploitation only from CISA KEV.
- CVSS 4.0
- 6.0 · CVSS:4.0/AV:N/AC:H/AT:P/PR:L/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X · score source
- EPSS
- CVE-2024-8796: 0.64% estimated exploitation activity in the next 30 days; percentile 50.75 (FIRST EPSS, 2026-11-03). This is a model estimate, not proof of exploitation or customer exposure.
Source description
As published by the source; long descriptions are shortened.
Summary Under the default configuration, Devise-Two-Factor versions 1.0.0 or = 4.0.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. Remediation Devise-Two-Factor should be upgraded to version v6.0.0 as soon as possible. After upgrading, the length of shared secrets and TOTP URLs generated by the library will increase since the new shared secrets will be longer. If upgrading is not possible, you can override the default otpsecretlength attribute in the model when configuring twofactorauthenticable and set it to a value of at least 26 to ensure newly generated shared secrets are at least 128-bits long. After upgrading or implementing the workaround, applications using Devise-Two-Factor may wish to migrate users to the new OTP length to…
Dates and revisions
- Published by the source
- Last modified by the source
- Source last checked
- Revision 1 · created ·
Published from ghsa record GHSA-qjxf-mc72-wjr2
Agent brief
Preview the exact text before you copy it. Commands are read-only suggestions; review them before running anything.
# Patch Next advisory brief: CVE-2024-8796 Advisory: Devise-Two-Factor Authentication Uses Insufficient Default OTP Shared Secret Length IDs: CVE-2024-8796, GHSA-qjxf-mc72-wjr2 Record: https://patchnext.com/advisories/cve-2024-8796 (revision 1, source checked 26 Oct 2026, 15:48 UTC) Inventory: none attached. This brief comes from a public page and does not say whether any deployment is affected. Severity: Medium (CVSS 6.0) Exploitation: no confirmed exploitation recorded. Patch Next confirms exploitation only from CISA KEV. Vendor response: Partial vendor fix; fixed versions by package: devise-two-factor 6.0.0. A vendor fix does not mean a deployment is fixed. ## Affected components - RubyGems devise-two-factor: affected >= 4.0.0, < 6.0.0; >= 1.0.0, <= 1.0.0; fixed in 6.0.0 ## Suggested inspection (read-only) - RubyGems devise-two-factor: check the installed version with your package manager. ## Supported action No complete vendor fix is recorded. Follow the primary source's mitigation guidance and check this record again before closing anything. ## Required regression checks - Run the test suite and a production build. - Exercise the features that depend on devise-two-factor. - Repeat the inspection and confirm that only fixed versions remain installed. ## Rollback considerations - Keep the previous lockfile and deployment artifact. Rolling back reinstates the vulnerable version, so apply any documented mitigation while you fix forward. ## Unresolved questions - Which deployments run an affected version? - Exploitation status can change. Check again before lowering the priority. - Mark the work resolved only after the fixed version is verified in production. ## Sources - Verified: https://github.com/advisories/GHSA-qjxf-mc72-wjr2 (GitHub-reviewed advisory GHSA-qjxf-mc72-wjr2 lists affected ranges: RubyGems devise-two-factor >=4.0.0 =1.0.0 <=1.0.0) Commands are suggestions: review each one before running it.
Loading voting…