Blog / A07:2021 Identification and Authentication Failures
A07:2021 · Identification and Authentication Failures

A Delivery Receipt Anyone Can Replay

The code decides a message was delivered by reading one field on an incoming report. No freshness, no origin check. Replay yesterday's receipt and it counts again.

report arrives athandlertype read assuccessno state ororigin checkdelivery callbackinvokedreplayed reportre-countsATTACKER INPUTIMPACTtrust boundary crossed
Attack path · report arrives at handler → type read as success → no state or origin check → delivery callback invoked → replayed report re-counts

The code decides a message was delivered by reading one field on an incoming report. No freshness, no origin check. Replay yesterday's receipt and it counts again.

What goes wrong

This handler decides a response was delivered by looking at one thing: the report's type says success. It does not check the protocol state, it does not check where the report came from, and it does not tie the report to the transfer it supposedly confirms. A single field carries the whole decision.

That makes the receipt trivial to forge and just as easy to replay. Capture one legitimate success report and you can send it again later to make the code believe a fresh delivery happened. A hostile peer can manufacture one from nothing. Either way the completion path runs when nothing was delivered.

The fix is not more parsing. It is binding the report to what an attacker cannot reproduce. Tie it to the current state and the active transfer's id, and confirm the sender is the peer you established the session with. A receipt without those is a guess.

The pattern

Vulnerable
function onReport(report) {
  if (report.type == SUCCESS) {
    markDelivered()
    onResponseSent()   // one field decides it
  }
}
Hardened
function onReport(report) {
  if (report.type != SUCCESS) return
  if (state != AWAITING_ACK) return
  if (report.transferId != activeTransfer) return
  if (!freshNonceSeen(report.nonce)) return   // block replay
  markDelivered()
  onResponseSent()
}
How the pipeline adjudicated itHELD
ABCDEFGH

Grounding and reachability were confirmed. The exploit-path gate would not conclude without the calling code, so the finding was held and an evidence request was raised instead of being reported as fact.

Ed25519 · per-tenant signing key · gate ledger A–H · verify offline against the published payload hash

Why it matters to you

When 'delivered' or 'confirmed' can be asserted by a replayed message, your audit trail lies. You will show a delivery that never landed, or a confirmation an attacker faked. Anything downstream that leans on that signal, whether billing or non-repudiation, inherits the forgery. Freshness and origin binding are cheap. Reconstructing what actually happened after the fact is not.

Check your own code