{"id":"CVE-2021-43177","aliases":["DEBIAN-CVE-2021-43177","EUVD-2022-1774","GHSA-jm35-h8q2-73mp","UBUNTU-CVE-2021-43177","USN-7050-1"],"status":"published","title":"Improper one time password handling in devise-two-factor","description":"As a result of an incomplete fix for CVE-2015-7225, in versions of devise-two-factor prior to 4.0.2 it is possible to reuse a One-Time-Password (OTP) for one (and only one) immediately trailing interval. CVSS Vector: (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N)","severity":{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N","level":"medium","assessor":"primary","from":"nvd"},"epss":{"day":"2026-11-12","score":0.00884,"percentile":0.59693,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-254"],"published":"2022-04-07T22:09:03Z","modified":"2026-10-23T18:04:38Z","fixes":[{"ecosystem":"RubyGems","package":"devise-two-factor","fixed_in":["4.0.2"],"sources":["ghsa","osv"]},{"ecosystem":"Debian:12","package":"ruby-devise-two-factor","fixed_in":["4.0.2-1"],"sources":["osv"]},{"ecosystem":"Ubuntu:Pro:20.04:LTS","package":"ruby-devise-two-factor","fixed_in":["3.1.0-2ubuntu0.1~esm1"],"sources":["osv"]},{"ecosystem":"Ubuntu:Pro:22.04:LTS","package":"ruby-devise-two-factor","fixed_in":["4.0.0-2ubuntu0.1~esm1"],"sources":["osv"]}],"affected":[{"source":"ghsa","ecosystem":"RubyGems","package":"devise-two-factor","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.0.2"}]}]},{"source":"osv","ecosystem":"Debian:12","package":"ruby-devise-two-factor","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.0.2-1"}]}]},{"source":"osv","ecosystem":"RubyGems","package":"devise-two-factor","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.0.2"}]}],"versions":["1.0.0","1.0.1","1.0.2","1.1.0","2.0.0","2.0.1","2.1.0","2.2.0","2.2.1","3.0.0","3.0.1","3.0.2","3.0.3","3.1.0","4.0.0","4.0.1"]},{"source":"osv","ecosystem":"Ubuntu:16.04:LTS","package":"ruby-devise-two-factor","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.1.0-1","2.0.0-1"]},{"source":"osv","ecosystem":"Ubuntu:Pro:20.04:LTS","package":"ruby-devise-two-factor","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.1.0-2ubuntu0.1~esm1"}]}],"versions":["3.0.3-2","3.1.0-2"]},{"source":"osv","ecosystem":"Ubuntu:Pro:22.04:LTS","package":"ruby-devise-two-factor","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.0.0-2ubuntu0.1~esm1"}]}],"versions":["3.1.0-2","4.0.0-2"]},{"source":"osv","ecosystem":"Ubuntu:Pro:20.04:LTS","package":"ruby-devise-two-factor","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.1.0-2ubuntu0.1~esm1"}]}],"versions":["3.0.3-2","3.1.0-2"],"bundled":2},{"source":"osv","ecosystem":"Ubuntu:Pro:22.04:LTS","package":"ruby-devise-two-factor","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.0.0-2ubuntu0.1~esm1"}]}],"versions":["3.1.0-2","4.0.0-2"],"bundled":2}],"products":[{"vendor":"devise-two-factor","product":"devise-two-factor"},{"vendor":"tinfoil","product":"devise-two-factor"},{"vendor":"tinfoilsecurity","product":"devise-two-factor"}],"references":[{"url":"https://github.com/tinfoil/devise-two-factor/security/advisories/GHSA-jm35-h8q2-73mp","tags":["x_refsource_MISC","x_transferred","Third Party Advisory","advisory","web","report"]},{"url":"https://github.com/tinfoil/devise-two-factor/issues/106","tags":["web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-43177","tags":["advisory"]},{"url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/devise-two-factor/CVE-2021-43177.yml","tags":["web"]},{"url":"https://github.com/advisories/GHSA-jm35-h8q2-73mp"},{"url":"https://security-tracker.debian.org/tracker/CVE-2021-43177","tags":["advisory"]},{"url":"https://github.com/tinfoil/devise-two-factor","tags":["package"]},{"url":"https://ubuntu.com/security/CVE-2021-43177","tags":["report"]},{"url":"https://github.com/tinfoil/devise-two-factor/pull/108","tags":["report"]},{"url":"https://github.com/tinfoil/devise-two-factor/commit/64576bb9e7d29800c5f92bb86fb6ecff91ad6105","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2021-43177","tags":["report"]},{"url":"https://ubuntu.com/security/notices/USN-7050-1","tags":["advisory"]},{"url":"https://ubuntu.com/security/CVE-2024-8796","tags":["report"]}],"sources":{"cve":[{"id":"CVE-2021-43177","description":"As a result of an incomplete fix for CVE-2015-7225, in versions of devise-two-factor prior to 4.0.2 it is possible to reuse a One-Time-Password (OTP) for one (and only one) immediately trailing interval. CVSS Vector: (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N)","status":"published","published":"2022-04-11T19:37:40Z","modified":"2024-08-04T03:47:13.623Z","cwes":["CWE-254"],"updated_at":"2026-11-02T14:32:56.689433Z"}],"euvd":[{"id":"EUVD-2022-1774","description":"As a result of an incomplete fix for CVE-2015-7225, in versions of devise-two-factor prior to 4.0.2 it is possible to reuse a One-Time-Password (OTP) for one (and only one) immediately trailing interval. CVSS Vector: (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N)","status":"published","published":"2022-04-11T19:37:40Z","modified":"2024-08-04T03:47:13Z","updated_at":"2026-11-03T03:24:14.796505Z"}],"ghsa":[{"id":"GHSA-jm35-h8q2-73mp","title":"Improper one time password handling in devise-two-factor","description":"### Impact\nAs a result of an incomplete fix for CVE-2015-7225, in versions of devise-two-factor prior to 4.0.2 it is possible to reuse a One-Time-Password (OTP) for one (and only one) immediately trailing interval.\n \n### Patches\nThis vulnerability has been patched in version 4.0.2 which was released on March 24th, 2022. Individuals using this package are strongly encouraged to upgrade as soon as possible.\n\n### Credit for discovery\nBenoit Côté-Jodoin\nMichael Nipper - https://github.com/tinfoil/devise-two-factor/issues/106","status":"published","published":"2022-04-07T22:09:03Z","modified":"2023-05-04T19:31:12Z","cvss":[{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N","level":"medium"}],"updated_at":"2026-11-02T14:36:52.310293Z"}],"nvd":[{"id":"CVE-2021-43177","description":"As a result of an incomplete fix for CVE-2015-7225, in versions of devise-two-factor prior to 4.0.2 it is possible to reuse a One-Time-Password (OTP) for one (and only one) immediately trailing interval. CVSS Vector: (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N)","status":"published","published":"2022-04-11T20:15:16.037Z","modified":"2026-06-17T04:10:35.417Z","cvss":[{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N","level":"medium","assessor":"primary"},{"version":"2.0","score":3.5,"vector":"AV:N/AC:M/Au:S/C:P/I:N/A:N","level":"low","assessor":"primary"}],"cwes":["CWE-254"],"updated_at":"2026-11-02T14:07:05.581807Z"}],"osv":[{"id":"CVE-2021-43177","description":"As a result of an incomplete fix for CVE-2015-7225, in versions of devise-two-factor prior to 4.0.2 it is possible to reuse a One-Time-Password (OTP) for one (and only one) immediately trailing interval. CVSS Vector: (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N)","status":"published","published":"2022-04-11T20:15:16.037Z","modified":"2026-10-20T10:55:02.4044455Z","cvss":[{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N","level":"medium"}],"updated_at":"2026-11-02T15:44:21.557945Z"},{"id":"DEBIAN-CVE-2021-43177","description":"As a result of an incomplete fix for CVE-2015-7225, in versions of devise-two-factor prior to 4.0.2 it is possible to reuse a One-Time-Password (OTP) for one (and only one) immediately trailing interval. CVSS Vector: (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N)","status":"published","published":"2022-04-11T20:15:16.037Z","modified":"2026-10-23T18:04:38.775369874Z","cvss":[{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N","level":"medium"}],"updated_at":"2026-11-02T15:45:35.799676Z"},{"id":"GHSA-jm35-h8q2-73mp","title":"Improper one time password handling in devise-two-factor","description":"### Impact\nAs a result of an incomplete fix for CVE-2015-7225, in versions of devise-two-factor prior to 4.0.2 it is possible to reuse a One-Time-Password (OTP) for one (and only one) immediately trailing interval.\n \n### Patches\nThis vulnerability has been patched in version 4.0.2 which was released on March 24th, 2022. Individuals using this package are strongly encouraged to upgrade as soon as possible.\n\n### Credit for discovery\nBenoit Côté-Jodoin\nMichael Nipper - https://github.com/tinfoil/devise-two-factor/issues/106","status":"published","published":"2022-04-07T22:09:03Z","modified":"2026-08-27T03:56:00.293667065Z","cvss":[{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N","level":"medium"}],"updated_at":"2026-11-02T15:46:50.687609Z"},{"id":"UBUNTU-CVE-2021-43177","description":"As a result of an incomplete fix for CVE-2015-7225, in versions of devise-two-factor prior to 4.0.2 it is possible to reuse a One-Time-Password (OTP) for one (and only one) immediately trailing interval. CVSS Vector: (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N)","status":"published","published":"2022-04-11T20:15:00Z","modified":"2026-02-04T04:40:00.867975Z","cvss":[{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N","level":"medium"}],"updated_at":"2026-11-02T15:54:29.220315Z"},{"id":"USN-7050-1","title":"ruby-devise-two-factor vulnerabilities","description":"Benoit Côté-Jodoin and Michael Nipper discovered that Devise-Two-Factor\nincorrectly handled one-time password validation. An attacker could\npossibly use this issue to intercept and re-use a one-time password.\n(CVE-2021-43177)\n\nGarrett Rappaport discovered that Devise-Two-Factor incorrectly handled\ngenerating multi-factor authentication codes. An attacker could possibly\nuse this issue to generate valid multi-factor authentication codes.\n(CVE-2024-8796)\n","status":"published","published":"2024-10-01T14:47:15Z","modified":"2026-04-27T17:30:06.908796Z","updated_at":"2026-11-02T16:58:18.876384Z"}]}}
