PrAIoritize: Automated Early Prediction and Prioritization of Vulnerabilities in Smart Contracts
Abstract: Context:Smart contracts are prone to numerous security threats due to undisclosed vulnerabilities and code weaknesses. In Ethereum smart contracts, the challenges of timely addressing these code weaknesses highlight the critical need for automated early prediction and prioritization during the code review process. Efficient prioritization is crucial for smart contract security. Objective:Toward this end, our research aims to provide an automated approach, PrAIoritize, for prioritizing and predicting critical code weaknesses in Ethereum smart contracts during the code review process. Method: To do so, we collected smart contract code reviews sourced from Open Source Software (OSS) on GitHub and the Common Vulnerabilities and Exposures (CVE) database. Subsequently, we developed PrAIoritize, an innovative automated prioritization approach. PrAIoritize integrates advanced LLMs with sophisticated NLP techniques. PrAIoritize automates code review labeling by employing a domain-specific lexicon of smart contract weaknesses and their impacts. Following this, feature engineering is conducted for code reviews, and a pre-trained DistilBERT model is utilized for priority classification. Finally, the model is trained and evaluated using code reviews of smart contracts. Results: Our evaluation demonstrates significant improvement over state-of-the-art baselines and commonly used pre-trained models (e.g. T5) for similar classification tasks, with 4.82\%-27.94\% increase in F-measure, precision, and recall. Conclusion: By leveraging PrAIoritize, practitioners can efficiently prioritize smart contract code weaknesses, addressing critical code weaknesses promptly and reducing the time and effort required for manual triage.
- Making smart contracts smarter, in: Proceedings of the 2016 ACM SIGSAC conference on computer and communications security, 2016, pp. 254–269.
- Maintenance-related concerns for post-deployed ethereum smart contract development: issues, techniques, and future challenges, Empirical Software Engineering 26 (2021) 117.
- G. Wood, et al., Ethereum: A secure decentralised generalised transaction ledger, Ethereum project yellow paper 151 (2014) 1–32.
- Understanding the motivations, challenges and needs of blockchain software developers: A survey, Empirical Software Engineering 24 (2019) 2636–2673.
- Understanding a revolutionary and flawed grand experiment in blockchain: the dao attack, Journal of Cases on Information Technology (JCIT) 21 (2019) 19–32.
- Smart contract and defi security tools: Do they meet the needs of practitioners?, in: Proceedings of the 46th IEEE/ACM International Conference on Software Engineering, 2024, pp. 1–13.
- Smart contract templates: foundations, design landscape and research directions, arXiv preprint arXiv:1608.00771 (2016).
- Large language model-powered smart contract vulnerability detection: New perspectives, arXiv preprint arXiv:2310.01152 (2023).
- Automatic smart contract comment generation via large language models and in-context learning, Information and Software Technology 168 (2024) 107405.
- Distilbert, a distilled version of bert: smaller, faster, cheaper and lighter, arXiv preprint arXiv:1910.01108 (2019).
- Work practices and challenges in pull-based development: The contributor’s perspective, in: Proceedings of the 38th International Conference on Software Engineering, 2016, pp. 285–296.
- Early prediction of merged code changes to prioritize reviewing tasks, Empirical Software Engineering 23 (2018) 3346–3393.
- Drone: Predicting priority of reported bugs by multi-factor analysis, in: 2013 IEEE International Conference on Software Maintenance, IEEE, 2013, pp. 200–209.
- D. Perez, B. Livshits, Smart contract vulnerabilities: Does anyone care?, arXiv preprint arXiv:1902.06710 (2019) 1–15.
- A survey of attacks on ethereum smart contracts (sok), in: Principles of Security and Trust: 6th International Conference, POST 2017, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2017, Uppsala, Sweden, April 22-29, 2017, Proceedings 6, Springer, 2017, pp. 164–186.
- An empirical study of market inefficiencies in uniswap and sushiswap, arXiv preprint arXiv:2203.07774 (2022).
- A. Bacchelli, C. Bird, Expectations, outcomes, and challenges of modern code review, in: 2013 35th International Conference on Software Engineering (ICSE), IEEE, 2013, pp. 712–721.
- L. Bilge, T. Dumitraş, Before we knew it: an empirical study of zero-day attacks in the real world, in: Proceedings of the 2012 ACM conference on Computer and communications security, 2012, pp. 833–844.
- A survey on deep learning for software engineering, ACM Computing Surveys (CSUR) 54 (2022) 1–73.
- Deep learning for just-in-time defect prediction, in: 2015 IEEE International Conference on Software Quality, Reliability and Security, IEEE, 2015, pp. 17–26.
- Bert: Pre-training of deep bidirectional transformers for language understanding, arXiv preprint arXiv:1810.04805 (2018).
- A. Ciborowska, K. Damevski, Fast changeset-based bug localization with bert, in: Proceedings of the 44th International Conference on Software Engineering, 2022, pp. 946–957.
- Attention is all you need, Advances in neural information processing systems 30 (2017).
- Exploring the limits of transfer learning with a unified text-to-text transformer, Journal of machine learning research 21 (2020) 1–67.
- G. Liu, J. Guo, Bidirectional lstm with attention mechanism and convolutional layer for text classification, Neurocomputing 337 (2019) 325–338.
- A critical review of recurrent neural networks for sequence learning, arXiv preprint arXiv:1506.00019 (2015).
- A fly in the ointment: an empirical study on the characteristics of ethereum smart contract code weaknesses, Empirical Software Engineering 29 (2024) 13.
- Automesc: Automatic framework for mining and classifying ethereum smart contract vulnerabilities and their fixes, in: 2023 49th Euromicro Conference on Software Engineering and Advanced Applications (SEAA), IEEE, 2023, pp. 410–417.
- A systematic mapping study of software development with github, Ieee access 5 (2017) 7173–7192.
- Empirical review of automated analysis tools on 47,587 ethereum smart contracts, in: Proceedings of the ACM/IEEE 42nd International conference on software engineering, 2020, pp. 530–541.
- Application of high-dimensional feature selection: evaluation for genomic prediction in man, Scientific reports 5 (2015) 1–12.
- E. Loper, S. Bird, Nltk: The natural language toolkit, arXiv preprint cs/0205028 (2002).
- B. Liu, et al., Sentiment analysis and subjectivity., Handbook of natural language processing 2 (2010) 627–666.
- S.-M. Kim, E. Hovy, Determining the sentiment of opinions, in: COLING 2004: Proceedings of the 20th International Conference on Computational Linguistics, 2004, pp. 1367–1373.
- Automatically annotating sentences for task-specific bug report summarization, in: 2021 36th IEEE/ACM International Conference on Automated Software Engineering (ASE), IEEE, 2021, pp. 1177–1179.
- F. Debole, F. Sebastiani, Supervised term weighting for automated text categorization, in: Proceedings of the 2003 ACM symposium on Applied computing, 2003, pp. 784–788.
- G. Salton, C. Buckley, Term-weighting approaches in automatic text retrieval, Information processing & management 24 (1988) 513–523.
- J. Bross, H. Ehrig, Automatic construction of domain and aspect specific sentiment lexicons for customer review mining, in: Proceedings of the 22nd ACM international conference on Information & Knowledge Management, 2013, pp. 1077–1086.
- K. Bloom, S. Argamon, Unsupervised extraction of appraisal expressions, in: Advances in Artificial Intelligence: 23rd Canadian Conference on Artificial Intelligence, Canadian AI 2010, Ottawa, Canada, May 31–June 2, 2010. Proceedings 23, Springer, 2010, pp. 290–294.
- C. D. Manning, An introduction to information retrieval, Cambridge university press (2009).
- Bag of tricks for efficient text classification, arXiv preprint arXiv:1607.01759 (2016).
- Feature hashing for large scale multitask learning, in: Proceedings of the 26th annual international conference on machine learning, 2009, pp. 1113–1120.
- K. Ganchev, M. Dredze, Small statistical models by random feature mixing, in: Proceedings of the ACL-08: HLT Workshop on Mobile Language Processing, 2008, pp. 19–20.
- Efficient estimation of word representations in vector space, arXiv preprint arXiv:1301.3781 (2013).
- Glove: Global vectors for word representation, in: Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP), 2014, pp. 1532–1543.
- Tensorflow: a system for large-scale machine learning., in: Osdi, volume 16, Savannah, GA, USA, 2016, pp. 265–283.
- Automatic classification of bug reports based on multiple text information and reports’ intention, in: Theoretical Aspects of Software Engineering: 16th International Symposium, TASE 2022, Cluj-Napoca, Romania, July 8–10, 2022, Proceedings, Springer, 2022, pp. 131–147.
- Understanding interobserver agreement: the kappa statistic, Fam med 37 (2005) 360–363.
- Code reviewing in the trenches: Understanding challenges, Best Practices and Tool Needs (2016).
- Early prediction for merged vs abandoned code changes in modern code reviews, Information and Software Technology 142 (2022) 106756.
- Improving the pull requests review process using learning-to-rank algorithms, Empirical Software Engineering 24 (2019) 2140–2170.
- Effective prediction of bug-fixing priority via weighted graph convolutional networks, IEEE Transactions on Reliability 70 (2021) 563–574.
- A tale of two tasks: Automated issue priority prediction with deep multi-task learning, in: Proceedings of the 16th ACM/IEEE International Symposium on Empirical Software Engineering and Measurement, 2022, pp. 1–11.
- Automated prediction of bug report priority using multi-factor analysis, Empirical Software Engineering 20 (2015) 1354–1383.
- H. Valdivia Garcia, E. Shihab, Characterizing and predicting blocking bugs in open source projects, in: Proceedings of the 11th working conference on mining software repositories, 2014, pp. 72–81.
- An exploratory study of bug prioritization and severity prediction based on source code features., in: SEKE, 2022, pp. 178–183.
- An analysis of software bug reports using machine learning techniques, SN Computer Science 1 (2020) 1–11.
- Bug report priority prediction using developer-oriented socio-technical features, in: Proceedings of the 13th Asia-Pacific Symposium on Internetware, 2022, pp. 202–211.
- A framework and dataset for bugs in ethereum smart contracts, in: 2020 IEEE International Conference on Software Maintenance and Evolution (ICSME), IEEE, 2020, pp. 139–150.
- Defining smart contract defects on ethereum, IEEE Transactions on Software Engineering 48 (2020) 327–345.
Paper Prompts
Sign up for free to create and run prompts on this paper using GPT-5.
Top Community Prompts
Collections
Sign up for free to add this paper to one or more collections.