Join our Newsletter — 33% off our NHI Course
Home› Glossary› Authentication, Authorisation & Trust› One-Time Code Theft
Authentication, Authorisation & Trust

One-Time Code Theft

← Back to Glossary
By NHI Mgmt Group Updated November 25, 2026 Domain: Authentication, Authorisation & Trust

One-time code theft is the interception or reuse of a one-time password or verification code before it expires. Practitioners usually mean phishing, proxy interception, SIM swap abuse, or malware that captures the code, allowing an attacker to complete login or account recovery that was meant to be short-lived and single use.

How one-time code theft works

One-time code theft is not a weakness in the concept of a one-time code itself, but in the delivery path around it. The attacker steals the code while it is still valid, then uses it before expiry to satisfy a login, recovery, or step-up challenge that was intended to be short-lived and single use.

The most common paths are phishing, reverse proxy interception, SIM swap abuse, and malware that reads notifications or clipboard content. Because the code is often treated as a temporary trust signal, the attack works best when the victim is already in an authentication flow and is expecting to receive a code.

Why it is dangerous

The danger is that one-time codes often sit at the boundary between a password and a session. If an attacker captures the code, they may complete authentication without ever knowing the underlying password, or they may take over account recovery and reset the victim’s access path.

This makes the technique especially effective against SMS OTP, email codes, and other flows that are vulnerable to real-time relay. It is also why code theft is frequently paired with adversary-in-the-middle phishing, where the attacker relays the login flow live rather than trying to crack a static secret.

Where organisations are most exposed

Exposure is highest when one-time codes are the last remaining factor and the surrounding controls are weak. Shared device use, weak recovery processes, permissive help-desk resets, and code delivery channels that can be intercepted all increase the chance that an attacker can turn a stolen code into full account access.

Organisations should also think about the authentication journey as a whole, not just the code itself. If a code can be reused across sessions, accepted too late, or relied on after a risky recovery event, the practical security value of the factor drops sharply.

For a deeper treatment of phishing relay, SIM swap abuse, and code-channel design, see OTP security and Magic Links and Email OTP Security Guide.

Defences, detection, and recovery

The strongest response is to reduce reliance on codes that can be copied in real time. Phishing-resistant authenticators, origin-bound flows, and tighter step-up policy reduce the value of interception, while short expiry alone is not enough if the attacker can relay the challenge instantly.

Detection should look for anomalous sign-in patterns, unexpected device or network transitions, repeated code requests, and suspicious recovery activity immediately after code use. If a code theft incident is suspected, account sessions, refresh tokens, recovery settings, and any linked authenticator enrolments may need review because the code may have been the entry point to broader compromise.

Use Twilio 0ktapus breach 2022 as a practical example of SMS phishing and OTP relay at scale, and Mobile T1517 Access Notifications for the mobile interception pattern that steals codes from notifications.

Where this fits in authentication design

One-time code theft is best understood as a failure of authentication design and channel security, not just user caution. The question is not whether a code expires, but whether the channel that delivers it can be observed, relayed, or hijacked before that expiry matters.

That is why password resets, account recovery, and fallback methods deserve the same scrutiny as the primary login flow. When a temporary code becomes a universal recovery key, attackers will target the weakest delivery path rather than the strongest factor.

Useful references here include Authenticator Apps and OTP Guide for the strengths and weaknesses of TOTP and HOTP, and Open Redirect Guide for the way redirect abuse can support OAuth code theft and related relay attacks.

Risk and Threat Considerations

One-time code theft matters because it turns a short-lived factor into a live takeover path. The attacker does not need to crack the code, only to intercept it fast enough to beat expiry and session completion.

Failure mechanism: Phishing kits, proxy relays, SMS interception, email compromise, or notification-stealing malware capture the code in transit and reuse it in the same authentication window.

Impact: The attacker can complete login, bypass account recovery safeguards, obtain session access, and sometimes persist through password changes if recovery and session controls are weak.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

NIST SP 800-63, CIS Controls v8, OWASP ASVS and NIST SP 800-53 Rev 5 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
NIST SP 800-63Digital Identity GuidelinesDefines phishing-resistant authenticators and OTP limitations for login assurance.
Recommendation — Prefer phishing-resistant authenticators over reusable OTP flows for high-value accounts.
CIS Controls v8CIS-6 — Access Control ManagementSupports controlling and reviewing authentication paths that attackers abuse after code theft.
Recommendation — Review and restrict authentication and recovery access paths that enable account takeover.
OWASP ASVSV6 — AuthenticationCovers authentication flows where one-time codes, recovery and step-up verification must resist interception.
Recommendation — Verify that code-based authentication cannot be relayed, replayed, or weakened through recovery flows.
NIST SP 800-53 Rev 5IA-2 — Identification and Authentication (Organizational Users)Requires strong user authentication controls for sign-in flows exposed to code theft.
IA-5 — Authenticator ManagementAddresses lifecycle and handling of authenticators, including OTP secrets and recovery material.
Recommendation — Use stronger user authentication controls that do not rely solely on interceptable one-time codes. Manage authenticators and recovery material so stolen codes cannot be reused as lasting access.

Practitioner Guidance

Common misunderstanding: Short expiry alone does not make a one-time code resistant to theft. If the attacker can relay the code in real time, the code still functions as a valid credential during the attack window.

What to watch for: Repeated code requests, unusual recovery attempts, and sign-ins that succeed immediately after a user enters an expected code are strong signals that the delivery channel or recovery flow is being abused.

Practitioner takeaway: Treat code theft as an authentication architecture problem, not just a user-awareness problem, and prefer phishing-resistant methods wherever the business risk justifies them.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on November 25, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org