Contract-guardian: a bagging-based gradient boosting decision tree for detection vulnerability in smart contract
摘要
Smart contracts, a core component of blockchain technology, enable automated and trustless transactions but remain vulnerable to security flaws such as reentrancy, integer overflow, and block number dependency, leading to significant financial risks. Existing static analysis tools provide limited detection capabilities and struggle with complex vulnerabilities. We propose a novel Bagging-based Gradient Boosting Decision Tree (BGBDT-CG) framework for robust vulnerability detection in smart contracts. The framework employs a three-step methodology: (i) feature extraction from control flow graphs (CFGs) and abstract syntax trees (ASTs), leveraging multiple fuzzing analyzers for data labeling; (ii) training a hybrid ensemble model combining bagging with Gradient Boosting Decision Tree (GBDT) algorithms, including GBM, LightGBM, CatBoost, and XGBoost; and (iii) detecting vulnerabilities through classification tasks, with final predictions determined by a majority-voting mechanism across class probabilities. Extensive experiments demonstrate the effectiveness of the BGBDT-CG model, achieving 98% detection accuracy and an average F1 score of 95.2%, outperforming existing methods. The integration of bagging and CatBoost proved particularly effective, highlighting the framework's robustness and reliability in smart contract vulnerability detection.