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

Summary

CVECVE-2026-78619
StatePUBLISHED
AssignerCPANSec
Source PriorityCVE Program / NVD first with legacy fallback
Published2026-08-25 22:17:06 UTC
Updated2026-08-25 23:17:59 UTC
DescriptionPunk::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.

Risk And Classification

Problem Types: CWE-305 | CWE-1025 | CWE-305 CWE-305 Authentication Bypass by Primary Weakness | CWE-1025 CWE-1025 Comparison Using Wrong Factors

References

ReferenceSourceLinkTags
metacpan.org/release/LNATION/Punk-TOTP-0.05/source/Changes 9b29abf9-4ab0-4765-b253-1875cd9b441e metacpan.org
metacpan.org/release/LNATION/Punk-TOTP-0.04/view/lib/Punk/Plugin/TOTP.pm 9b29abf9-4ab0-4765-b253-1875cd9b441e metacpan.org
www.openwall.com/lists/oss-security/2026/08/25/6 af854a3a-2127-422b-91ae-364da2661108 www.openwall.com
metacpan.org/release/LNATION/Punk-TOTP-0.04/source/include/ptotp/ptotp_plu... 9b29abf9-4ab0-4765-b253-1875cd9b441e metacpan.org
CVE Program record CVE.ORG www.cve.org canonical
NVD vulnerability detail NVD nvd.nist.gov canonical, analysis

Additional Advisory Data

Solutions

CNA: Upgrade to Punk-TOTP 0.05 or later.

Workarounds

CNA: 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.

© CVE.report 2026

Use of this information constitutes acceptance for use in an AS IS condition. There are NO warranties, implied or otherwise, with regard to this information or its use. Any use of this information is at the user's risk. It is the responsibility of user to evaluate the accuracy, completeness or usefulness of any information, opinion, advice or other content. EACH USER WILL BE SOLELY RESPONSIBLE FOR ANY consequences of his or her direct or indirect use of this web site. ALL WARRANTIES OF ANY KIND ARE EXPRESSLY DISCLAIMED. This site will NOT BE LIABLE FOR ANY DIRECT, INDIRECT or any other kind of loss.

CVE, CWE, and OVAL are registred trademarks of The MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. This site includes MITRE data granted under the following license.

Free CVE JSON API cve.report/api

CVE.report and Source URL Uptime Status status.cve.report