Join our Newsletter — 33% off our NHI Course
Authentication, Authorisation & Trust

Replay Detection

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

Replay detection is the server-side response to a token being presented more than once when that token should only be used once. In rotated refresh flows, a reused token can be treated as evidence of compromise, causing revocation of the active token family and related access tokens.

Expanded Definition

Replay detection is a control for recognising when the same bearer artifact, such as a token, is presented again after it should already be consumed or invalidated. In identity and session systems, the key boundary is not simply “duplicate use” but “duplicate use after a state change that should make the earlier presentation unsafe.”

That distinction matters because some protocols allow repeated presentation by design, while others treat a second presentation as evidence that the artifact has been copied, intercepted, or reused outside its intended lifecycle. In rotated refresh-token flows, a replay can indicate that an attacker or another client still possesses a previously issued token.

For practitioners, the common misunderstanding is to treat replay detection as a logging feature. It is actually a server-side trust decision that can change the state of an entire token family, not just reject a single request. NIST Cybersecurity Framework 2.0 can help readers place that decision within broader governance and monitoring expectations: NIST Cybersecurity Framework 2.0.

Examples and Use Cases

Replay detection appears wherever a security system must distinguish a legitimate retry from a reused credential or assertion. The implementation details vary by protocol, but the operational goal is the same: identify when an artifact has crossed from valid use into suspicious reuse.

  • A refresh token is exchanged, then later presented again after rotation has already issued a replacement.
  • A signed authentication assertion is submitted twice when the protocol expects a one-time presentation.
  • An API token or session artifact is copied from one environment and reused from another client context.
  • A cloud or identity gateway marks repeated presentation of a nonce-bound or time-bound artifact as invalid.
  • An access broker uses family or sequence state to decide whether a second use reflects user retry or compromise.

The trade-off is that stricter replay detection can catch theft earlier, but it can also punish benign client retries if the protocol design is weak or the client logic is unreliable. That is why replay handling is usually paired with short lifetimes, clear state transitions, and precise token scoping rather than relying on a single check.

Security Implications

When replay detection is missing or too permissive, a stolen token can be reused without an obvious change in the authentication flow. That creates a quiet compromise path: the attacker does not need to break the original credential, only to reuse what was already issued.

The failure mechanism is usually state confusion. The server accepts an artifact after it should have been retired, or it cannot distinguish the original presentation from the replayed one. In rotated refresh flows, that can let an attacker keep exchanging old tokens, prolonging access and reducing the value of rotation as a containment control.

The impact can include session persistence after theft, delayed revocation, unnecessary trust in a compromised client, and wider exposure if the replayed token can mint additional access tokens. A useful practitioner observation is that replay problems often show up first as odd token-family behaviour, not as a clean authentication failure.

Domain and Governance Relevance

Replay detection matters most in identity, session, and API security because it protects the trust boundary around token reuse. It is not just about protocol correctness; it is about deciding which reuse patterns are acceptable, which are suspicious, and when the system should revoke an active token family.

In NHI-heavy environments, the same logic becomes even more important because machine clients often operate at scale, with automated refresh, delegated access, and long-lived integration paths. A replayed secret, refresh token, or assertion can expose service access far beyond a single user session if ownership and rotation are poorly governed.

That makes replay detection part of lifecycle assurance for non-human identities as well as humans. The control helps organisations preserve the meaning of token rotation, prevent silent reuse across workloads, and limit the blast radius when a machine credential is copied or intercepted.

Standards & Framework Alignment

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

OWASP Non-Human Identity Top 10 and MITRE ATT&CK address the attack and risk surface, while NIST CSF 2.0, CIS Controls v8 and NIST SP 800-63 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Non-Human Identity Top 10NHI-01 — Secrets and Credential ManagementReplay detection protects reused machine credentials and rotated tokens.
Recommendation — Treat reused tokens as compromise indicators and revoke the affected credential family.
NIST CSF 2.0PR.AA — Identity Management, Authentication, and Access ControlReplay detection enforces authentication state and access trust boundaries.
Recommendation — Apply authentication controls that invalidate reused artifacts after issuance.
CIS Controls v86 — Access Control ManagementReplay handling prevents continued access through reused credentials.
Recommendation — Revoke access paths when a token reuse event indicates likely compromise.
NIST SP 800-63AAL — Authenticator Assurance LevelReplay resistance is central to authenticator assurance and token use.
Recommendation — Use replay-resistant authenticators and reject repeated presentation of one-time artifacts.
MITRE ATT&CKT1528 — Steal Application Access TokenToken replay commonly follows theft or reuse of application access tokens.
Recommendation — Map repeated token use to T1528 and hunt for token theft or reuse paths.

Deepen Your Knowledge

Sign up to our weekly newsletter — get 33% off our NHI Foundation Level Course

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