totp-rs is a Rust library that permits the creation of 2FA authentification tokens per time-based one-time password (TOTP). Prior to…
GitHub_M·CWE-203·Published 2022-05-20
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.
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.
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.
### 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](https://github.com/constantoine/totp-rs) * Email us at [cleo.rebert@gmail.com](mailto:cleo.rebert@gmail.com)
totp-rs es una biblioteca de Rust que permite la creación de tokens de autentificación 2FA por contraseña de un solo uso basada en el tiempo (TOTP). En versiones anteriores a 1.1.0, la comparación de tokens no era de tiempo constante, y teóricamente podía ser usada para adivinar el valor de un token TOTP, y así reusarlo en la misma ventana de tiempo. No obstante, el atacante tendría que conocer la contraseña de antemano. A partir de la versión parcheada 1.1.0, la biblioteca usa la comparación en tiempo constante. Actualmente no se presentan mitigaciones conocidas
| Version | Type | Source | Base | Exp | Impact | Vector |
|---|---|---|---|---|---|---|
| 2.0 | Primary | NVD | 3.5 | 6.8 | 2.9 | AV:N/AC:M/Au:S/C:P/I:N/A:N |
| 3.1 | Primary | NVD | 4.4 | 0.7 | 3.6 | CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:N/A:N |
| 3.1 | Primary | cve.org | 4.2 | — | — | CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:H/I:N/A:N |
| 3.1 | Primary | cve.org | 4.2 | — | — | CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:H/I:N/A:N |
| 3.1 | Secondary | NVD | 4.2 | 0.5 | 3.6 | CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:H/I:N/A:N |
| 3.1 | Secondary | GHSA | 4.2 | — | — | CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:H/I:N/A:N |