Insufficient Entropy Affecting devise-two-factor package, versions >=2.2.0, <6.0.0


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team

    Threat Intelligence

    EPSS
    0.05% (20th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk ID SNYK-RUBY-DEVISETWOFACTOR-8023206
  • published 18 Sep 2024
  • disclosed 17 Sep 2024
  • credit Garrett Rappaport

How to fix?

Upgrade devise-two-factor to version 6.0.0 or higher.

Overview

Affected versions of this package are vulnerable to Insufficient Entropy due to the use of an insufficient default, OTP shared secret length.

Workaround

If upgrading to the fixed version is not possible, users are advised to override the default otp_secret_length attribute in the model when configuring two_factor_authenticable and set it to a value of at least 26 to ensure newly generated shared secrets are at least 128-bits long.

References

CVSS Scores

version 4.0
version 3.1
Expand this section

Snyk

Recommended
6 medium
  • Attack Vector (AV)
    Network
  • Attack Complexity (AC)
    Low
  • Attack Requirements (AT)
    Present
  • Privileges Required (PR)
    Low
  • User Interaction (UI)
    None
  • Confidentiality (VC)
    High
  • Integrity (VI)
    None
  • Availability (VA)
    None
  • Confidentiality (SC)
    None
  • Integrity (SI)
    None
  • Availability (SA)
    None