Buffer overflow fault detection using HMRBO, CNN-ANN with GraphcodeBERT, PDG features, and gated attention fusion
摘要
Buffer overflow is a severe software vulnerability threatening system security and reliability. This work presents a novel detection model leveraging token-level semantic embeddings from GraphCodeBERT combined with structural Program Dependence Graph (PDG) features. A Gated Attention Fusion mechanism effectively integrates semantic and structural information, enabling precise identification of buffer misuse patterns. The hybrid deep architecture, incorporating Convolutional Neural Networks (CNN) and Artificial Neural Networks (ANN), captures both local and global code features. To optimize performance and reduce manual tuning, Hybrid Manta Ray Bee Optimization (HMRBO) is employed for hyperparameter tuning. Extensive benchmarking demonstrates that the proposed method achieves superior detection accuracy and F1-score compared to state-of-the-art approaches, with interpretable fault localization via attention visualization. This study advances automated buffer overflow detection by combining deep code embeddings, structural graph analysis, and bio-inspired optimization techniques.