What's the vulnerability?
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.
Business impact & how R4IM helps
This advisory is on our active-exploitation watchlist. Attackers are using it for initial access, privilege escalation or lateral movement in real-world intrusions. R4IM's offensive security and SOC teams already have detections, exploit replicas and remediation playbooks for this issue.
Targeted vulnerability assessment to confirm which of your assets are actually exploitable — not just theoretically affected.
Our pentesters chain this CVE into realistic attack paths so you see business impact, not just a scan finding.
If the affected product is internet-facing, our AppSec team will harden it against this and related OWASP-class issues.
Continuous monitoring with custom detections for this CVE deployed across your endpoints, identity and cloud.
Recommended remediation
- Inventory all assets running the affected vendor and product, including shadow IT and third-party hosted instances.
- Apply the vendor patch or mitigation referenced in the advisories below. Where no patch exists, isolate the asset or restrict network exposure.
- Hunt for indicators of prior compromise — exploitation of this class of bug often predates public disclosure.
- Deploy detections for the exploit primitives (network signature, EDR rule, WAF rule) and re-test after remediation.
Need help executing these steps? Our team typically completes validation and remediation within a single patch cycle. Request remediation support →
Vendor & research references
- https://metacpan.org/release/LNATION/Punk-TOTP-0.04/source/include/ptotp/ptotp_plugin.h#L801-827 · 9b29abf9-4ab0-4765-b253-1875cd9b441e
- https://metacpan.org/release/LNATION/Punk-TOTP-0.04/view/lib/Punk/Plugin/TOTP.pm · 9b29abf9-4ab0-4765-b253-1875cd9b441e
- https://metacpan.org/release/LNATION/Punk-TOTP-0.05/source/Changes · 9b29abf9-4ab0-4765-b253-1875cd9b441e
- http://www.openwall.com/lists/oss-security/2026/08/25/6 · af854a3a-2127-422b-91ae-364da2661108
