Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1145/3377811.3380424acmconferencesArticle/Chapter ViewAbstractPublication PagesicseConference Proceedingsconference-collections
research-article

Gap between theory and practice: an empirical study of security patches in solidity

Published: 01 October 2020 Publication History

Abstract

Ethereum, one of the most popular blockchain platforms, provides financial transactions like payments and auctions through smart contracts. Due to the immense interest in smart contracts in academia, the research community of smart contract security has made a significant improvement recently. Researchers have reported various security vulnerabilities in smart contracts, and developed static analysis tools and verification frameworks to detect them. However, it is unclear whether such great efforts from academia has indeed enhanced the security of smart contracts in reality.
To understand the security level of smart contracts in the wild, we empirically studied 55,046 real-world Ethereum smart contracts written in Solidity, the most popular programming language used by Ethereum smart contract developers. We first examined how many well-known vulnerabilities the Solidity compiler has patched, and how frequently the Solidity team publishes compiler releases. Unfortunately, we observed that many known vulnerabilities are not yet patched, and some patches are not even sufficient to avoid their target vulnerabilities. Subsequently, we investigated whether smart contract developers use the most recent compiler with vulnerabilities patched. We reported that developers of more than 98% of real-world Solidity contracts still use older compilers without vulnerability patches, and more than 25% of the contracts are potentially vulnerable due to the missing security patches. To understand actual impacts of the missing patches, we manually investigated potentially vulnerable contracts that are detected by our static analyzer and identified common mistakes by Solidity developers, which may cause serious security issues such as financial loss. We detected hundreds of vulnerable contracts and about one fourth of the vulnerable contracts are used by thousands of people. We recommend the Solidity team to make patches that resolve known vulnerabilities correctly, and developers to use the latest Solidity compiler to avoid missing security patches.

References

