skip to main content
10.1145/3274694.3274743acmotherconferencesArticle/Chapter ViewAbstractPublication PagesacsacConference Proceedingsconference-collections
research-article

Finding The Greedy, Prodigal, and Suicidal Contracts at Scale

Published:03 December 2018Publication History

ABSTRACT

Smart contracts---stateful executable objects hosted on blockchains like Ethereum---carry billions of dollars worth of coins and cannot be updated once deployed. We present a new systematic characterization of a class of trace vulnerabilities, which result from analyzing multiple invocations of a contract over its lifetime. We focus attention on three example properties of such trace vulnerabilities: finding contracts that either lock funds indefinitely, leak them carelessly to arbitrary users, or can be killed by anyone. We implemented Maian, the first tool for specifying and reasoning about trace properties, which employs interprocedural symbolic analysis and concrete validator for exhibiting real exploits. Our analysis of nearly one million contracts flags 34, 200 (2, 365 distinct) contracts vulnerable, in 10 seconds per contract. On a subset of 3, 759 contracts which we sampled for concrete validation and manual analysis, we reproduce real exploits at a true positive rate of 89%, yielding exploits for 3, 686 contracts. Our tool finds exploits for the infamous Parity bug that indirectly locked $200 million US worth in Ether, which previous analyses failed to capture.

