Template-aware explainable software vulnerability prediction using hybrid structural and security-sensitive code features
Year: 2026
Type: article
Abstract: Software vulnerabilities remain a major challenge in secure software development, motivating accurate and interpretable methods for early vulnerability prediction. This paper presents a template-aware explainable framework for binary software vulnerability prediction across 15 Common Weakness Enumeration (CWE) categories using hybrid structural, memory-related, and security-sensitive code features. A dataset comprising 172,405 function-level samples and 52,840 testcase templates was constructed from the Juliet Test Suite. A 23-dimensional feature representation was developed and evaluated using Logistic Regression, Linear SVM, Random Forest, LightGBM, and XGBoost under template-aware evaluation. Random Forest achieved the best performance in the template-level evaluation, obtaining 98.44% accuracy, 91.82% precision, 97.70% recall, 94.66% F1-score, 99.74% ROC-AUC, and 0.9381 MCC. Under strict testcase-family-aware evaluation, the Random Forest model achieved 98.09% accuracy, 91.80% precision, 95.52% recall, 93.62% F1-score, 99.68% ROC-AUC, and 0.9253 MCC for the verified seed-42 prediction set. SHapley Additive exPlanations (SHAP) identified pointer operations, code size, function interaction complexity, array manipulation, and type-casting operations as influential vulnerability indicators. Across five repeated testcase-family-aware evaluations, the model maintained stable performance, achieving 97.80 ± 0.23% accuracy and 92.43 ± 0.85% F1-score. Statistical validation using McNemar’s and Friedman tests confirmed significant differences in paired predictions and across feature configurations, while Wilcoxon analysis did not detect a statistically significant difference between the Structural + Memory and Full Hybrid representations across the repeated evaluations. Evaluation on the Devign dataset, using its predefined training and test partitions, resulted in substantially lower performance, indicating that the proposed lightweight feature representation has limited predictive effectiveness on heterogeneous real-world vulnerability data and motivating the incorporation of richer semantic representations.
Source: Scientific Reports
Language: English
Subfield: Information Systems
Field: Computer Science
Domain: Physical Sciences
Open Access status: gold
Estimated APC paid: $2,690
OpenAlex ID: W7240081007
FWCI:
Cites:
Cited by:
Related to:
