Smart contracts have emerged as key components within decentralized environments, enabling the automation of transactions through self-executing programs. While these innovations offer significant advantages, they also present potential drawbacks if the smart contract code is not carefully designed and implemented. This paper investigates the capability of large language models (LLMs) to detect OWASP-inspired vulnerabilities in smart contracts beyond the Ethereum Virtual Machine (EVM) ecosystem, focusing specifically on Solana and Algorand. Given the lack of labeled datasets for non-EVM platforms, we design a synthetic dataset of annotated smart contract snippets in Rust (for Solana) and PyTeal (for Algorand), structured around a vulnerability taxonomy derived from OWASP. We evaluate LLMs under three configurations: prompt engineering, fine-tuning, and a hybrid of both, comparing their performance on different vulnerability categories. Experimental results show that prompt engineering achieves general robustness, while fine-tuning improves precision and recall on less semantically rich languages such as TEAL. Additionally, we analyze how the architectural differences of Solana and Algorand influence the manifestation and detectability of vulnerabilities, offering platform-specific mappings that highlight limitations in existing security tooling. Our findings suggest that LLM-based approaches are viable for static vulnerability detection in smart contracts, provided domain-specific data and categorization are integrated into training pipelines.


翻译:智能合约已成为去中心化环境中的关键组成部分,通过自执行程序实现交易自动化。尽管这类创新具有显著优势,但若智能合约代码未经精心设计与实现,也可能带来潜在风险。本文研究了大型语言模型在以太坊虚拟机生态系统之外的智能合约中检测OWASP启发式漏洞的能力,重点关注Solana和Algorand平台。针对非EVM平台缺乏标注数据集的问题,我们构建了一个基于Rust(用于Solana)和PyTeal(用于Algorand)的标注智能合约代码片段合成数据集,其结构依据OWASP衍生的漏洞分类体系。我们在三种配置下评估LLM性能:提示工程、微调及二者混合策略,并比较它们在不同漏洞类别上的表现。实验结果表明,提示工程具有普遍鲁棒性,而微调能提升在语义丰富度较低语言(如TEAL)上的精确率与召回率。此外,我们分析了Solana和Algorand的架构差异如何影响漏洞的表现形式与可检测性,提供了凸显现有安全工具局限性的平台特异性映射方案。研究发现表明,只要将领域特定数据与分类体系整合至训练流程,基于LLM的方法在智能合约静态漏洞检测中具有可行性。

0
下载
关闭预览

相关内容

144页ppt《扩散模型》,Google DeepMind Sander Dieleman
专知会员服务
46+阅读 · 11月21日
论文浅尝 | Know-Evolve: Deep Temporal Reasoning for Dynamic KG
开放知识图谱
36+阅读 · 2018年3月30日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
相关基金
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员