Replay Attack - what it is, how it works, and how to prevent token reuse

Replay Attack

What it is

A replay attack is when an attacker captures a valid network message (like a login or payment request) and sends it again to trick a system into granting access or repeating an action. The attacker doesn’t need to read or change the contents—just re-transmit them at the right time. Replay usually rides on a compromised or untrusted network path (malware on the device, rogue Wi-Fi, or local MitM) and succeeds when the protocol lacks freshness checks such as nonces, timestamps, or one-time tokens.

Why it matters

Replay can bypass passwords and some MFA flows by reusing session cookies, bearer tokens, or previously valid requests. That can mean unauthorized logins, duplicated transactions, or account changes without the victim realizing.

How it works - quick tour

  • Intercept: capture an authenticated request or token on a weak or compromised path.

  • Store: hold the message until it’s useful or the token is still valid.

  • Re-send: transmit the same bytes to the server to repeat the original effect.

  • Pivot: use the resulting session to pull data, change settings, or move laterally.

Red flags

  • Identical requests hitting an API with the same payload and headers within short intervals.

  • Successful logins that skip fresh MFA challenges, followed by token reuse from new IPs.

  • Duplicate transaction IDs or nonce failures in logs.

  • Sudden activity from untrusted networks shortly after a user’s legitimate action.

Prevent it

  • Enforce TLS with strict certificate validation; block captive portals and rogue APs on sensitive devices.

  • Add freshness: nonces, one-time tokens, signed requests, and short token lifetimes.

  • Bind tokens to context (client TLS key, device ID, or IP range) and invalidate on change.

  • Use SameSite+HttpOnly+Secure cookies; rotate sessions after auth and on privilege changes.

  • Require server-side replay detection (nonce store, timestamp windows, idempotency keys).

    Glossary (A–Z)

    All A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
      • Related Articles

      • Form-Based Authentication

        What it is Form-based authentication is the login box you see on most websites. A page asks for your username and password, then the app checks them and signs you in if they match. How it works - quick tour You enter credentials in a web form and ...
      • Web Protection

        What it is Web protection is a bundle of tools and settings that keep you safer while you browse. It blocks dangerous sites and downloads, warns about fake logins, filters sketchy links, and helps keep your info private. It can run on your device ...
      • Web Cache Poisoning

        What it is Web cache poisoning is when attackers sneak bad content into a website’s cache. The cache is a “shortcut” server use to make pages load faster for everyone. If it’s poisoned, later visitors get the attacker’s fake version instead of the ...
      • MFA (Multi-Factor Authentication)

        What it is Multi-Factor Authentication (MFA) adds an extra check when you sign in, so it is not just a password. You confirm with something you know (password) plus something you have or are. For a short primer, see our MFA explainer. Why it matters ...
      • URL Redirection Attack

        What it is A URL redirection attack tricks your browser into leaving a real site and loading a fake one. The attacker slips a redirect into a link or page (or abuses a site’s “open redirect” bug), so when you click, you’re quietly sent to a malicious ...