CVE-2022-29185
Observable Timing Discrepancy in totp-rs
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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- High
- Privileges needed
- High
- User interaction
- Required
What an attacker can affect
- Confidentiality
- High
- Integrity
- None
- Availability
- None
Exploit likelihood
What each source reports
CVE List Score used
4.2
Observable Timing Discrepancy in totp-rs
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.
- Record
CVE-2022-29185- CVSS 3.1
- 4.2 Medium
CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:H/I:N/A:N - Weakness
- CWE-208, CWE-203
- Updated
- 2026-11-02
EUVDEUVD-2022-3248
4.2
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.
- Record
EUVD-2022-3248- CVSS 3.1
- 4.2 Medium
CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:H/I:N/A:N - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-8vxv-2g8p-2249
4.2
Observable Timing Discrepancy in totp-rs
Impact
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.
Patches
Library now used constant-time comparison.
Workarounds
No.
For more information
If you have any questions or comments about this advisory:
- Open an issue in totp-rs
- Email us at [email protected]
- Record
GHSA-8vxv-2g8p-2249- CVSS 3.1
- 4.2 Medium
CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:H/I:N/A:N - Weakness
- CWE-203, CWE-208
- Updated
- 2026-11-02
NVD
4.2
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.
- Record
CVE-2022-29185- CVSS 3.1
- 4.2 Medium
CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:H/I:N/A:N - CVSS 3.1
- 4.4 Medium
CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:N/A:N - CVSS 2.0
- 3.5 Low
AV:N/AC:M/Au:S/C:P/I:N/A:N - Weakness
- CWE-203, CWE-208
- Updated
- 2026-11-02
OSV
4.2
Observable Timing Discrepancy in totp-rs
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.
- Record
CVE-2022-29185- CVSS 3.1
- 4.2 Medium
CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:H/I:N/A:N - Weakness
- CWE-203, CWE-208
- Updated
- 2026-11-02
OSVGHSA-8vxv-2g8p-2249
4.2
Observable Timing Discrepancy in totp-rs
Impact
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.
Patches
Library now used constant-time comparison.
Workarounds
No.
For more information
If you have any questions or comments about this advisory:
- Open an issue in totp-rs
- Email us at [email protected]
- Record
GHSA-8vxv-2g8p-2249- CVSS 3.1
- 4.2 Medium
CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:H/I:N/A:N - Weakness
- CWE-203, CWE-208
- Updated
- 2026-11-02
OSVRUSTSEC-2022-0018
4.2
Timing attack
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.
This has been fixed by using using the crate constant_time_eq for comparison.
- Record
RUSTSEC-2022-0018- CVSS 3.1
- 4.2 Medium
CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:H/I:N/A:N - Updated
- 2026-11-02
Affected products
Affected packages
History
| Recorded | Changed | Sources |
|---|---|---|
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2022-29185 is a medium vulnerability (CVSS 4.2) in Constantoine Totp-rs, published May 9, 2022. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.86%, the 58th percentile. Fixed in totp-rs 1.1.0.
References
github.com/constantoine/totp-rs/security/advisories/GHSA-8vxv-2g8p-2249
github.com/constantoine/totp-rs/issues/13
github.com/constantoine/totp-rs/releases/tag/v1.1.0
nvd.nist.gov/vuln/detail/CVE-2022-29185
rustsec.org/advisories/RUSTSEC-2022-0018.html
github.com/constantoine/totp-rs/commit/1f1e1a6fe722deb1656f483b1367ea4be978db5b