# ChainSwap bridge: signature reuse mints unlimited tokens

ChainSwap bridge Factory receive() accepted a single reused signature per tx, letting attacker mint 500k WILD per call across 40 txs and drain ~$4.4M.

- Payout: Real-world hack
- Severity: critical
- Program: Chainswap
- Analysis by: DeFiHackLabs
- Disclosed: 2021-07-10
- Write-up quality: 7/10
- Original: https://github.com/SunWeb3Sec/DeFiHackLabs/blob/main/src/test/2021-07/Chainswap_exp2.sol
- Library page: http://bugbountylibrary.com/r/dhl%3A20210710-chainswap-exp2
- Tags: area:web3 domain:web3 impact:funds-loss impact:integrity kind:incident platform:defihacklabs sev:critical tech:evm tech:solidity technique:source-review vuln:access-control vuln:business-logic vuln:signature-replay

**Target:** Cross-chain bridge Factory minting contract (receive function)
**Root cause:** The receive() minting function's signature authorization check was flawed: a single valid signature could be reused across transactions by varying the recipient address, so no per-tx binding of signatory to message prevented arbitrary minting.
**Steps:**
1. Fork BSC at block 9,042,274.
2. Build `Signature[]` with one entry: signatory `0xF1790Ac4900F761F677107de65CE6Ed65f952A7c`, v=28, r=0x961afd..., s=0x39884d....
3. Call proxy `0x089165ac9a7Bf61833Da86268F34A01652543466` with `receive(1, exploiter, 0, 500_000_000_000_000_000_000_000, sigs)`.
4. Pay 0.005 ETH chargeFee per call; repeat with a new recipient address each tx to dodge the auth check.
5. Sell minted tokens (e.g. 20M WILD -> ~650 WBNB on PancakeSwap), depleting pools.
**How found:** Analysis credits @cmichelio; the flaw was in the sloppy auth check allowing a new address as signature each tx, enabling signature reuse for minting.
**Exploitation:** Attacker called the Factory receive() with a single valid signature, setting `to` to a fresh address each tx and volume 500k tokens, paying 0.005 ETH fee per call. Repeated 40x per token across 20 tokens on BSC, then swapped minted tokens on PancakeSwap (20M WILD -> ~650 WBNB ~$200k, draining WILD/WBNB pool) and bridged/cashed out via 1inch (456 ETH ~$935k). Total ~$4.4M.
**Escalation:** Repeated the same signature across many recipient addresses and 20 different token Factory contracts, scaling minted volume and draining multiple liquidity pools.
**Insight:** On bridge mint functions, check whether a signature is bound to the recipient, nonce, and volume; if the same signatory signature validates for arbitrary `to` addresses, it can be replayed to mint unlimited tokens.

