🛡️ GHSA-chcr-x7hc-8fp8 — devise-two-factor (CVE-2024-0227)

⚪ Unknown ✅ No Known Exploit CWE-307 OSV
N/A
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

Devise-Two-Factor vulnerable to brute force attacks

Advisory withdrawn

The backing CVE has been rejected

Devise-Two-Factor does not throttle or otherwise restrict login attempts at the server by default. When combined with the Time-based One Time Password algorithm's (TOTP) inherent entropy limitations, it's possible for an attacker to bypass the 2FA mechanism through brute-force attacks.

Impact

If a user's username and password have already been compromised an attacker would be able to try possible TOTP codes and see if they can hit a lucky collision to log in as that user. The user under attack would not necessarily know that their account has been compromised.

Patches

Devise-Two-Factor has not released any fixes for this vulnerability. This library is open-ended by design and cannot solve this for all applications natively. It's recommended that any application leveraging Devise-Two-Factor implement controls at the application level to mitigate this threat. A non-exhaustive list of possible mitigations can be found below.

Mitigations

1. Use the lockable strategy from Devise to lock a user after a certain number of failed login attempts. See https://www.rubydoc.info/github/heartcombo/devise/main/Devise/Models/Lockable for more information.

2. Configure a rate limit for your application, especially on the endpoints used to log in. One such library to accomplish this is [rack-attack](https://rubygems.org/gems/rack-attack).

3. When displaying authentication errors hide whether validating a username/password combination failed or a two-factor code failed behind a more generic error message.

Acknowledgements

Christian Reitter ([Radically Open Security](https://www.radicallyopensecurity.com/)) and Chris MacNaughton ([Centauri Solutions](https://centauri.solutions))

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is high, an attacker needs low-level privileges on the target. No user interaction is required. The scope is unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality low, integrity low, availability low.

Weakness class

GHSA-chcr-x7hc-8fp8 is classified as CWE-307: Improper Restriction of Excessive Authentication Attempts. Repeated login attempts are not limited, leaving credentials open to brute forcing.

Affected software

GHSA-chcr-x7hc-8fp8 is recorded against 1 package.

  • devise-two-factor (from 1.0.0)

Timeline and source

Published on 12 January 2024 and last revised on 20 March 2024. No public exploit is currently recorded for this entry. Record sourced from OSV.

References

github.com (Web)
nvd.nist.gov (Advisory)
github.com (Package)
github.com (Web)

Details

Severity Unknown
CVSS Score N/A
CVSS Vector CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L
CWE CWE-307
Public Exploit ✅ No
Source OSV
Published 2024-01-12
Updated 2026-08-20
Modified 2024-03-20
Fix URL N/A

Affected Packages

Software From version Fixed in
devise-two-factor 1.0.0

Similar Threats

Free Vulnerability Check

Is your site affected by GHSA-chcr-x7hc-8fp8?

BotEraser helps you identify potentially vulnerable plugins and themes by checking your installation against GHSA-chcr-x7hc-8fp8 and other known CVE records.

Scan My Site Free →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.

Browse related advisories

All advisoriesGitHub AdvisoryGitHub Advisory Undated