EOSBet Hack
What happened
On 15 October 2018, the EOS gambling dApp EOSBet was drained through a "fake transfer notice" flaw in its dice contract eosbetdice11. The contract acted on any EOS transfer notification it received, without checking that the transfer was actually sent to EOSBet. The attacker moved EOS between two of their own accounts, had one of them forward the notification to EOSBet, and was credited with bets and winnings without paying anything.
PeckShield traced the same trick to five attacker accounts between 10 and 15 October. The largest run, by ilovedice123 on 15 October, collected 138,724 EOS. Within minutes, that account deposited 72,150 EOS to Bitfinex and 65,100 EOS to Poloniex.
PeckShield put the attacker's total at 145,321 EOS, over $700,000 at the time. Early press reports cited 65,000 EOS (about $338,000). EOSBet later published a fix that makes the transfer handler return unless transfer.to == _self.
This was EOSBet's second exploit in about a month, after a fake-EOS attack in September 2018.
How it happened
- On EOS, when
eosio.tokenmoves EOS from A to B, both accounts get a notification. If B has a contract, it can forward that notification to any other account withrequire_recipient. - EOSBet's
transferhandler ignored transfers sent by itself oreosbetcasino, but it never checked that the transfer'stofield was EOSBet itself. - The attacker sent EOS from
ilovedice123to their own accountwhoiswinner1. The contract onwhoiswinner1forwarded the notification toeosbetdice11withrequire_recipient. - EOSBet treated each forwarded notification as a real bet and paid out winnings from its own balance. The attacker's EOS never left their control, so a losing bet cost them nothing.
- After small trial runs from other accounts starting on 10 Oct,
ilovedice123ran the large attack on 15 Oct and moved the proceeds to Bitfinex and Poloniex deposit accounts.
Protocol details
Evidence
- analysis DeFiLlama defillama.com
- analysis "Fake Transfer Notice" Loophole Details Explained, 140K EOS Tokens Lost by EOSBet (PeckShield, 26 Oct 2018; Wayback copy) blog.peckshield.com
- analysis EOS dApp 漏洞盘点分析 - EOSBet 假充值漏洞2 (NoneAge; Wayback copy) blog.noneage.com
- analysis Hackers target EOS gambling dApp once again, $338K believed stolen (The Next Web, 15 Oct 2018) thenextweb.com
- analysis EOSBet Got Hacked Again; Lost 65000 EOS To Hackers (Latest Hacking News, 19 Oct 2018) latesthackingnews.com
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.