skip to main content
10.1145/3238147.3238177acmconferencesArticle/Chapter ViewAbstractPublication PagesaseConference Proceedingsconference-collections
research-article
Artifacts Available

ContractFuzzer: fuzzing smart contracts for vulnerability detection

Published:03 September 2018Publication History

ABSTRACT

Decentralized cryptocurrencies feature the use of blockchain to transfer values among peers on networks without central agency. Smart contracts are programs running on top of the blockchain consensus protocol to enable people make agreements while minimizing trusts. Millions of smart contracts have been deployed in various decentralized applications. The security vulnerabilities within those smart contracts pose significant threats to their applications. Indeed, many critical security vulnerabilities within smart contracts on Ethereum platform have caused huge financial losses to their users. In this work, we present ContractFuzzer, a novel fuzzer to test Ethereum smart contracts for security vulnerabilities. ContractFuzzer generates fuzzing inputs based on the ABI specifications of smart contracts, defines test oracles to detect security vulnerabilities, instruments the EVM to log smart contracts runtime behaviors, and analyzes these logs to report security vulnerabilities. Our fuzzing of 6991 smart contracts has flagged more than 459 vulnerabilities with high precision. In particular, our fuzzing tool successfully detects the vulnerability of the DAO contract that leads to USD 60 million loss and the vulnerabilities of Parity Wallet that have led to the loss of USD 30 million and the freezing of USD 150 million worth of Ether.

