Description
Punk::Plugin::TOTP versions before 0.05 for Perl accept another account's recovery code at the two-factor challenge because totp_use_recovery compares user identifiers numerically.

The helper searches the recovery model for the submitted code's digest alone, across every user's rows, so the ownership test that follows is the only thing binding a code to the account it was issued to. That test compares the row's user_id with the challenged user's id through Perl's integer coercion, and an identifier with no leading digits coerces to zero, so any two of them compare equal. User models keyed on a username, an email address or a UUID hit that case, and a numeric key compares as intended.

The challenge route feeds a submitted value to the helper once TOTP verification fails, so an attacker who knows a victim's password and holds a recovery code of their own passes the victim's second factor.
Published: 2026-08-25
Score: 9.8 Critical
EPSS: < 1% Very Low
KEV: No
Impact: Authentication Bypass
Action: Patch Immediately
AI Analysis

Impact

The Bug: Punk::Plugin::TOTP versions prior to 0.05 allow an attacker who knows a victim's password to supply a recovery code issued to their own account and successfully complete the second factor. This is possible because the code lookup compares the user identifier numerically, treating any non‑numeric identifier as zero, so a second account with a non‑numeric user_id matches the victim's. The result is that an attacker can log in as another user without possessing that user’s TOTP code. The weakness is a misuse of numerical coercion in the authentication flow, classified as CWE‑1025 and CWE‑305. The impact is that authorized access is allowed for a victim account, compromising confidentiality and potentially leading to further privilege escalation.

Affected Systems

Punk::Plugin::TOTP for Perl versions earlier than 0.05 are affected. Any installation that uses the 0.05 or earlier release of this module and has two‑factor authentication enabled with recovery codes is vulnerable. The affected product is the Punk::Plugin::TOTP module that exposes the totp_use_recovery helper in Perl.

Risk and Exploitability

The CVSS score is 9.8, reflecting a critical severity. The EPSS score is <1% and the vulnerability is not listed in the CISA KEV catalog. The abuse requires the attacker to know the victim’s password and possess their own recovery code, which limits the attack to accounts where the password secret is exposed. Nevertheless, the path to exploitation is straightforward: submit the victim’s credentials, cause TOTP verification to fail, and then submit a valid recovery code issued to the attacker’s own account. The numeric coercion bug allows this code to be accepted for any non‑numeric user_id, including typical alphanumeric usernames, emails, or UUIDs. Because failure to pass TOTP triggers the recovery path automatically, the attack does not require privileged interaction beyond credential knowledge. The risk thus depends on the likelihood of password compromise and the prevalence of non‑numeric user identifiers but should be treated as significant for environments with sensitive data.

Generated by OpenCVE AI on August 26, 2026 at 21:50 UTC.

Remediation

Vendor Solution

Upgrade to Punk-TOTP 0.05 or later.


Vendor Workaround

For deployments that cannot upgrade to 0.05, stop issuing recovery codes and delete the existing totp_recovery rows from the token table. The challenge route then has nothing to match and the second factor rests on TOTP codes alone.


OpenCVE Recommended Actions

  • Upgrade Punk::Plugin::TOTP to version 0.05 or later, which corrects the numeric comparison flaw.
  • If an upgrade cannot be performed immediately, cease issuance of recovery codes and delete all existing totp_recovery rows from the token table so the secondary factor relies solely on TOTP codes.
  • After applying either the upgrade or the workaround, verify that no accounts retain active recovery codes and that the two‑factor challenge no longer accepts external recovery codes.

Generated by OpenCVE AI on August 26, 2026 at 21:50 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Wed, 26 Aug 2026 20:30:00 +0000

Type Values Removed Values Added
Metrics cvssV3_1

{'score': 9.8, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H'}

ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Tue, 25 Aug 2026 23:30:00 +0000

Type Values Removed Values Added
References

Tue, 25 Aug 2026 21:30:00 +0000

Type Values Removed Values Added
Description Punk::Plugin::TOTP versions before 0.05 for Perl accept another account's recovery code at the two-factor challenge because totp_use_recovery compares user identifiers numerically. The helper searches the recovery model for the submitted code's digest alone, across every user's rows, so the ownership test that follows is the only thing binding a code to the account it was issued to. That test compares the row's user_id with the challenged user's id through Perl's integer coercion, and an identifier with no leading digits coerces to zero, so any two of them compare equal. User models keyed on a username, an email address or a UUID hit that case, and a numeric key compares as intended. The challenge route feeds a submitted value to the helper once TOTP verification fails, so an attacker who knows a victim's password and holds a recovery code of their own passes the victim's second factor.
Title Punk::Plugin::TOTP versions before 0.05 for Perl accept another account's recovery code at the two-factor challenge because totp_use_recovery compares user identifiers numerically
Weaknesses CWE-1025
CWE-305
References

Subscriptions

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: CPANSec

Published:

Updated: 2026-08-26T18:46:35.710Z

Reserved: 2026-08-24T21:34:55.931Z

Link: CVE-2026-78619

cve-icon Vulnrichment

Updated: 2026-08-25T23:07:23.313Z

cve-icon NVD

Status : Deferred

Published: 2026-08-25T22:17:06.403

Modified: 2026-08-26T20:18:02.843

Link: CVE-2026-78619

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-26T22:00:04Z

Weaknesses
  • CWE-1025

    Comparison Using Wrong Factors

  • CWE-305

    Authentication Bypass by Primary Weakness