CVE-2024-8796 Insufficient Default OTP Shared Secret Length

Medium 6.0 Published Updated

Insufficient TOTP secret length in Devise-Two-Factor allows attackers to more easily guess secrets and bypass two-factor authentication.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2024-8796?

CVE-2024-8796 is a medium-severity vulnerability in devise-two-factor, published on 17 Sep 2024. Any signed-in user can exploit it over the network, with no action from the victim.

Official 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.

Weakness: CWE-331

Which versions are affected by CVE-2024-8796?

4 open source packages ship an affected version, including devise-two-factor. It affects 1 product.

PackageAffectedFixed in
devise-two-factor RubyGemsAll versionsNone
devise-two-factor RubyGemsAll versionsNone
devise-two-factor RubyGemsFrom 4.0.06.0.0
devise-two-factor RubyGemsFrom 4.0.06.0.0

Products include Tinfoilsecurity Devise-Two-Factor.

How do I fix CVE-2024-8796?

Upgrade devise-two-factor to 6.0.0 or later.

Is CVE-2024-8796 being exploited?

There is no known exploitation of CVE-2024-8796 in the wild and no public exploit code.

Sources

Also known as DEBIAN-CVE-2024-8796, GHSA-qjxf-mc72-wjr2, UBUNTU-CVE-2024-8796.

Is CVE-2024-8796 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free