[1]
2017. Parity Wallet Hacking. Retrieved August 23, 2019 from https://www.theregister.co.uk/2017/11/10/parity_280m_ethereum_wallet_lockdown_hack
[2]
2018. The DAO. Retrieved August 23, 2019 from https://en.wikipedia.org/wiki/The_DAO_(organization)
[3]
2018. Ethereum: A Secure Decentralised Generalised Transaction Ledger. Retrieved August 23, 2019 from https://ethereum.github.io/yellowpaper/paper.pdf
[4]
2018. List of DApp. Retrieved August 23, 2019 from https://dappradar.com/
[5]
2018. A Next-Generation Smart Contract and Decentralized Application Platform. Retrieved August 23, 2019 from https://github.com/ethereum/wiki/wiki/White-Paper
[6]
Nicola Atzei, Massimo Bartoletti, and Tiziana Cimoli. 2017. A Survey of Attacks on Ethereum Smart Contracts (SoK). In In Proceedings of the 6th Principles of Security and Trust. Springer, 164--186.
[7]
Kim Barrett, Bob Cassels, Paul Haahr, David A Moon, Keith Playford, and P Tucker Withington. 1996. A Monotonic Superclass Linearization for Dylan. ACM SIGPLAN Notices 31, 10 (1996), 69--82.
[8]
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 Zanellai-Béguelin. 2016. Formal Verification of Smart Contracts: Short Paper. In Proceedings of the 2016 ACM Workshop on Programming Languages and Analysis for Security. ACM, 91--96.
[9]
ConsenSys. 2016. Token.sol. Retrieved August 07, 2019 from https://github.com/ConsenSys/Token-Factory/blob/master/contracts/Token.sol
[10]
Kevin Delmolino, Mitchell Arnett, Ahmed Kosba, Andrew Miller, and Elaine Shi. 2016. Step by Step Towards Creating A Safe Smart Contract: Lessons and Insights From a Cryptocurrency Lab. In In Proceedings of the 2016 Financial Cryptography and Data Security. Springer, 79--94.
[11]
Ethereum EIPs. 2015. Renaming SUICIDE Opcode. Retrieved August 04, 2019 from https://github.com/ethereum/EIPs/blob/master/EIPS/eip-6.md
[12]
Ethereum EIPs. 2019. EIP-1470: Smart Contract Weakness Classification (SWC). Retrieved April 24, 2019 from https://github.com/ethereum/EIPs/issues/1469
[13]
Ethereum. 2019. Release Notes of Solidity Compiler. Retrieved April 24, 2019 from https://github.com/ethereum/solidity/releases
[14]
Ethereum. 2019. Remix. Retrieved July 29, 2019 from https://github.com/ethereum/remix
[15]
Ethereum. 2019. TokenERC20 Example. Retrieved August 16, 2019 from https://github.com/ethereum/ethereum-org/blob/master/solidity/token-erc20.sol
[16]
Etherscan. 2019. Etherscan. Retrieved July 3, 2019 from https://insights.stackoverflow.com/survey/2019
[17]
Christof Ferreira Torres, Julian Schütte, and Radu State. 2018. OSIRIS: Hunting for Integer Bugs in Ethereum Smart Contracts. In In Proceedings of 34th Annual Computer Security Applications Conference (ACSAC'18), San Juan, Puerto Rico, USA, December 3--7, 2018.
[18]
Ilya Grishchenko, Matteo Maffei, and Clara Schneidewind. 2018. A Semantic Framework for the Security Analysis of Ethereum Smart Contracts. In In Proceedings of the 7th Principles of Security and Trust. Springer, 243--269.
[19]
NCC Group. 2019. The Decentralized Application Security Project. Retrieved April 24, 2019 from https://dasp.co
[20]
Everett Hildenbrandt, Manasvi Saxena, Xiaoran Zhu, Nishant Rodrigues, Philip Daian, Dwight Guth, and Grigore Rosu. 2017. Kevm: A Complete Semantics of the Ethereum Virtual Machine. Technical Report.
[21]
Yoichi Hirai. 2017. Defining the Ethereum Virtual Machine for Interactive Theorem Provers. In In Proceedings of the 2017 Financial Cryptography and Data Security. Springer International Publishing, 520--535.
[22]
Yajin Zhou Xuxian Jiang and Zhou Xuxian. 2013. Detecting Passive Content Leaks and Pollution in Android Applications. In In Proceedings of the 20th Network and Distributed System Security Symposium (NDSS).
[23]
Sukrit Kalra, Seep Goel, Mohan Dhawan, and Subodh Sharma. 2018. ZEUS: Analyzing Safety of Smart Contracts. In Proceedings of the 25th Network and Distributed System Security Symposium (NDSS).
[24]
Aashish Kolluri, Ivica Nikolic, Ilya Sergey, Aquinas Hobor, and Prateek Saxena. 2019. Exploiting the Laws of Order in Smart Contracts. In Proceedings of the 28th ACM SIGSOFT International Symposium on Software Testing and Analysis. ACM, 363--373.
[25]
Johannes Krupp and Christian Rossow. 2018. teEther: Gnawing at Ethereum to Automatically Exploit Smart Contracts. In In Proceedings of the 27th USENIX Security Symposium (USENIX Security 18). Baltimore, MD: USENIX Association.
[26]
V. I. Levenshtein. 1966. Binary Codes Capable of Correcting Deletions, Insertions and Reversals. Soviet Physics Doklady 10 (Feb. 1966), 707.
[27]
Loi Luu, Duc-Hiep Chu, Hrishi Olickel, Prateek Saxena, and Aquinas Hobor. 2016. Making Smart Contracts Smarter. In In Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security. ACM, 254--269.
[28]
Anastasia Mavridou and Aron Laszka. 2018. Designing Secure Ethereum Smart Contracts: A Finite State Machine Based Approach. In In Proceedings of the 22nd Financial Cryptography and Data Security. Springer International Publishing.
[29]
Ivica Nikolić, Aashish Kolluri, Ilya Sergey, Prateek Saxena, and Aquinas Hobor. 2018. Finding the Greedy, Prodigal, and Suicidal Contracts at Scale. In In Proceedings of the 34th Annual Computer Security Applications Conference. ACM, 653--663.
[30]
OpenZeppelin. 2019. OpenZeppelin. Retrieved August 16, 2019 from https://openzeppelin.com/
[31]
OpenZeppelin. 2019. SimpleToken Example. Retrieved August 16, 2019 from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/eda63c75c45e96e10d3fc188f717c8e7be64d420/contracts/examples/SimpleToken.sol
[32]
OWASP. 2019. Testing for Race Conditions. Retrieved August 07, 2019 from https://www.owasp.org/index.php/Testing_for_Race_Conditions_(OWASP-AT-010)
[33]
Grigore Roşu and Traian Florin Şerbănuţă. 2010. An Overview of the K Semantic Framework. Journal of Logic and Algebraic Programming 79, 6 (2010), 397--434.
[34]
Ilya Sergey and Aquinas Hobor. 2017. A Concurrent Perspective on Smart Contracts. In In Proceedings of the 21th Financial Cryptography and Data Security. Springer, 478--493.
[35]
Solidity. 2016. Alias A New Name to the SHA3 Opcode. Retrieved August 04, 2019 from https://github.com/ethereum/solidity/issues/363
[36]
Solidity. 2017. Move blockhash from block.blockhash to Global Level. Retrieved August 04, 2019 from https://github.com/ethereum/solidity/issues/2970
[37]
Solidity. 2017. Move msg.gas to Global Level As gasleft(). Retrieved August 04, 2019 from https://github.com/ethereum/solidity/issues/2971
[38]
Solidity. 2018. Low Level Operations: send Function. Retrieved August 07, 2019 from https://solidity.readthedocs.io/en/v0.5.7/control-structures.html?highlight=send#error-handling-assert-require-revert-and-exceptions
[39]
Solidity. 2018. Solidity Documentation: Self-destruct. Retrieved January 06, 2020 from https://solidity.readthedocs.io/en/v0.4.25/introduction-to-smart-contracts.html?highlight=destruct
[40]
Solidity. 2018. Solidity Multiple Inheritance Resolution. Retrieved August 03, 2019 from https://github.com/ethereum/solidity/issues/3856
[41]
Solidity. 2018. Solidity Official Documentation: Break Changes. Retrieved August 22, 2019 from https://solidity.readthedocs.io/en/v0.5.7/050-breaking-changes.html#
[42]
Solidity. 2018. Solidity Official Documentation: C3 Linearization. Retrieved August 17, 2019 from https://solidity.readthedocs.io/en/v0.5.0/contracts.html?highlight=c3%20linearization#inheritance
[43]
Solidity. 2018. Type Conversion. Retrieved August 07, 2019 from https://solidity.readthedocs.io/en/v0.5.7/types.html?highlight=conversion#conversions-between-elementary-types
[44]
Solidity. 2018. Type Conversion Work Around. Retrieved August 07, 2019 from https://solidity.readthedocs.io/en/v0.5.7/050-breaking-changes.html
[45]
Solidity. 2019. Ethereum Smart Contract Best Practices. Retrieved April 24, 2019 from https://consensys.github.io/smart-contract-best-practices/known_attacks/
[46]
Solidity. 2019. Official Solidity Documentation. Retrieved April 24, 2019 from https://solidity.readthedocs.io/en/v0.5.7/
[47]
Solidity. 2019. Shadowing of Inherited State Variables Should Be An Error. Retrieved July 07, 2019 from https://github.com/ethereum/solidity/issues/2563
[48]
Solidity. 2019. Smart Contract Weakness Classification and Test Cases. Retrieved April 24, 2019 from https://smartcontractsecurity.github.io/SWC-registry/
[49]
Ethereum StackExchange. 2016. Difference Between CALL, CALLCODE and DELEGATECALL. Retrieved August 22, 2019 from https://ethereum.stackexchange.com/questions/3667/difference-between-call-callcode-and-delegatecall
[50]
Ethereum StackExchange. 2017. Why Do 'throw' and 'revert()' Create Different Bytecodes? Retrieved August 22, 2019 from https://ethereum.stackexchange.com/questions/20978/why-do-throw-and-revert-create-different-bytecodes
[51]
Petar Tsankov, Andrei Dan, Dana Drachsler-Cohen, Arthur Gervais, Florian Buenzli, and Martin Vechev. 2018. Securify: Practical security analysis of smart contracts. In In Proceedings of the 25th ACM SIGSAC Conference on Computer and Communications Security. ACM, 67--82.
[52]
Robert A Wagner and Michael J Fischer. 1974. The String-to-String Correction Problem. Journal of the ACM (JACM) 21, 1 (1974), 168--173.
[53]
Zeppelin-Solidity. 2017. Ownable.sol. Retrieved August 07, 2019 from https://github.com/aragon/zeppelin-solidity/blob/master/contracts/ownership/Ownable.sol
[54]
Qi Zhou. 2018. QuarkChain: Issues Due to the Inheritance Order. Personal communication.

Cited By

View all
  • (2024)Empirical Study of Impact of Solidity Compiler Updates on Vulnerabilities in Ethereum Smart ContractsDistributed Ledger Technologies: Research and Practice10.1145/3688812Online publication date: 22-Aug-2024
  • (2024)Broken Agreement: The Evolution of Solidity Error HandlingProceedings of the 18th ACM/IEEE International Symposium on Empirical Software Engineering and Measurement10.1145/3674805.3686686(257-268)Online publication date: 24-Oct-2024
  • (2024)Towards Understanding the Bugs in Solidity CompilerProceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis10.1145/3650212.3680362(1312-1324)Online publication date: 11-Sep-2024
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
ICSE '20: Proceedings of the ACM/IEEE 42nd International Conference on Software Engineering
June 2020
1640 pages
ISBN:9781450371216
DOI:10.1145/3377811
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]

