A Human-in-the-Loop Framework for Detecting Logical Vulnerabilities in Smart Contracts
This paper proposes a Human-in-the-Loop framework that combines automated analysis with targeted human review to detect logical vulnerabilities in smart contracts, demonstrating significant improvements in precision and F1-score while reducing false positives on the SmartBugs Curated dataset.
Original paper licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the author. For technical accuracy, refer to the original paper. Read full disclaimer
In the digital world, a blockchain is a shared record book that many computers keep in sync, ensuring that no single person can alter the past. At the heart of this system lies a consensus protocol, a set of rules that allows these separate computers to agree on what is true without needing a central boss. On top of this foundation, developers write smart contracts, which are self-executing programs that automatically carry out agreements, such as transferring money or managing assets, once specific conditions are met. While these technologies promise a new era of trust and automation, they are not immune to failure. Just as a physical lock can be picked or a building can have a structural flaw, the code behind these systems can contain hidden errors. Some of these errors are obvious mistakes in the code, but the most dangerous ones are logical vulnerabilities. These are not typos or broken syntax; they are flaws in the actual plan or business logic, where the code does exactly what it was told to do, but the instructions themselves were wrong. Because these errors depend heavily on the specific purpose of the program, they are notoriously difficult for computers to spot on their own.
A research team led by Alireza Assadzadeh at Islamic Azad University Tabriz Branch has proposed a way to solve this specific problem by bringing a human back into the process. The researchers argue that while automated tools are excellent at scanning code for known patterns, they struggle with the subtle, context-dependent errors that define logical vulnerabilities. To address this, they designed a framework called Human-in-the-Loop, which acts as a partnership between a fast, automated scanner and a careful human expert. The system works in stages. First, an automated tool scans a smart contract and flags potential issues, assigning each warning a confidence score that indicates how sure the tool is about the problem. Instead of showing every single warning to a human, which would be overwhelming, the system filters the list. It only passes the warnings with a high confidence score to the human expert for a final look. The expert then reviews these specific cases, deciding whether they are genuine threats or false alarms. This approach aims to keep the speed of machines while adding the nuance of human judgment.
To test if this method actually works, the researchers ran experiments using a collection of 143 smart contracts that were already known to contain various types of security flaws. They simulated the behavior of a standard automated scanner and then applied their new filtering and review process. The results showed a clear improvement in accuracy. When relying solely on the automated tool, the system correctly identified real problems but also raised many false alarms, leading to a precision score of roughly 0.71. Precision, in this context, measures how many of the flagged issues were actually real problems. After introducing the human review step, the precision jumped to roughly 0.84. This means that the number of false alarms dropped by more than half, specifically by 52.2 percent, while the system did not miss a single real vulnerability that the machine had originally found. The overall measure of the system's effectiveness, known as the F1-score, also rose from roughly 0.83 to 0.91.
The study suggests that this hybrid approach offers a practical solution to a persistent problem in blockchain security. By letting a human expert handle only the most likely candidates, the system reduces the workload while significantly increasing trust in the results. The researchers note that this is particularly important for logical vulnerabilities, which often require an understanding of the intended business rules rather than just a check of the code's structure. While the findings are based on a controlled simulation using existing data rather than a live deployment on a major network, the results indicate that integrating human expertise can meaningfully improve the reliability of detecting these complex errors. The work points toward a future where securing decentralized applications involves not just better software, but a structured collaboration between automated tools and human insight.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.