{"id":"CVE-2022-29185","aliases":["EUVD-2022-3248","GHSA-8vxv-2g8p-2249","RUSTSEC-2022-0018"],"status":"published","title":"Observable Timing Discrepancy in totp-rs","description":"totp-rs is a Rust library that permits the creation of 2FA authentification tokens per time-based one-time password (TOTP). Prior to version 1.1.0, token comparison was not constant time, and could theorically be used to guess value of an TOTP token, and thus reuse it in the same time window. The attacker would have to know the password beforehand nonetheless. Starting with patched version 1.1.0, the library uses constant-time comparison. There are currently no known workarounds.","severity":{"version":"3.1","score":4.2,"vector":"CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:H/I:N/A:N","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-10","score":0.00863,"percentile":0.58912,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-203","CWE-208"],"published":"2022-05-09T12:00:00Z","modified":"2026-10-28T02:30:47Z","fixes":[{"ecosystem":"crates.io","package":"totp-rs","fixed_in":["1.1.0"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"crates.io","package":"totp-rs","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.1.0"}]}]},{"source":"osv","ecosystem":"crates.io","package":"totp-rs","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"1.1.0"}]}]},{"source":"osv","ecosystem":"crates.io","package":"totp-rs","ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0-0"},{"fixed":"1.1.0"}]}]}],"products":[{"vendor":"constantoine","product":"totp-rs"},{"vendor":"totp-rs_project","product":"totp-rs"}],"references":[{"url":"https://github.com/constantoine/totp-rs/security/advisories/GHSA-8vxv-2g8p-2249","tags":["x_refsource_CONFIRM","x_transferred","Third Party Advisory","advisory","web"]},{"url":"https://github.com/constantoine/totp-rs/issues/13","tags":["x_refsource_MISC","x_transferred","Issue Tracking","Third Party Advisory","report","web"]},{"url":"https://github.com/constantoine/totp-rs/releases/tag/v1.1.0","tags":["x_refsource_MISC","x_transferred","Release Notes","Third Party Advisory","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-29185","tags":["advisory"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2022-0018.html","tags":["web","advisory"]},{"url":"https://github.com/constantoine/totp-rs/commit/1f1e1a6fe722deb1656f483b1367ea4be978db5b","tags":["web"]},{"url":"https://github.com/constantoine/totp-rs/compare/v1.0...v1.1.0","tags":["web"]},{"url":"https://github.com/advisories/GHSA-8vxv-2g8p-2249"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/29xxx/CVE-2022-29185.json","tags":["advisory"]},{"url":"https://github.com/constantoine/totp-rs","tags":["package"]},{"url":"https://crates.io/crates/totp-rs","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2022-29185","title":"Observable Timing Discrepancy in totp-rs","description":"totp-rs is a Rust library that permits the creation of 2FA authentification tokens per time-based one-time password (TOTP). Prior to version 1.1.0, token comparison was not constant time, and could theorically be used to guess value of an TOTP token, and thus reuse it in the same time window. The attacker would have to know the password beforehand nonetheless. Starting with patched version 1.1.0, the library uses constant-time comparison. There are currently no known workarounds.","status":"published","published":"2022-05-20T19:30:12Z","modified":"2025-04-23T18:24:00.911Z","cvss":[{"version":"3.1","score":4.2,"vector":"CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:H/I:N/A:N","level":"medium","assessor":"cna"}],"cwes":["CWE-208","CWE-203"],"updated_at":"2026-11-02T14:34:36.270817Z"}],"euvd":[{"id":"EUVD-2022-3248","description":"totp-rs is a Rust library that permits the creation of 2FA authentification tokens per time-based one-time password (TOTP). Prior to version 1.1.0, token comparison was not constant time, and could theorically be used to guess value of an TOTP token, and thus reuse it in the same time window. The attacker would have to know the password beforehand nonetheless. Starting with patched version 1.1.0, the library uses constant-time comparison. There are currently no known workarounds.","status":"published","published":"2022-05-20T19:30:12Z","modified":"2025-04-23T18:24:00Z","cvss":[{"version":"3.1","score":4.2,"vector":"CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:H/I:N/A:N","level":"medium"}],"updated_at":"2026-11-02T20:52:08.95736Z"}],"ghsa":[{"id":"GHSA-8vxv-2g8p-2249","title":"Observable Timing Discrepancy in totp-rs","description":"### Impact\nToken comparison was not constant time, and could theorically be used to guess value of an TOTP token, and thus reuse it in the same time window. The attacker would have to know the password beforehand nonetheless.\n\n### Patches\nLibrary now used constant-time comparison.\n\n### Workarounds\nNo.\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [totp-rs](https://github.com/constantoine/totp-rs)\n* Email us at [cleo.rebert@gmail.com](mailto:cleo.rebert@gmail.com)\n","status":"published","published":"2022-05-24T21:33:15Z","modified":"2023-06-13T21:57:38Z","cvss":[{"version":"3.1","score":4.2,"vector":"CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:H/I:N/A:N","level":"medium"}],"cwes":["CWE-203","CWE-208"],"updated_at":"2026-11-02T14:36:54.225318Z"}],"nvd":[{"id":"CVE-2022-29185","description":"totp-rs is a Rust library that permits the creation of 2FA authentification tokens per time-based one-time password (TOTP). Prior to version 1.1.0, token comparison was not constant time, and could theorically be used to guess value of an TOTP token, and thus reuse it in the same time window. The attacker would have to know the password beforehand nonetheless. Starting with patched version 1.1.0, the library uses constant-time comparison. There are currently no known workarounds.","status":"published","published":"2022-05-20T20:15:10.14Z","modified":"2026-06-17T04:39:46.097Z","cvss":[{"version":"3.1","score":4.2,"vector":"CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:H/I:N/A:N","level":"medium","assessor":"secondary"},{"version":"3.1","score":4.4,"vector":"CVSS:3.1/AV:N/AC:H/PR:H/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-203","CWE-208"],"updated_at":"2026-11-02T14:07:20.264424Z"}],"osv":[{"id":"CVE-2022-29185","title":"Observable Timing Discrepancy in totp-rs","description":"totp-rs is a Rust library that permits the creation of 2FA authentification tokens per time-based one-time password (TOTP). Prior to version 1.1.0, token comparison was not constant time, and could theorically be used to guess value of an TOTP token, and thus reuse it in the same time window. The attacker would have to know the password beforehand nonetheless. Starting with patched version 1.1.0, the library uses constant-time comparison. There are currently no known workarounds.","status":"published","published":"2022-05-20T19:30:12Z","modified":"2026-10-28T02:30:47.898933947Z","cvss":[{"version":"3.1","score":4.2,"vector":"CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:H/I:N/A:N","level":"medium"}],"cwes":["CWE-203","CWE-208"],"updated_at":"2026-11-02T15:44:25.164673Z"},{"id":"GHSA-8vxv-2g8p-2249","title":"Observable Timing Discrepancy in totp-rs","description":"### Impact\nToken comparison was not constant time, and could theorically be used to guess value of an TOTP token, and thus reuse it in the same time window. The attacker would have to know the password beforehand nonetheless.\n\n### Patches\nLibrary now used constant-time comparison.\n\n### Workarounds\nNo.\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [totp-rs](https://github.com/constantoine/totp-rs)\n* Email us at [cleo.rebert@gmail.com](mailto:cleo.rebert@gmail.com)\n","status":"published","published":"2022-05-24T21:33:15Z","modified":"2023-11-08T04:09:09.176539Z","cvss":[{"version":"3.1","score":4.2,"vector":"CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:H/I:N/A:N","level":"medium"}],"cwes":["CWE-203","CWE-208"],"updated_at":"2026-11-02T15:46:42.78452Z"},{"id":"RUSTSEC-2022-0018","title":"Timing attack","description":"Affecting versions did not compare tokens in constant time, which could make it possible for an attacker to guess the 2fa token of a user.\n\nThis has been fixed by using using the crate constant_time_eq for comparison.","status":"published","published":"2022-05-09T12:00:00Z","modified":"2026-10-12T18:00:03.407014913Z","cvss":[{"version":"3.1","score":4.2,"vector":"CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:H/I:N/A:N","level":"medium"}],"updated_at":"2026-11-02T15:53:39.971022Z"}]}}