Sponsors

In-Cooperation

  • KIISE: Korean Institute of Information Scientists and Engineers
  • IEEE CS

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 October 2020

Permissions

Request permissions for this article.

Check for updates

Badges

Author Tags

  1. empirical study
  2. security patches
  3. smart contracts
  4. solidity

Qualifiers

  • Research-article

Conference

ICSE '20
Sponsor:

Acceptance Rates

Overall Acceptance Rate 276 of 1,856 submissions, 15%

Upcoming Conference

ICSE 2025

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)124
  • Downloads (Last 6 weeks)13
Reflects downloads up to 17 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Empirical Study of Impact of Solidity Compiler Updates on Vulnerabilities in Ethereum Smart ContractsDistributed Ledger Technologies: Research and Practice10.1145/3688812Online publication date: 22-Aug-2024
  • (2024)Broken Agreement: The Evolution of Solidity Error HandlingProceedings of the 18th ACM/IEEE International Symposium on Empirical Software Engineering and Measurement10.1145/3674805.3686686(257-268)Online publication date: 24-Oct-2024
  • (2024)Towards Understanding the Bugs in Solidity CompilerProceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis10.1145/3650212.3680362(1312-1324)Online publication date: 11-Sep-2024
  • (2024)Towards Trusted Smart Contracts: A Comprehensive Test Suite For Vulnerability DetectionEmpirical Software Engineering10.1007/s10664-024-10509-w29:5Online publication date: 25-Jul-2024
  • (2024)SolSecure: A Security Analyzer for Integer Bugs in Smart ContractsBlockchain and Web3.0 Technology Innovation and Application10.1007/978-981-97-9412-6_9(97-105)Online publication date: 3-Nov-2024
  • (2023)A systematic literature review of undiscovered vulnerabilities and tools in smart contract technologyJournal of Intelligent Systems10.1515/jisys-2023-003832:1Online publication date: 4-Sep-2023
  • (2023)EtherDiffer: Differential Testing on RPC Services of Ethereum NodesProceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering10.1145/3611643.3616251(1333-1344)Online publication date: 30-Nov-2023
  • (2023)A Comparative Analysis of Ethereum Solidity and Sui Move Smart Contract Languages: Advantages and Trade-Offs2023 6th World Symposium on Communication Engineering (WSCE)10.1109/WSCE59557.2023.10365887(34-38)Online publication date: 27-Sep-2023
  • (2023)SoK: Decentralized Finance (DeFi) Attacks2023 IEEE Symposium on Security and Privacy (SP)10.1109/SP46215.2023.10179435(2444-2461)Online publication date: May-2023
  • (2023)An Empirical Study of Impact of Solidity Compiler Updates on Vulnerabilities2023 IEEE International Conference on Pervasive Computing and Communications Workshops and other Affiliated Events (PerCom Workshops)10.1109/PerComWorkshops56833.2023.10150389(92-97)Online publication date: 13-Mar-2023
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media