mining? Answer: gasPrice and then nonce What can we do? Front-running attack! Case: Dsec ICO lottery Pending Lottery robot TX: {gasPrice: N, input: X} Player TX: {gasPrice: N+1, input: X}
mining? Answer: gasPrice and then nonce What can we do? Front-running attack! Case: Dsec ICO lottery Lottery robot TX: {gasPrice: N, input: X} Player TX: {gasPrice: N+1, input: X} Block
mining? Answer: gasPrice and then nonce What can we do? Front-running attack! Case: Dsec ICO lottery In while case: Bancor exchange Mitigations: tx.gasprice Lottery robot TX: {gasPrice: N, input: X} Player TX: {gasPrice: N+1, input: X} Block Be aware! Miners can order transactions as they wish! (infura?)
According to a yellow paper: Hs is timestamp of block H and must fulfil the relation: Hs > P(H)Hs Along with Geth source code “says”: Take into account: time to next block is about 12-17 sec… Miner can manipulate block.timestamp in several seconds at least! Don’t use it for: • entropy source • determining of “winner”
block - only works for 256 most recent blocks! Don’t use blockhash of current block also! Malicious miner can cheat here. martin.swende.se/blog Inspired by Smartbillions lottery
DAO without smart contract knowledge? • XSS • Fishing • Site defacement + clipboard manipulation • etc… And other vectors: • Weak passwords for Social Network accounts (twitter, slack, FB, etc.) • Hack related infrastructure and do pivoting • Attack on an unlocked wallet (JSON RPC) – origin: *
similar to that of a victim: icokoi.co -> icokoi.com • Copy a victim website and replace ICO smart contact address • Spam spam spam! Mitigations: • Be offensive! Monitor similar domains and inform users (URLCrazy) • Metamask EtherAddressLookup blacklist • Register fishing sites at local DNS and resolve them to alert page (for a team only). Hi @jrunjrun
to RCP -> “authentication needed: password or unlock” What developer do: • personal.account(eth.coinbase, 'notReallyStrongPass', 0) • --unlock “0” --password “path/pass” But not work for browser IDE yet: • --rpccorsdomain “*” Сonsequences: • Any website or program can silently send transaction as developer
Social network and email accounts • Third-party Lib/Apps/Chats/API • Oracles (Shapeshift and similar) • Mail/VPN/WEB/Mobile/… server • ALL hosts you control (including laptops) Numerous attack vectors!