Reproduced Exploit

SatsBridge: anyone can route a forwarder and take its tokens

route() can be called by anyone while the forwarder is in its initial state. An attacker points the route at themselves, uses a preimage they already know, and sets the timelock to type(uint256).max. The admin can no longer sweep. settle with the known preimage transfers the forwarder's 100 tokens…

Jan 2025•Ethereum•access-control•3 min read

Loss

100 service tokens move to the attacker. The admin sweep reverts

Chain

Ethereum

Category

access-control

Date

Jan 2025

Source

AuditVault

EVM Playground

Source-level debugger — step opcodes and Solidity in sync

evm-hack-analyzer

The attack is replayed in an in-browser EVM preloaded with the exact dumped fork state. The execution tree shows every call; step by Solidity line or by opcode across all depths — source, Stack, Memory, Storage, Balances (native / ERC-20 / NFT), Transient storage and Return value stay in sync. Click a tree node, opcode, or source line to jump. Query opens a search over the trace: previous and next writes, balance changes and calls, breakpoints, and a diff of everything that changed between two steps. No backend, no live RPC.

Loading fork state…

Source & credit. Reproduction of a public audit finding curated by AuditVault — the original finding: 46080-permissionless-route-creation-leads-to-contract-dos-and-toke. Standalone Foundry PoC and full write-up: 46080-permissionless-route-creation-leads-to-contract-dos-and-toke_exp in the evm-hack-registry mirror.


Vulnerability classes: vuln/access-control/missing-auth · vuln/dos/frozen-funds

Key info#

FieldValue
Loss100 service tokens move to the attacker. The admin sweep reverts
Vulnerable contractForwarderHashedTimelockERC20.route
Attacker EOA0x1111111111111111111111111111111111111111
Attack contractExploit
Attack txExploit.run()
Chain / block / dateEthereum model · local · 2025-01
Compilersolc 0.8.27, cancun
Bug classPermissionless route with an unbounded timelock and a known preimage

TL;DR#

route() can be called by anyone while the forwarder is in its initial state. An attacker points the route at themselves, uses a preimage they already know, and sets the timelock to type(uint256).max. The admin can no longer sweep. settle with the known preimage transfers the forwarder's 100 tokens to the attacker.

Background#

Cantina's January 2025 SatsBridge review, reported by Sujith Somraaj, on ForwarderHashedTimelockERC20.route at line 64. The report gives a permanent-DoS scenario and a theft scenario. This run does both: the admin transfer reverts, then settle pays the attacker. SatsBridge later required msg.sender == owner() for outgoing routes, in commit 05ea0763.

The vulnerable code#

SOLIDITY
counterparty = _counterparty; // @> VULN: any caller can bind the forwarder's tokens
incoming = _incoming;
hashlock = _hashlock;
timelock = _timelock; // no upper bound
DIFF
+ require(msg.sender == owner, "Only owner can set outgoing transfers");
+ require(_timelock <= block.timestamp + 2 days);
+ require(_hashlock != bytes32(0));

Root cause#

route changes the forwarder out of the initial state with no caller check and no bound on the lock. transfer refuses to run once that state has changed. settle pays whoever the route named, as long as the preimage matches a hash the attacker chose.

Preconditions#

  • The forwarder holds 100 service tokens and counterparty is unset.
  • The attacker calls route with incoming = false, so they do not have to deposit.
  • The hashlock is sha256 of a preimage the attacker knows.

Attack walkthrough#

  1. The attacker calls route with themselves as counterparty, timelock uint256 max, and a known hashlock.
  2. The admin calls transfer. It reverts because the state is no longer initial.
  3. The attacker calls settle with the preimage.
  4. The forwarder transfers 100 tokens to the attacker and its balance is 0.

Diagrams#

flowchart TD A["Forwarder holds 100 service tokens"] --> B["Attacker calls route with a known preimage"] B --> C["VULN counterparty and max timelock are stored"] C --> D["Admin sweep reverts because state is no longer initial"] D --> E["settle matches the preimage"] E --> F["100 tokens move to the attacker"]

Impact#

The project cannot recover the 100 tokens through the admin transfer. The attacker receives all 100. A forwarder that nobody has routed can still be swept by the admin, which the control test shows.

Remediation#

Require the owner for an outgoing route, cap the timelock, reject a zero hashlock, and sweep leftover service tokens to a treasury when a route is reset.

How to reproduce#

BASH
cd 46080-permissionless-route-creation-leads-to-contract-dos-and-toke_exp
forge test -vv

test_exploit_attacker_steals_100_and_blocks_admin asserts the admin is blocked and the attacker holds 100 ether of the token. test_control_owner_only_route_keeps_admin_sweep asserts an unrouted forwarder can still be swept. Captured output is output.txt.

Sources#


Sources & further analysis#

Reproductions & code

Alerts & third-party analyses

  • Web3Sec X hacked database: search.
  • Rekt leaderboard: search.
  • Solodit incident search: search.

These dashboards index community alerts tweets, post-mortems, and independent write-ups. Reach them through the protocol name above to cross-check this reproduction against other analyses.