{"answers":{"affected":"4 open source packages ship an affected version, including devise-two-factor. It affects 1 product.","exploited":"There is no known exploitation of CVE-2024-8796 in the wild and no public exploit code.","fix":"Upgrade devise-two-factor to 6.0.0 or later.","what":"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."},"fix_prompt":"Check this codebase for CVE-2024-8796 and fix it if it is affected.\n\nWhat it is: 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.\nExploitation: There is no known exploitation of CVE-2024-8796 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- devise-two-factor (RubyGems): affected all versions; no fix listed\n- devise-two-factor (RubyGems): affected all versions; no fix listed\n- devise-two-factor (RubyGems): affected from 4.0.0; fixed in 6.0.0\n- devise-two-factor (RubyGems): affected from 4.0.0; fixed in 6.0.0\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2024-8796/ (Markdown: https://insights.sbomify.com/CVE-2024-8796/index.md)","id":"CVE-2024-8796","markdown":"https://insights.sbomify.com/CVE-2024-8796/index.md","name":"CVE-2024-8796","record":{"aliases":["DEBIAN-CVE-2024-8796","GHSA-qjxf-mc72-wjr2","UBUNTU-CVE-2024-8796"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["security_bypass"],"network_reachable":"yes","non_default_config":false,"product_category":"Ruby authentication library","requires_auth":"low_privilege","summary":"Insufficient TOTP secret length in Devise-Two-Factor allows attackers to more easily guess secrets and bypass two-factor authentication.","user_interaction":"not_required","vuln_class":"weak_cryptography"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"SNPS","cpe":[{"product":"devise-two-factor","vendor":"tinfoilsecurity"}],"cvss":{"score":6,"severity":"medium","source":"cna","vector":"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","version":"4.0"},"cwes":[{"id":"CWE-331","name":"Insufficient Entropy"}],"description":"Under the default configuration, Devise-Two-Factor versions \u003e= 2.2.0 \u0026 \u003c 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.","ecosystems":["RubyGems"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"Insufficient Default OTP Shared Secret Length","id":"CVE-2024-8796","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"RubyGems","product":null,"products":[],"type":"weak_cryptography","year":"2024"},"n_packages":4,"n_references":1,"next":{"headline":"WP Booking System – Booking Calendar \u003c= 2.0.19.8 - Reflected Cross-Site Scripting","id":"CVE-2024-8797"},"packages":[{"ecosystem":"RubyGems","fixed":[],"introduced":[],"last_affected":[],"package":"devise-two-factor","purl":null,"source":"GHSA-qjxf-mc72-wjr2"},{"ecosystem":"RubyGems","fixed":[],"introduced":[],"last_affected":[],"package":"devise-two-factor","purl":"pkg:gem/devise-two-factor","source":"GHSA-qjxf-mc72-wjr2"},{"ecosystem":"RubyGems","fixed":["6.0.0"],"introduced":["4.0.0"],"last_affected":[],"package":"devise-two-factor","purl":null,"source":"GHSA-qjxf-mc72-wjr2"},{"ecosystem":"RubyGems","fixed":["6.0.0"],"introduced":["4.0.0"],"last_affected":[],"package":"devise-two-factor","purl":"pkg:gem/devise-two-factor","source":"GHSA-qjxf-mc72-wjr2"}],"prev":{"headline":"BA Book Everything \u003c= 1.6.20 - Cross-Site Request Forgery to Email Address Update/Account Takeover","id":"CVE-2024-8795"},"products":["devise-two-factor"],"published":"2024-09-17","related":[{"cvss_score":5.3,"headline":"Improper one time password handling in devise-two-factor","id":"CVE-2021-43177","kev_date_added":null,"published":"2022-04-11"},{"cvss_score":5.3,"headline":"Tinfoil Devise-two-factor does not \"burn\" a successfully validated one-time password (OTP)","id":"CVE-2015-7225","kev_date_added":null,"published":"2017-09-06"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"none","technical_impact":"partial"},"state":"PUBLISHED","updated":"2024-09-20","vendors":["devise-two-factor"]},"summary":"Insufficient TOTP secret length in Devise-Two-Factor allows attackers to more easily guess secrets and bypass two-factor authentication.","url":"https://insights.sbomify.com/CVE-2024-8796/"}