Skip to content
Heist/ feed
Back to feed
Medium

Observable Timing Discrepancy in totp-rs

Type: advisorySources: OSV

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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2022-29185
Confirmed fixed CVEs
Not specified
Updated in this feed
6 Nov 2026, 19:34 UTC · Revision 1

Source evidence

Observable Timing Discrepancy in totp-rs

core-osv · Original source

Published 20 May 2022, 19:30 UTC

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.

osv:CVE-2022-29185
Complete source record
{
  "id": "97e550ef7d12256a3100fe43caa35f5e21a218d87714e52241f2cbf45b2f830a",
  "url": "https://osv.dev/vulnerability/CVE-2022-29185",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Observable Timing Discrepancy in totp-rs",
    "summary": "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.",
    "evidence": "osv:CVE-2022-29185",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2022-29185",
      "aliases": [
        "CVE-2022-29185",
        "GHSA-8vxv-2g8p-2249",
        "RUSTSEC-2022-0018"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:H/I:N/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/constantoine/totp-rs",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "7ecdf7d440fc2fb452d7664a5f2484067fe4ef05"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "1.1.0"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StringRangeExpression"
                  },
                  {
                    "range": [
                      {
                        "fixed": "7ecdf7d440fc2fb452d7664a5f2484067fe4ef05"
                      }
                    ],
                    "source": "REFERENCES_TAG",
                    "original_tag": "v1.1.0"
                  },
                  {
                    "cpe": "cpe:2.3:a:totp-rs_project:totp-rs:*:*:*:*:*:rust:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "1.1.0"
                      }
                    ],
                    "source": "CPE_RANGE"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v1.0",
            "v0.7.4",
            "v0.7.3",
            "v0.7.1"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-29185.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:47.898933947Z",
      "provider": "osv",
      "references": [
        "https://github.com/constantoine/totp-rs/releases/tag/v1.1.0",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/29xxx/CVE-2022-29185.json",
        "https://github.com/constantoine/totp-rs/security/advisories/GHSA-8vxv-2g8p-2249",
        "https://nvd.nist.gov/vuln/detail/CVE-2022-29185",
        "https://github.com/constantoine/totp-rs/issues/13"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-203",
          "CWE-208"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/29xxx/CVE-2022-29185.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2022-29185",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 515979,
  "published_at": "2022-05-20T19:30:12+00:00"
}