References

  1. N. Atzei, M. Bartoletti, T. Cimoli. A Survey of Attacks on Ethereum Smart Contracts. In proceedings of the 6th International Conference on Principles of Security and Trust, pp: 164-186, Berlin, Heidelberg, 2017. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. D. Aitel. SPIKE. http://immunityinc.com/resourcesfreesoftware.shtml, 2002.Google ScholarGoogle Scholar
  3. K. Bhargavan, N. Swamy, S. Zanella-Béguelin, et al. Formal Verification of Smart Contracts. In Proceedings of the 2016 ACM Workshop, pp: 91-96, 2016. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. K. Delmolino, M. Arnett, A Kosba, et al. Step by Step Towards Creating a Safe Smart Contract: Lessons and Insights from a Cryptocurrency Lab. In Proceedings of the 16th Financial Cryptography and Data Security, pp: 79-94, Berlin, Heidelberg, 2016.Google ScholarGoogle ScholarCross RefCross Ref
  5. M. Eddington. Peach. http://www.peachfuzzer.com, 2004.Google ScholarGoogle Scholar
  6. J.C. Filliâtre, A. Paskevich. Why3 - Where Programs Meet Provers. In Proceedings of the 20th ACM SIGPLAN Conference on Programming Language Design and Implementation, pp: 125-128, Berlin, Heidelberg, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. K.V. Hanford. Automatic generation of test cases. IBM Systems Journal, 9(4): 242-257, 1970. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Y. Hirai. Formal verification of Deed contract in Ethereum name service. http://yoichihirai.com/deed.pdf, 2016.Google ScholarGoogle Scholar
  9. L. Luu, D.H. Chu, H. Olickel, et al. Making Smart Contracts Smarter. In Proceedings of the 23rd ACM SIGSAC Conference on Computer and Communications Security, pp:254-269, Vienna, Austria, 2016. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. A. Miller. B. Warner, N. Wilcox et al. Gas economics. http://github.com /LeastAuthority/ethereumanalyses/blob/master/GasEcon.md, 2015.Google ScholarGoogle Scholar
  11. Satoshi Nakamoto. Bitcoin: A peer-to-peer electronic cash system. https://bitcoin.org/bitcoin.pdf, 2009.Google ScholarGoogle Scholar
  12. I. Nikolic, A. Kolluri, I. Sergey, et al. Finding The Greedy, Prodigal, and Suicidal Contracts at Scale. https://arxiv.org/pdf/1802.06038, 2018.Google ScholarGoogle Scholar
  13. P. Purdom. A sentence generator for testing parsers. Bit Numerical Mathematics, 12(3): 366-375, 1972.Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. N. Swammy, C. Keller, A. Rastogi, et al. Dependent types and multi-monadic effects in F*. In Proceedings of the 43rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp: 256-270, St. Petersburg, Florida, 2016. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. ABI of Ethereum Smart Contracts. https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI. Last access 2018.Google ScholarGoogle Scholar
  16. ABI specification of Ethereum smart contracts. http://solidity.readthedocs.io/en/v0.4.21/abi-spec.html#.Google ScholarGoogle Scholar
  17. Analysis of the DAO exploit. http://hackingdistributed.com/2016/06/18/analysis-of-thedao-exploit/. Last access, 2018.Google ScholarGoogle Scholar
  18. Announcement of imminent of hard work for EIP150 gas cost changes, https://blog.ethereum.org/2016/10/13/announcementimminent-hard-fork-eip150-gas-cost-changes/.Google ScholarGoogle Scholar
  19. Cryptocurrency Market Capital. https://coinmarketcap.com. Last access, 2018.Google ScholarGoogle Scholar
  20. Data Types in Solidity. https://solidity.readthedocs.io/en/develop/types.html#. Last access 2018.Google ScholarGoogle Scholar
  21. Echidna. https://github.com/trailofbits/echidna.Google ScholarGoogle Scholar
  22. Ethereum White Paper. https://github.com/ethereum/wiki/wiki/White-Paper. Last access, 2018.Google ScholarGoogle Scholar
  23. Ethereum Yellow Paper. https://ethereum.github.io/yellowpaper/paper.pdf. Last access, 2018.Google ScholarGoogle Scholar
  24. Ethereum Block validation algorithm. https://github.com/ethereum/wiki/wiki/Block-Protocol- 2.0#block-validation-algorithm.Google ScholarGoogle Scholar
  25. Etherscan. The Ethereum Block Explorer. https://etherscan.io/. Last access, 2018.Google ScholarGoogle Scholar
  26. Formal verification for solidity contracts. http://forum.ethereum.org/discussion//3779/formalverfication-for-solidity-contracts, 2015.Google ScholarGoogle Scholar
  27. Introduction to Smart Contracts. http://solidity.readthedocs.io/en/v0.4.21/introduction-tosmart-contracts.html. Last access, 2018.Google ScholarGoogle Scholar
  28. Number of Smart Contracts on Ethereum. https://etherscan.io/accounts/c. Last access, 2018.Google ScholarGoogle Scholar
  29. Oyente Analysis Tool for Smart Contracts. https://github.com/melonproject/oyente. Last access, 2018.Google ScholarGoogle Scholar
  30. Predicting Random Members in Ethereum Smart Contracts. https://blog.positive.com/predicting-random-numbers-inethereum-smart-contracts-e5358c6b8620. Last access, 2018.Google ScholarGoogle Scholar
  31. Smart Contracts with Verified Source Code. https://etherscan.io/contractsVerified. Last access, 2018Google ScholarGoogle Scholar
  32. The Parity Wallet Hack Explained. https://blog.zeppelin.solutions/on-the-parity-wallet-multisighack-405a8c12e8f7. Last access, 2018Google ScholarGoogle Scholar
  33. The Wallet Smart Contract Frozen by the Parity Bug. https://github.com/paritytech/parity/blob/4d08e7b0aec46443 bf26547b17d10cb302672835/js/src/contracts/snippets/enhanc ed-wallet.sol. Last access, 2018.Google ScholarGoogle Scholar
  34. Upgradable Smart Contracts. https://ethereum.stackexchange.com/questions/2404/upgrade able-smart-contracts. Last access, 2018.Google ScholarGoogle Scholar

Index Terms

  1. ContractFuzzer: fuzzing smart contracts for vulnerability detection

      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 Conferences
        ASE '18: Proceedings of the 33rd ACM/IEEE International Conference on Automated Software Engineering
        September 2018
        955 pages
        ISBN:9781450359375
        DOI:10.1145/3238147

        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 September 2018

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article

        Acceptance Rates

        Overall Acceptance Rate82of337submissions,24%

        Upcoming Conference

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader