HOGAT: Higher-Order Graph Attention Networks for Vulnerability Detection in Smart Contracts
摘要
Smart contracts play a crucial role in blockchain ecosystems, automating decentralized financial transactions and governance. However, their complex execution logic and immutability can lead to severe vulnerabilities, such as reentrancy, timestamp dependence, integer overflow/underflow, and infinite loops, resulting in significant financial losses. Traditional vulnerability detection techniques, such as static analysis and symbolic execution, rely on predefined rules and pattern matching, often resulting in high false-positive rates and limited scalability. Recent graph-based models also fall short due to their reliance on one-hop or hierarchical aggregations, which fail to capture cross-function, long-range dependencies, such as recursive call chains in reentrancy vulnerabilities. To address these challenges, we introduce HOGAT, a novel graph-based deep learning model that enhances vulnerability detection by employing multi-hop attention mechanisms in a unified contract graph to capture these long-range dependencies in execution flows. Our approach consists of three phases: (1) smart contract code normalization, (2) contract graph construction, which extracts graph nodes and edges based on the normalized code, and (3) vulnerability detection using HOGAT, which refines node representations to identify vulnerabilities across multiple contract functions and execution paths. We evaluate HOGAT on three datasets: Ethereum Smart Contracts (ESC), VNT Chain Smart Contracts (VSC), and the SolidiFI Benchmark, which together cover a diverse range of vulnerabilities. Experimental results show that HOGAT achieves an average F1-score of 89.8%, with improvements of 3–8% over deep learning baselines and up to 9% over state-of-the-art methods. Additionally, comparisons with LLM-based methods demonstrate F1-score gains of 2–8%, highlighting superior robustness and scalability. Our key contributions include introducing a novel higher-order attention mechanism for vulnerability detection and conducting a comprehensive evaluation of HOGAT across multiple blockchain platforms.