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. Learn more

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 Learn

Learn about Insufficient Entropy vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-RUBY-DEVISETWOFACTOR-8023206
  • published18 Sept 2024
  • disclosed17 Sept 2024
  • creditGarrett Rappaport

Introduced: 17 Sep 2024

CVE-2024-8796  (opens in a new tab)
CWE-331  (opens in a new tab)

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