Worked example · 2020-06
Bancor v0.6 BancorNetwork exposed-approval vulnerability — Ethereum — 2020-06-18
Summary
Bancor deployed v0.6 of its BancorNetwork contracts on 2020-06-16. The contracts "mistakenly made a safeTransferFrom function in the BancorNetwork contract public", so anyone could use users' existing token approvals to move their tokens [theblock1]``[decrypt1]. Bancor discovered the problem around midnight GMT into 2020-06-18 and warned its community [decrypt1].
Bancor ran a white-hat operation, moving roughly $410K-$455K of exposed user funds to a safe wallet in batched transactions; two arbitrage bots detected the pending transactions and front-ran them, earning about $135K [theblock1]``[decrypt1]. Bancor deployed a patched network contract and told users who had traded in the previous 48 hours to revoke their approvals to the old contract [theblock1]``[decrypt1]. Bancor contacted the bot owners seeking return of funds in exchange for a bug bounty [theblock1].
This is distinct from the July 2018 Bancor compromise (see examples/2018-07-bancor.md), which was a custody-layer incident.
Timeline (UTC)
| When | Event | OAK ref |
|---|---|---|
| 2020-06-16 | Bancor deploys v0.6 contracts with a publicly callable safeTransferFrom in BancorNetwork |
T9.004 |
| 2020-06-17/18 | Bancor discovers the issue (around midnight GMT) and rescues exposed funds in batched transactions; two bots front-run | (defender response) |
| 2020-06-18 | Patched contract deployed; users told to revoke approvals; Bancor seeks return of the front-run funds | (remediation) |
Realised extraction
About $135K was captured by two front-running bots per The Block; Decrypt gave about $135K combined ($132K + $3K). Whether it was returned is not established in the cited sources [theblock1]``[decrypt1].
Public references
[theblock1]— The Block, "DEX protocol Bancor suffered security vulnerability, migrated $455K worth of user funds" (2020-06-18): https://www.theblock.co/news/defi/2020-06-18-dex-protocol-bancor-suffered-security-vulnerability-migrated-455k-worth-of-user-funds-68791[decrypt1]— Decrypt, "A cryptocurrency bug put $545,000 of DeFi funds at risk" (2020-06-18): https://decrypt.co/32720/a-cryptocurrency-bug-put-545000-of-defi-funds-at-risk/