liveBook · Manning

Replay attack

As explained in The Design of Web APIs, Second Edition

Request replay is the repeated submission of a previously captured API request, potentially causing an operation to occur more than once.

A replay attack repeatedly submits a previously captured API request, risking duplicate operations and compromised data integrity. section 12.1.2 section 12.5

A retried order or transfer

If a consumer receives no response after POST /orders, it may retry and create a duplicate. For POST /transfers, a mobile user may retry after a technical error even though the server already processed the transfer. section 12.1.2 section 12.5.3

Prevent replay by combining request identity with business-aware duplicate checks:

  • Require a consumer-generated unique identifier, typically an Idempotency-Key UUID; reject a repeated identifier with 409 Conflict. section 12.5.3
  • Detect identical business data, such as amount, source, and destination, within a context-specific time window. section 12.5.3
  • Allow an intentional repeat through an explicit Confirm-Duplicate: true header. section 12.5.3

How The Design of Web APIs, Second Edition covers it

How deep it goes
Explains duplicate creation, unique request identifiers, conflict responses, business checks, and explicit duplicate confirmation.
Examples
Uses retried orders and money transfers to demonstrate duplicate operations and uncertain server processing.
What it assumes
Assumes API consumers can retry requests and distinguishes technical request identity from business-level duplicate data.
What you can do after
Operate/configure APIs with unique request identifiers, conflict handling, and business-level duplicate checks.
How it connects
Connects request replay with HTTP methods, idempotency keys, conditional updates, and data integrity.

Also explained in

Compare how 3 books explain replay attack →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of The Design of Web APIs, Second Edition. The section links point to the parts of the book it draws on.