DETECÇÃO DE VULNERABILIDADES EM CONTRATOS INTELIGENTES: UM ESTUDO COM FERRAMENTAS AUTOMATIZADAS

Carregando...
Imagem de Miniatura

Título da Revista

ISSN da Revista

Título de Volume

Editor

CENTRO FEDERAL DE EDUCAÇÃO TECNOLÓGICA CELSO SUCKOW DA FONSECA

Resumo

Blockchain is a technology with applications across multiple domains, including finance, electronic voting, and the Internet of Things. In this context, transactions are frequently mediated by smart contracts — self-executing programs written primarily in Solidity. Because they handle significant cryptocurrency values, these contracts are frequent targets of attacks, making automated vulnerability detection a relevant technical challenge. The objective of this work is to analyze, through two experiments, the performance of traditional static analysis tools, Mythril and Slither, and Large Language Models (LLMs), Gemini 2.0 Flash and GPT-4, in the detection of vulnerabilities in smart contracts. In the first experiment, the evolution of the static analysis tools is evaluated on the contracts of the SmartBugs Curated dataset, according to the DASP taxonomy, comparing the results with classifications previously validated manually. In the second, the performance of Gemini 2.0 Flash is evaluated on the same detection task, comparing it to the results reported for GPT-4 in the literature. The results indicate advancements in the latest versions of the static analysis tools: Mythril reduced false positives in Arithmetic (F1-score from 0.26 to 0.65), while Slither eliminated false positives in Access Control and achieved full coverage in Reentrancy F1-score of 0.67), the best combination observed, with regression in Front Running and Unchecked Low-Level Calls. In the evaluation of LLMs, Gemini 2.0 Flash showed statistically equivalent performance to GPT-4 in most categories, with a significant advantage for GPT-4 in four of them and a specific advantage for Gemini in Access Control. The manual audit of 139 reports per model revealed a common error pattern: reliance on syntactic cues rather than semantic analysis of business logic. Together, the results reinforce that combining multiple approaches, coupled with human validation, is the most promising path to improving the reliability of smart contracts.
A blockchain é uma tecnologia com aplicações em diversas áreas, como finanças, votação eletrônica e Internet das Coisas. Nesse contexto, as transações são frequentemente mediadas por contratos inteligentes, programas autoexecutáveis escritos predominantemente em Solidity. Por manipularem valores expressivos em criptomoedas, esses contratos são alvos frequentes de ataques, tornando a detecção automatizada de vulnerabilidades um desafio técnico relevante. O objetivo deste trabalho é analisar, por meio de dois experimentos, o desempenho de ferramentas de análise estática tradicionais, Mythril e Slither, e de Grandes Modelos de Linguagem (LLMs), Gemini 2.0 Flash e GPT-4, na detecção de vulnerabilidades em contratos inteligentes. No primeiro, avalia-se a evolução das ferramentas de análise estática sobre os contratos do conjunto de dados SmartBugs Curated, segundo a taxonomia DASP, confrontando os resultados com classificações previamente validadas manualmente. No segundo, avalia-se o desempenho do Gemini 2.0 Flash na mesma tarefa de detecção, comparando-o aos resultados reportados para o GPT-4 na literatura. Os resultados indicam avanços nas versões mais recentes das ferramentas de análise estática: o Mythril reduziu falsos positivos em Arithmetic (F1-score de 0,26 para 0,65), enquanto o Slither eliminou falsos positivos em Access Control e atingiu cobertura total em Reentrancy (F1-score de 0,67), a melhor combinação observada, com regressão em Front Running e Unchecked Low-Level Calls. Na avaliação dos LLMs, o Gemini 2.0 Flash apresentou desempenho estatisticamente equivalente ao GPT-4 na maioria das categorias, com vantagem significativa do GPT-4 em quatro delas e vantagem pontual do Gemini em Access Control. A auditoria manual de 139 relatórios por modelo revelou um padrão de erro comum: a dependência de indícios sintáticos em detrimento da análise semântica da lógica de negócio. Em conjunto, os resultados reforçam que a combinação de múltiplas abordagens, aliada à validação humana, é o caminho mais promissor para aumentar a confiabilidade dos contratos inteligentes.

Descrição

Palavras-chave

Citação

Avaliação

Revisão

Suplementado Por

Referenciado Por