Skip to content

Bridge Message Replay (No Processed-Nonce Map)

SAFE-0245 Bridge / Cross-Chain Checked automatically by the scanner
1

What goes wrong

An inbound cross-chain message is executed without recording and checking a per-message unique id/nonce. The same proof/message can be submitted repeatedly to mint or release funds multiple times.

2

The vulnerable pattern

proof of concept — how it is exploited
// receiveMessage(proof) mints 100 to user, no processed-map.
// attacker resubmits the identical proof N times -> mints 100*N.
3

How to fix it

the pattern that is safe
require(!processed[msgId], "replayed");
processed[msgId] = true;
_release(to, amount);
Track and reject already-processed message ids.
Check your own contract for this

The SaferICO scanner runs 201 detectors over your Solidity source, SAFE-0245 among them. Paste an address or the source itself — a small per-scan fee, shown before you sign, or unlimited on any plan.

Run the scanner See how it is attacked Read the docs