Template-aware explainable software vulnerability prediction using hybrid structural and security-sensitive code features

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.

Authors

Institutions

Publication Details

Journal
Scientific Reports
Published
2026-11-26
DOI
https://doi.org/10.1038/s41598-026-81937-5
Primary Topic
Software Engineering Research
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
article

Template-aware explainable software vulnerability prediction using hybrid structural and security-sensitive code features

Ameur Benséfia, Sathyanarayanan Devendran, Komal Kumar Napa, Lokeshwaran Kanagaraj
Scientific Reports
Software Engineering Research
article

Template-aware explainable software vulnerability prediction using hybrid structural and security-sensitive code features

Ameur Benséfia, Sathyanarayanan Devendran, Komal Kumar Napa, Lokeshwaran Kanagaraj
article en

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.

Scientific Reports
Higher Colleges of Technology (AE), Vel Tech Rangarajan Dr. Sagunthala R&D Institute of Science and Technology (IN), Mahatma Gandhi Institute of Technology (IN), Saveetha University (IN)
Software Engineering Research
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon