ContractTinker: LLM-Empowered Vulnerability Repair for Real-World Smart Contracts

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Wang, Che, Zhang, Jiashuo, Gao, Jianbo, Xia, Libin, Guan, Zhi, Chen, Zhong
Format: Preprint
Publié: 2024
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866914949509414912
author Wang, Che
Zhang, Jiashuo
Gao, Jianbo
Xia, Libin
Guan, Zhi
Chen, Zhong
author_facet Wang, Che
Zhang, Jiashuo
Gao, Jianbo
Xia, Libin
Guan, Zhi
Chen, Zhong
contents Smart contracts are susceptible to being exploited by attackers, especially when facing real-world vulnerabilities. To mitigate this risk, developers often rely on third-party audit services to identify potential vulnerabilities before project deployment. Nevertheless, repairing the identified vulnerabilities is still complex and labor-intensive, particularly for developers lacking security expertise. Moreover, existing pattern-based repair tools mostly fail to address real-world vulnerabilities due to their lack of high-level semantic understanding. To fill this gap, we propose ContractTinker, a Large Language Models (LLMs)-empowered tool for real-world vulnerability repair. The key insight is our adoption of the Chain-of-Thought approach to break down the entire generation task into sub-tasks. Additionally, to reduce hallucination, we integrate program static analysis to guide the LLM. We evaluate ContractTinker on 48 high-risk vulnerabilities. The experimental results show that among the patches generated by ContractTinker, 23 (48%) are valid patches that fix the vulnerabilities, while 10 (21%) require only minor modifications. A video of ContractTinker is available at https://youtu.be/HWFVi-YHcPE.
format Preprint
id arxiv_https___arxiv_org_abs_2409_09661
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle ContractTinker: LLM-Empowered Vulnerability Repair for Real-World Smart Contracts
Wang, Che
Zhang, Jiashuo
Gao, Jianbo
Xia, Libin
Guan, Zhi
Chen, Zhong
Software Engineering
Cryptography and Security
Smart contracts are susceptible to being exploited by attackers, especially when facing real-world vulnerabilities. To mitigate this risk, developers often rely on third-party audit services to identify potential vulnerabilities before project deployment. Nevertheless, repairing the identified vulnerabilities is still complex and labor-intensive, particularly for developers lacking security expertise. Moreover, existing pattern-based repair tools mostly fail to address real-world vulnerabilities due to their lack of high-level semantic understanding. To fill this gap, we propose ContractTinker, a Large Language Models (LLMs)-empowered tool for real-world vulnerability repair. The key insight is our adoption of the Chain-of-Thought approach to break down the entire generation task into sub-tasks. Additionally, to reduce hallucination, we integrate program static analysis to guide the LLM. We evaluate ContractTinker on 48 high-risk vulnerabilities. The experimental results show that among the patches generated by ContractTinker, 23 (48%) are valid patches that fix the vulnerabilities, while 10 (21%) require only minor modifications. A video of ContractTinker is available at https://youtu.be/HWFVi-YHcPE.
title ContractTinker: LLM-Empowered Vulnerability Repair for Real-World Smart Contracts
topic Software Engineering
Cryptography and Security
url https://arxiv.org/abs/2409.09661