arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2404.17839cs.CRcs.SE
收藏

基于对比学习的漏洞检测改进智能合约安全性

Improving Smart Contract Security with Contrastive Learning-based Vulnerability Detection

Yizhou Chen, Zeyu Sun, Zhihao Gong, Dan Hao

AI总结:

针对智能合约漏洞检测中忽略合约间相关性的问题,提出对比学习增强方法Clear,通过捕获合约间细粒度相关性并结合语义信息,在4万+合约数据集上F1分数较现有深度学习方法提升9.73%-39.99%。

摘要:

目前,智能合约漏洞(SCVs)已成为威胁区块链交易安全的主要因素。现有的最先进方法依赖深度学习来缓解这一威胁。它们将每个输入合约视为独立实体,并将其输入深度学习模型,通过拟合漏洞标签来学习漏洞模式。遗憾的是,它们忽略了合约之间的相关性,未考虑同类型合约之间的共性和不同类型合约之间的差异。因此,这些方法的性能未达到理想水平。为解决此问题,我们提出一种新颖的对比学习增强的智能合约漏洞自动识别方法,命名为Clear。具体而言,Clear采用对比学习(CL)模型捕获合约间的细粒度相关性信息,并基于合约间的关系生成相关性标签,以指导CL模型的训练过程。最后,它结合相关性和合约的语义信息来检测SCVs。通过对包含超过40K个智能合约的大规模真实数据集进行实证评估,并比较13种最先进的基线方法。我们表明Clear实现了:(1)优于所有基线方法的最佳性能;(2)比现有深度学习方法的F1分数高9.73%-39.99%。

英文摘要:

Currently, smart contract vulnerabilities (SCVs) have emerged as a major factor threatening the transaction security of blockchain. Existing state-of-the-art methods rely on deep learning to mitigate this threat. They treat each input contract as an independent entity and feed it into a deep learning model to learn vulnerability patterns by fitting vulnerability labels. It is a pity that they disregard the correlation between contracts, failing to consider the commonalities between contracts of the same type and the differences among contracts of different types. As a result, the performance of these methods falls short of the desired level. To tackle this problem, we propose a novel Contrastive Learning Enhanced Automated Recognition Approach for Smart Contract Vulnerabilities, named Clear. In particular, Clear employs a contrastive learning (CL) model to capture the fine-grained correlation information among contracts and generates correlation labels based on the relationships between contracts to guide the training process of the CL model. Finally, it combines the correlation and the semantic information of the contract to detect SCVs. Through an empirical evaluation of a large-scale real-world dataset of over 40K smart contracts and compare 13 state-of-the-art baseline methods. We show that Clear achieves (1) optimal performance over all baseline methods; (2) 9.73%-39.99% higher F1-score than existing deep learning methods.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