References

  1. Anthony Akentiev. 2018. Parity Multisig Github. https://github.com/paritytech/parity/issues/6995Google ScholarGoogle Scholar
  2. JD Alois. 2017. Ethereum Parity Hack May Impact ETH 500,000 or $146 Million.Google ScholarGoogle Scholar
  3. Sidney Amani, Myriam Bégel, Maksym Bortin, and Mark Staples. 2018. Towards Verifying Ethereum Smart Contract Bytecode in Isabelle/HOL. In CPP. ACM, 66--77. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Nicola Atzei, Massimo Bartoletti, and Tiziana Cimoli. 2017. A Survey of Attacks on Ethereum Smart Contracts (SoK). In POST (LNCS), Vol. 10204. Springer, 164--186. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Massimo Bartoletti, Salvatore Carta, Tiziana Cimoli, and Roberto Saia. 2017. Dissecting Ponzi schemes on Ethereum: identification, analysis, and impact. CoRR abs/1703.03779 (2017).Google ScholarGoogle Scholar
  6. Karthikeyan Bhargavan, Antoine Delignat-Lavaud, Cédric Fournet, Anitha Gollamudi, Georges Gonthier, Nadim Kobeissi, Natalia Kulatova, Aseem Rastogi, Thomas Sibut-Pinote, Nikhil Swamy, and Santiago Zanella-Béguelin. 2016. Formal Verification of Smart Contracts: Short Paper. In PLAS. ACM, 91--96. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Ting Chen, Xiaoqi Li, Xiapu Luo, and Xiaosong Zhang. 2017. Under-optimized smart contracts devour your money. In IEEE 24th International Conference on Software Analysis, Evolution and Reengineering, SANER. 442--446.Google ScholarGoogle ScholarCross RefCross Ref
  8. ConsenSys Diligence. 2018. Ethereum Smart Contract Security Best Practices. https://consensys.github.io/smart-contract-best-practicesGoogle ScholarGoogle Scholar
  9. Leonardo Mendonça de Moura and Nikolaj Bjørner. 2008. Z3: An Efficient SMT Solver. In TACAS (LNCS), Vol. 4963. Springer, 337--340. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Michael del Castillo. June 17, 2016. The DAO Attacked: Code Issue Leads to $60 Million Ether Theft.Google ScholarGoogle Scholar
  11. Kevin Delmolino, Mitchell Arnett, Ahmed E. Kosba, Andrew Miller, and Elaine Shi. 2016. Step by Step Towards Creating a Safe Smart Contract: Lessons and Insights from a Cryptocurrency Lab. In FC 2016 International Workshops (LNCS), Vol. 9604. Springer, 79--94.Google ScholarGoogle ScholarCross RefCross Ref
  12. Etherscan 2018. https://etherscan.io/Google ScholarGoogle Scholar
  13. Etherscan verified source codes 2018. Etherscan verified source codes. https://etherscan.io/contractsVerifiedGoogle ScholarGoogle Scholar
  14. Jean-Christophe Filliâtre and Andrei Paskevich. 2013. Why3 - Where Programs Meet Provers. In ESOP (LNCS), Vol. 7792. Springer, 125--128. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Go-ethereum 2018. https://github.com/ethereum/go-ethereumGoogle ScholarGoogle Scholar
  16. Patrice Godefroid. 2011. Higher-order Test Generation. In PLDI. ACM, 258--269. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Governmental bug 2018. GovernMental's 1100ETH jackpot payout is stuck because it uses too much gas. https://www.reddit.com/r/ethereum/comments/4ghzhv/Google ScholarGoogle Scholar
  18. Ilya Grishchenko, Matteo Maffei, and Clara Schneidewind. 2018. A Semantic Framework for the Security Analysis of Ethereum Smart Contracts. In POST (LNCS), Vol. 10804. Springer, 243--269.Google ScholarGoogle Scholar
  19. Shelly Grossman, Ittai Abraham, Guy Golan-Gueta, Yan Michalevsky, Noam Rinetzky, Mooly Sagiv, and Yoni Zohar. 2018. Online detection of effectively callback free objects with applications to smart contracts. PACMPL 2, POPL (2018), 48:1--48:28. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Arie Gurfinkel, Temesghen Kahsai, Anvesh Komuravelli, and Jorge A. Navas. 2015. The SeaHorn Verification Framework. In CAV, Part I (LNCS), Vol. 9206. Springer, 343--361.Google ScholarGoogle Scholar
  21. Everett Hildenbrandt, Manasvi Saxena, Nishant Rodrigues, Xiaoran Zhu, Philip Daian, Dwight Guth, Daejun Park, Yi Zhang, Brandon Moore, and Grigore Rosu. 2018. KEVM: A Complete Semantics of the Ethereum Virtual Machine. In CSF. IEEE. To appear.Google ScholarGoogle Scholar
  22. Yoichi Hirai. 2017. Defining the Ethereum Virtual Machine for Interactive Theorem Provers. In 1st Workshop on Trusted Smart Contracts (LNCS), Vol. 10323. Springer, 520--535.Google ScholarGoogle Scholar
  23. Yoichi Hirai. 2017. Ethereum Virtual Machine for Coq (v0.0.2). Published online on 5 March 2017. https://goo.gl/DxYFwKGoogle ScholarGoogle Scholar
  24. Sukrit Kalra, Seep Goel, Mohan Dhawan, and Subodh Sharma. 2018. Zeus: Analyzing Safety of Smart Contracts. In NDSS. To appear.Google ScholarGoogle Scholar
  25. Johannes Krupp and Christian Rossow. 2018. teEther: Gnawing at Ethereum to Automatically Exploit Smart Contracts. In 27th USENIX Security Symposium (USENIX Security 18). USENIX Association, Baltimore, MD, 1317--1333. https://www.usenix.org/conference/usenixsecurity18/presentation/krupp Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Loi Luu, Duc-Hiep Chu, Hrishi Olickel, Prateek Saxena, and Aquinas Hobor. 2016. Making Smart Contracts Smarter. In CCS. ACM, 254--269. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Manticore 2018. https://github.com/trailofbits/manticoreGoogle ScholarGoogle Scholar
  28. Kenneth L. McMillan. 2007. Interpolants and Symbolic Model Checking. In VMCAI (LNCS), Vol. 4349. Springer, 89--90. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Mortal 2018. Contract mortal. https://etherscan.io/address/0x4671ebe586199456ca28ac050cc9473cbac829eb#codeGoogle ScholarGoogle Scholar
  30. Bernhard Mueller. January 2018. How Formal Verification Can Ensure Flawless Smart Contracts. https://goo.gl/9wUFE1Google ScholarGoogle Scholar
  31. Mythril 2018. https://github.com/b-mueller/mythril/Google ScholarGoogle Scholar
  32. Satoshi Nakamoto. 2008. Bitcoin: A peer-to-peer electronic cash system. http://bitcoin.org/bitcoin.pdfGoogle ScholarGoogle Scholar
  33. Oyente 2018. Oyente: An Analysis Tool for Smart Contracts. https://github.com/melonproject/oyenteGoogle ScholarGoogle Scholar
  34. Parity bug 2018. The guy who blew up Parity didn't know what he was doing. https://www.reddit.com/r/CryptoCurrency/comments/7beos3/Google ScholarGoogle Scholar
  35. Jack Pettersson and Robert Edström. 2016. Safer Smart Contracts through Type-Driven Development. Master's thesis. Chalmers University of Technology, Sweden.Google ScholarGoogle Scholar
  36. George Pîrlea and Ilya Sergey. 2018. Mechanising blockchain consensus. In CPP. ACM, 78--90. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Christian Reitwiessner. 2015. Formal Verification for Solidity Contracts. https://forum.ethereum.org/discussion/3779/formal-verification-for-solidity-contractsGoogle ScholarGoogle Scholar
  38. Grigore Rosu. December 2017. ERC20-K: Formal Executable Specification of ERC20. https://runtimeverification.com/blog/?p=496Google ScholarGoogle Scholar
  39. Securify 2018. Securify: Formal Verification of Ethereum Smart Contracts. http://securify.ch/Google ScholarGoogle Scholar
  40. Ilya Sergey and Aquinas Hobor. 2017. A Concurrent Perspective on Smart Contracts. In 1st Workshop on Trusted Smart Contracts (LNCS), Vol. 10323. Springer, 478--493.Google ScholarGoogle ScholarCross RefCross Ref
  41. Emin Gün Sirer. 2016. Reentrancy Woes in Smart Contracts. http://hackingdistributed.com/2016/07/13/reentrancy-woes/Google ScholarGoogle Scholar
  42. Solidity 2018. Solidity: High-Level Language for Implementing Smart Contracts. http://solidity.readthedocs.io/Google ScholarGoogle Scholar
  43. Gavin Wood. 2014. Ethereum: A Secure Decentralised Generalised Transaction Ledger. https://ethereum.github.io/yellowpaper/paper.pdfGoogle ScholarGoogle Scholar

Recommendations

Comments

Login options

Check if you have access through your login credentials or your institution to get full access on this article.

Sign in
  • Published in

    cover image ACM Other conferences
    ACSAC '18: Proceedings of the 34th Annual Computer Security Applications Conference
    December 2018
    766 pages
    ISBN:9781450365697
    DOI:10.1145/3274694

    Copyright © 2018 ACM

    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    • Published: 3 December 2018

    Permissions

    Request permissions about this article.

    Request Permissions

    Check for updates

    Qualifiers

    • research-article
    • Research
    • Refereed limited

    Acceptance Rates

    Overall Acceptance Rate104of497submissions,21%

PDF Format

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader