Reproduced Exploit

Sweep n Flip Bridge — Permanent failure to bridge wrapped ERC721

1. Bridging an origin NFT locks it on the source bridge and mints a wrap on the destination. 2. Reverse-bridging the wrap must read metadata from the wrap (which exists on dest). 3. The bug binds IERC721Metadata to the origin address, which has no code on dest. 4. sendERC721UsingNative always rever…

Nov 2024Otherdos3 min read

Chain

Other

Category

dos

Date

Nov 2024

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. No backend, no live RPC.

Loading fork state…

Source & credit. Reproduction of a public audit finding curated by AuditVault — the original finding: 46493-permanent-failure-to-bridge-wrapped-erc721-using-bridgesende. Standalone Foundry PoC and full write-up: 46493-permanent-failure-to-bridge-wrapped-erc721-using-bridgesende_exp in the evm-hack-registry mirror.


Vulnerability classes: vuln/dos/frozen-funds · locked-funds · bridge-message-validation · royalty-edge-cases

Reproduction: self-contained Foundry PoC, offline, forge-std only. Full trace: output.txt. PoC: test/46493-permanent-failure-to-bridge-wrapped-erc721-using-bridgesende_exp.sol.


Key info#

ImpactHIGH — original NFT permanently locked; wrap cannot reverse-bridge
ProtocolSweep n Flip Bridge
Vulnerable codeBridge._getPayload / _getPayloadMessage — metadata from origin when bridging wrap
Bug classWrong metadata source for wrapped ERC721 → send always reverts on dest
FindingCantina — Sweep n Flip Bridge, Nov 2024 · #46493 · reporter slowfi
Reportcantina_sweepnflip_bridge_november2024.pdf
SourceAuditVault
StatusAudit finding — fixed in snf-bridge-contracts-v1 PR 10
Compiler^0.8.24 (PoC)

TL;DR#

  1. Bridging an origin NFT locks it on the source bridge and mints a wrap on the destination.
  2. Reverse-bridging the wrap must read metadata from the wrap (which exists on dest).
  3. The bug binds IERC721Metadata to the origin address, which has no code on dest.
  4. sendERC721UsingNative always reverts on the wrap path → original NFT stays locked forever.

The vulnerable code#

SOLIDITY
address originERC721Address =
    w.originAddress == address(0) ? ERC721Address_ : w.originAddress;
IERC721Metadata metadata = IERC721Metadata(originERC721Address); // @> VULN
metadata.name();
metadata.tokenURI(tokenIds_[i]);

Fix: use currChainAddress_ (the wrap when bridging a wrap) for metadata.


Root cause#

Payload construction confuses origin vs current-chain addresses. Metadata must come from the contract that exists on the current chain.

Preconditions#

  • User successfully bridged origin → wrap (origin locked on source).
  • User attempts wrap → origin reverse bridge on the destination chain.
  • Origin collection address is codeless on the destination.

Attack walkthrough#

  1. Origin NFT locked in source bridge; wrap minted to user on dest.
  2. User calls sendERC721UsingNative(originChain, wrap, [id]).
  3. _getPayload queries tokenURI on the codeless origin address → revert.
  4. HARM: wrap unredeemable; origin permanently locked in source bridge.

Diagrams#

flowchart TD A["User holds wrap on dest"] --> B["sendERC721UsingNative wrap"] B --> C{"Metadata source"} C -->|"BUG: origin address"| D["codeless on dest → revert"] C -->|"FIX: wrap address"| E["tokenURI succeeds"] D --> F["Origin NFT locked forever"] E --> G["Reverse bridge completes"]

Impact#

Permanent lock of original NFTs in the source bridge whenever users try to bridge wraps home.

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.