Skip to content
Heist/ feed
Back to feed
MediumFix available

Timing attack

Type: advisorySources: OSV

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.

Products
totp-rs
Affected versions
Not specified
Fixed versions
1.1.0
CVEs
CVE-2022-29185
Confirmed fixed CVEs
Not specified
Updated in this feed
30 Oct 2026, 08:41 UTC · Revision 1

Source evidence

Timing attack

core-osv · Original source

Published 9 May 2022, 12:00 UTC

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.

osv:RUSTSEC-2022-0018

totp-rs

Fixed versions: 1.1.0

Complete source record
{
  "id": "95270eae0242c3520e34f624ce7931c84f46529eedc61e126695af9af39faf6f",
  "url": "https://osv.dev/vulnerability/RUSTSEC-2022-0018",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Timing attack",
    "summary": "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.",
    "evidence": "osv:RUSTSEC-2022-0018",
    "products": [
      {
        "name": {
          "value": "totp-rs",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "1.1.0",
            "evidence": "/affected/0/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "medium",
    "structured": {
      "id": "RUSTSEC-2022-0018",
      "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": [
            {
              "type": "SEMVER",
              "events": [
                {
                  "introduced": "0.0.0-0"
                },
                {
                  "fixed": "1.1.0"
                }
              ]
            }
          ],
          "package": {
            "name": "totp-rs",
            "purl": "pkg:cargo/totp-rs",
            "ecosystem": "crates.io"
          },
          "database_specific": {
            "cvss": "CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:H/I:N/A:N",
            "source": "https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2022-0018.json",
            "categories": [
              "crypto-failure"
            ],
            "informational": null
          },
          "ecosystem_specific": {
            "affects": {
              "os": [],
              "arch": [],
              "functions": [
                "totp_rs::TOTP::check"
              ]
            },
            "affected_functions": null
          }
        }
      ],
      "modified": "2026-10-12T18:00:03.407014913Z",
      "provider": "osv",
      "references": [
        "https://crates.io/crates/totp-rs",
        "https://rustsec.org/advisories/RUSTSEC-2022-0018.html",
        "https://github.com/constantoine/totp-rs/issues/13"
      ],
      "provider_metadata": {
        "license": "CC0-1.0"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2022-29185",
        "evidence": "/aliases"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 306329,
  "published_at": "2022-05-09T12:00:00+00:00"
}