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

SolSaviour: A Defending Framework for Deployed Defective Smart Contracts

Authors Info & Claims
Published:06 December 2021Publication History

ABSTRACT

A smart contract cannot be modified once deployed. Bugs in deployed smart contracts may cause devastating consequences. For example, the infamous reentrancy bug in the DAO contract allows attackers to arbitrarily withdraw ethers, which caused millions of dollars loss. Currently, the main countermeasure against contract bugs is to thoroughly detect and verify contracts before deployment, which, however, cannot defend against unknown bugs. These detection methods also suffer from possible false negative results.

In this paper, we propose SolSaviour, a framework for repairing and recovering deployed defective smart contracts by redeploying patched contracts and migrating old contracts’ internal states to the new ones. SolSaviour consists of a voteDestruct mechanism and a TEE cluster. The voteDestruct mechanism allows contract stake holders to decide whether to destroy the defective contract and withdraw inside assets. The TEE cluster is responsible for asset escrow, redeployment of patched contracts, and state migration. Our experiment results show that SolSaviour can successfully repair vulnerabilities, reduce asset losses, and recover all defective contracts. To the best of our knowledge, we are the first to propose a defending mechanism for repairing and recovering deployed defective smart contracts.

References

  1. Anthony Akentiev. 2017. Parity Multisig Hacked. Again. https://medium.com/chain-cloud-company-blog/parity-multisig-hack-again-b46771eaa838Google ScholarGoogle Scholar
  2. Eric Banisadr. 2018. How $800k Evaporated from the PoWH Coin Ponzi Scheme Overnight. https://medium.com/@ebanisadr/how-800k-evaporated-from-the-powh-coin-ponzi-scheme-overnight-1b025c33b530Google ScholarGoogle Scholar
  3. Karthikeyan Bhargavan, Antoine Delignat-Lavaud, Cédric Fournet, Anitha Gollamudi, Georges Gonthier, Nadim Kobeissi, Natalia Kulatova, Aseem Rastogi, Thomas Sibut-Pinote, Nikhil Swamy, 2016. Formal verification of smart contracts: Short paper. In Proceedings of the 2016 ACM workshop on programming languages and analysis for security. 91–96.Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Ivan Bogatyy. 2017. Implementing Ethereum trading front-runs on the Bancor exchange in Python. https://hackernoon.com/front-running-bancor-in-150-lines-of-python-with-ethereum-api-d5e2bfd0d798Google ScholarGoogle Scholar
  5. Mic Bowman, Andrea Miele, Michael Steiner, and Bruno Vavala. 2018. Private Data Objects: An Overview. arXiv preprint arXiv:1807.05686(2018).Google ScholarGoogle Scholar
  6. Lorenz Breidenbach, Phil Daian, Ari Juels, and Emin Gün Sirer. 2017. An In-Depth Look at the Parity Multisig Bug. https://hackingdistributed.com/2017/07/22/deep-dive-parity-bug/Google ScholarGoogle Scholar
  7. Lexi Brent, Neville Grech, Sifis Lagouvardos, Bernhard Scholz, and Yannis Smaragdakis. 2020. Ethainter: A smart contract security analyzer for composite vulnerabilities. In Proceedings of the 41st ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI). 454–469.Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Vitalik Buterin. 2016. CRITICAL UPDATE Re: DAO Vulnerability. https://blog.ethereum.org/2016/06/17/critical-update-re-dao-vulnerability/Google ScholarGoogle Scholar
  9. Jiachi Chen, Xin Xia, David Lo, John Grundy, Xiapu Luo, and Ting Chen. 2020. Defining smart contract defects on Ethereum. IEEE Transactions on Software Engineering(2020), 1–17.Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Jiachi Chen, Xin Xia, David Lo, John Grundy, Xiapu Luo, and Ting Chen. 2021. Defectchecker: Automated smart contract defect detection by analyzing EVM bytecode. IEEE Transactions on Software Engineering(2021), 1–20.Google ScholarGoogle Scholar
  11. Ting Chen, Rong Cao, Ting Li, Xiapu Luo, Guofei Gu, Yufei Zhang, Zhou Liao, Hang Zhu, Gang Chen, Zheyuan He, 2020. SODA: A generic online detection framework for smart contracts. In NDSS. 1–17.Google ScholarGoogle Scholar
  12. Raymond Cheng, Fan Zhang, Jernej Kos, Warren He, Nicholas Hynes, Noah Johnson, Ari Juels, Andrew Miller, and Dawn Song. 2019. Ekiden: A Platform for Confidentiality-Preserving, Trustworthy, and Performant Smart Contracts. In 2019 IEEE European Symposium on Security and Privacy. 185–200.Google ScholarGoogle ScholarCross RefCross Ref
  13. Poulami Das, Lisa Eckey, Tommaso Frassetto, David Gens, Kristina Hostáková, Patrick Jauernig, Sebastian Faust, and Ahmad-Reza Sadeghi. 2019. Fastkitten: Practical Smart Contracts on Bitcoin. In 28th USENIX Security Symposium. 801–818.Google ScholarGoogle Scholar
  14. Joshua Ellul and Gordon J Pace. 2018. Runtime verification of Ethereum smart contracts. In 2018 14th European Dependable Computing Conference (EDCC). IEEE, 158–163.Google ScholarGoogle ScholarCross RefCross Ref
  15. Josselin Feist, Gustavo Grieco, and Alex Groce. 2019. Slither: a static analysis framework for smart contracts. In 2019 IEEE/ACM 2nd International Workshop on Emerging Trends in Software Engineering for Blockchain (WETSEB). IEEE, 8–15.Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Josselin Feist, Gustavo Grieco, and Alex Groce. 2021. sGUARD: Towards fixing vulnerable smart contracts automatically. In 2021 IEEE Symposium on Security and Privacy (SP). IEEE, 1–15.Google ScholarGoogle Scholar
  17. Christof Ferreira Torres, Mathis Baden, Robert Norvill, Beltran Borja Fiz Pontiveros, Hugo Jonker, and Sjouke Mauw. 2020. Ægis: Shielding vulnerable smart contracts against attacks. In Proceedings of the 15th ACM Asia Conference on Computer and Communications Security (AsiaCCS). 584–597.Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Joel Frank, Cornelius Aschermann, and Thorsten Holz. 2020. ETHBMC: A bounded model checker for smart contracts. In 29th USENIX Security Symposium. 2757–2774.Google ScholarGoogle Scholar
  19. Shelly Grossman, Ittai Abraham, Guy Golan-Gueta, Yan Michalevsky, Noam Rinetzky, Mooly Sagiv, and Yoni Zohar. 2017. Online detection of effectively callback free objects with applications to smart contracts. Proceedings of the ACM on Programming Languages 2, POPL(2017), 1–28.Google ScholarGoogle Scholar
  20. Jiao Jiao, Shuanglong Kan, Shang-Wei Lin, David Sanan, Yang Liu, and Jun Sun. 2020. Semantic understanding of smart contracts: executable operational semantics of Solidity. In 2020 IEEE Symposium on Security and Privacy (SP). IEEE, 1695–1712.Google ScholarGoogle ScholarCross RefCross Ref
  21. Sukrit Kalra, Seep Goel, Mohan Dhawan, and Subodh Sharma. 2018. ZEUS: Analyzing safety of smart contracts.. In NDSS. 1–12.Google ScholarGoogle Scholar
  22. Katatsuki. 2016. Re: Hi! My name is Rubixi. I’m a new Ethereum Doubler. Now my new home - Rubixi.tk. https://bitcointalk.org/index.php?topic=1400536.60Google ScholarGoogle Scholar
  23. Johannes Krupp and Christian Rossow. 2018. teether: Gnawing at Ethereum to automatically exploit smart contracts. In 27th USENIX Security Symposium. 1317–1333.Google ScholarGoogle Scholar
  24. Ao Li, Jemin Andrew Choi, and Fan Long. 2020. Securing smart contract with runtime validation. In Proceedings of the 41st ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI). 438–453.Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Joshua Lind, Oded Naor, Ittay Eyal, Florian Kelbert, Emin Gün Sirer, and Peter Pietzuch. 2019. Teechain: A secure payment network with asynchronous blockchain access. In Proceedings of the 27th ACM Symposium on Operating Systems Principles (SOSP). 63–79.Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Loi Luu, Duc-Hiep Chu, Hrishi Olickel, Prateek Saxena, and Aquinas Hobor. 2016. Making smart contracts smarter. In Proceedings of the 2016 ACM SIGSAC conference on computer and communications security (CCS). 254–269.Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Sinisa Matetic, Karl Wüst, Moritz Schneider, Kari Kostiainen, Ghassan Karame, and Srdjan Capkun. 2019. BITE: Bitcoin lightweight client privacy using trusted execution. In 28th USENIX Security Symposium. 783–800.Google ScholarGoogle Scholar
  28. Brianna Montgomery. 2021. Fei Bonding Curve Bug Post Mortem. https://medium.com/fei-protocol/fei-bonding-curve-bug-post-mortem-98d2c6f271e9Google ScholarGoogle Scholar
  29. Mark Mossberg, Felipe Manzano, Eric Hennenfent, Alex Groce, Gustavo Grieco, Josselin Feist, Trent Brunson, and Artem Dinaburg. 2019. Manticore: A user-friendly symbolic execution framework for binaries and smart contracts. In 2019 34th IEEE/ACM International Conference on Automated Software Engineering (ASE). IEEE, 1186–1189.Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Tai D Nguyen, Long H Pham, Jun Sun, Yun Lin, and Quang Tran Minh. 2020. sFuzz: An efficient adaptive fuzzer for solidity smart contracts. In Proceedings of the ACM/IEEE 42nd International Conference on Software Engineering (ICSE). 778–788.Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Ivica Nikolić, Aashish Kolluri, Ilya Sergey, Prateek Saxena, and Aquinas Hobor. 2018. Finding the greedy, prodigal, and suicidal contracts at scale. In Proceedings of the 34th Annual Computer Security Applications Conference (ACSAC). 653–663.Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Michael Rodler, Wenting Li, Ghassan O Karame, and Lucas Davi. 2019. Sereum: Protecting existing smart contracts against re-entrancy attacks. In NDSS. 1–15.Google ScholarGoogle Scholar
  33. Michael Rodler, Wenting Li, Ghassan O Karame, and Lucas Davi. 2021. EVMPatch: timely and automated patching of Ethereum smart contracts. In 30th USENIX Security Symposium. 1–18.Google ScholarGoogle Scholar
  34. KoET Team. 2016. King of Ether Throne Post-Mortem Investigation. https://www.kingoftheether.com/postmortemGoogle ScholarGoogle Scholar
  35. Christof Ferreira Torres, Julian Schütte, and Radu State. 2018. Osiris: Hunting for integer bugs in ethereum smart contracts. In Proceedings of the 34th Annual Computer Security Applications Conference (ACSAC). 664–676.Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Petar Tsankov, Andrei Dan, Dana Drachsler-Cohen, Arthur Gervais, Florian Buenzli, and Martin Vechev. 2018. Securify: Practical security analysis of smart contracts. In Proceedings of the 2018 ACM SIGSAC Conference on Computer and Communications Security (CCS). 67–82.Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. u/ethererik. 2016. GovernMental’s 1100 ETH jackpot payout is stuck because it uses too much gas. https://www.reddit.com/r/ethereum/comments/4ghzhv/governmentals_1100_eth_jackpot_payout_is_stuck/Google ScholarGoogle Scholar
  38. Xiao Liang Yu, Omar Al-Bataineh, David Lo, and Abhik Roychoudhury. 2020. Smart contract repair. ACM Transactions on Software Engineering and Methodology 29, 4(2020), 1–32.Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Fan Zhang, Ethan Cecchetti, Kyle Croman, Ari Juels, and Elaine Shi. 2016. Town Crier: An Authenticated Data Feed for Smart Contracts. In Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security (CCS). 270–282.Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. Fan Zhang, Ittay Eyal, Robert Escriva, Ari Juels, and Robbert Van Renesse. 2017. REM: Resource-Efficient Mining for Blockchains. In 26th USENIX Security Symposium. 1427–1444.Google ScholarGoogle Scholar
  41. Yuyao Zhang, Siqi Ma, Juanru Li, Kailai Li, Surya Nepal, and Dawu Gu. 2020. Smartshield: Automatic smart contract protection made easy. In 2020 IEEE 27th International Conference on Software Analysis, Evolution and Reengineering (SANER). IEEE, 23–34.Google ScholarGoogle ScholarCross RefCross Ref

Index Terms

  1. SolSaviour: A Defending Framework for Deployed Defective Smart Contracts
        Index terms have been assigned to the content through auto-classification.

        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 '21: Proceedings of the 37th Annual Computer Security Applications Conference
          December 2021
          1077 pages
          ISBN:9781450385794
          DOI:10.1145/3485832

          Copyright © 2021 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: 6 December 2021

          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

        HTML Format

        View this article in HTML Format .

        View HTML Format