automated formal verification of smart contracts
play

Automated Formal Verification of Smart Contracts Florian Hubert - PowerPoint PPT Presentation

Automated Formal Verification of Smart Contracts Florian Hubert Dana Drachsler- Andrei Arthur Quentin Petar Martin Buenzli Ritzdorf Cohen Dan Gervais Hibon Tsankov Vechev Growth of the Ethereum Ecosystem $27B Billions of USD are


  1. Automated Formal Verification of Smart Contracts Florian Hubert Dana Drachsler- Andrei Arthur Quentin Petar Martin Buenzli Ritzdorf Cohen Dan Gervais Hibon Tsankov Vechev

  2. Growth of the Ethereum Ecosystem $27B Billions of USD are traded by Ethereum smart contracts $1B $50M Jul Aug Oct 2015 2016 2017 Emerging businesses are built on top of Ethereum smart contracts

  3. Smart Contract Secu curi rity ty Bugs in the News

  4. What are Ethereum Smart Contracts? contract Wallet { uint balance = 10; Transfer $$$ function withdraw(){ to the caller if(balance > 0) msg.sender.call.value(balance)(); balance = 0; } } § Small programs that handle money (ether) § Executed on the Ethereum blockchain § Written in high-level languages ( e.g. , Solidity) § No patching after release What can go wrong when programs handle billions of USD?

  5. Security Bugs in Ethereum Smart Contracts

  6. Security Bug #1: Reentrancy User Contract Wallet Contract function moveBalance() { uint balance = 10; wallet.withdraw(); withdraw() } function withdraw() { ... if(balance > 0) 10 ether function () payable { msg.sender.call.value(balance)(); balance = 0; wallet.withdraw(); withdraw() } } balance is set to 0 calls withdraw() 10 ether after ether transfer before balance is set to 0 ... An attacker used this bug to steal 3.6M ether (equivalent of $1B today )

  7. Security Bug #2: Un Unpriv rivile ileged wr write e to storage Wallet Contract address owner = ...; Any user may change the function initWallet(address _owner) { wallet’s owner owner = _owner; } function withdraw(uint amount) { if (msg.sender == owner) { owner.send(amount); Only owner can } send ether } An attacker used a similar bug to steal $32M few weeks ago

  8. More Security Bugs… Unexpected ether flows Insecure coding, such as unprivileged writes (e.g., Multisig Parity bug) Use of unsafe inputs (e.g., reflection, hashing, …) Reentrant method calls (e.g., DAO bug) Transaction reordering

  9. Au Automated Security An Analysis

  10. Automated Security Analysis: Existing Solutions All possible contract Security behaviors Bugs Problem : Cannot enumerate all possible contract behaviors…

  11. Automated Security Analysis: Existing Solutions § Static analysis § Testing § Dynamic analysis § Formal verification § Symbolic execution Very limited guarantees Better than testing, but Strong guarantees can still miss vulnerabilities

  12. Automated Security Analysis: Existing Solutions Existing Solutions Strong Guarantees Automated Oyente ITP-based § Static analysis § Testing § Dynamic analysis § Formal verification § Symbolic execution Very limited guarantees Better than testing, but Strong guarantees can still miss vulnerabilities

  13. The first fully automated , one-click, formal verification system for Ethereum smart contracts Provides trust towards both contract users and developers www.securify.ch

  14. Demo

  15. www.securify.ch Released last month, so far: 95% positive feedback >1K uploaded smart contracts >150 users signed up for updates Interesting discussions on Reddit

  16. Join us! ChainSecur Cha curity ty Enabling Trust in Blockchains Cutting-edge research in the area of: § Program analysis and synthesis § Machine learning § Blockchain / network security Join our team of security / blockchain / program analysis experts http://jsnice.org http://apk-deguard.com contact@chainsecurity.com http://securify.ch @chain_security http://psisolver.org http://eventracer.org http://www.srl.inf.ethz.ch

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend