Security issues are becoming increasingly significant with the rapid evolution of Non-fungible Tokens (NFTs). As NFTs are traded as digital assets, they have emerged as prime targets for cyber attackers. In the development of NFT smart contracts, there may exist undiscovered defects that could lead to substantial financial losses if exploited. To tackle this issue, this paper presents a framework called NATLM(NFT Assistant LLM), designed to detect potential defects in NFT smart contracts. The framework effectively identifies four common types of vulnerabilities in NFT smart contracts: ERC-721 Reentrancy, Public Burn, Risky Mutable Proxy, and Unlimited Minting. Relying exclusively on large language models (LLMs) for defect detection can lead to a high false-positive rate. To enhance detection performance, NATLM integrates static analysis with LLMs, specifically Gemini Pro 1.5. Initially, NATLM employs static analysis to extract structural, syntactic, and execution flow information from the code, represented through Abstract Syntax Trees (AST) and Control Flow Graphs (CFG). These extracted features are then combined with vectors of known defect examples to create a matrix for input into the knowledge base. Subsequently, the feature vectors and code vectors of the analyzed contract are compared with the contents of the knowledge base. Finally, the LLM performs deep semantic analysis to enhance detection capabilities, providing a more comprehensive and accurate identification of potential security issues. Experimental results indicate that NATLM analyzed 8,672 collected NFT smart contracts, achieving an overall precision of 87.72%, a recall of 89.58%, and an F1 score of 88.94%. The results outperform other baseline experiments, successfully identifying four common types of defects.


翻译:随着非同质化代币(NFT)的快速发展,其安全问题日益凸显。NFT作为数字资产进行交易,已成为网络攻击者的主要目标。在NFT智能合约的开发过程中,可能存在未被发现的缺陷,一旦被利用可能导致重大经济损失。为解决这一问题,本文提出了一个名为NATLM(NFT Assistant LLM)的框架,旨在检测NFT智能合约中的潜在缺陷。该框架能有效识别NFT智能合约中四种常见漏洞类型:ERC-721重入、公开销毁、风险可变代理和无限铸造。单纯依赖大语言模型(LLM)进行缺陷检测会导致较高的误报率。为提升检测性能,NATLM将静态分析与LLM(具体采用Gemini Pro 1.5)相结合。首先,NATLM运用静态分析从代码中提取结构、语法和执行流信息,并通过抽象语法树(AST)和控制流图(CFG)进行表征。随后,将这些提取的特征与已知缺陷样本的向量组合,构建输入知识库的矩阵。接着,将待分析合约的特征向量和代码向量与知识库内容进行比对。最后,LLM执行深度语义分析以增强检测能力,从而更全面、更准确地识别潜在安全问题。实验结果表明,NATLM分析了8,672个收集的NFT智能合约,整体精确率达到87.72%,召回率为89.58%,F1分数为88.94%。该结果优于其他基线实验,成功识别了四种常见缺陷类型。

0
下载
关闭预览

相关内容

LLMS4ALL:大语言模型在各学科科研与应用中的综述
专知会员服务
36+阅读 · 2025年10月4日
探索大型语言模型在网络安全中的作用:一项系统综述
专知会员服务
20+阅读 · 2025年4月27日
揭示生成式人工智能 / 大型语言模型(LLMs)的军事潜力
专知会员服务
31+阅读 · 2024年9月26日
大型语言模型网络安全综述
专知会员服务
67+阅读 · 2024年5月12日
智能合约的形式化验证方法研究综述
专知
16+阅读 · 2021年5月8日
深度学习框架大PK:TNN决战MNN,ncnn依旧经典
新智元
10+阅读 · 2020年7月3日
NetworkMiner - 网络取证分析工具
黑白之道
16+阅读 · 2018年6月29日
放弃 RNN/LSTM 吧,因为真的不好用!望周知~
人工智能头条
19+阅读 · 2018年4月24日
国家自然科学基金
4+阅读 · 2017年12月31日
国家自然科学基金
6+阅读 · 2017年12月31日
国家自然科学基金
6+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
19+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
国家自然科学基金
18+阅读 · 2014年12月31日
VIP会员
相关基金
国家自然科学基金
4+阅读 · 2017年12月31日
国家自然科学基金
6+阅读 · 2017年12月31日
国家自然科学基金
6+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
19+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
国家自然科学基金
18+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员