Answers are grounded in this paper and cite their sources.
Cross-site scripting (XSS) remains one of the most prevalent web application vulnerabilities, with over 8,500 XSS vulnerabilities reported in 2025 alone, accounting for nearly 20% of all reported security vulnerabilities. Deep learning approaches show promise for XSS detection, but existing models struggle with high dimensionality, sparsity, class imbalance, and lack of interpretability. To address these gaps, we propose a novel XAI-driven Deep Residual MLP framework that integrates rigorous feature selection, SHAP-based explainability, and comprehensive class imbalance handling. Evaluated on a large-scale dataset of 138,569 samples with 167 features, our framework employs a multi-stage feature selection pipeline (variance thresholding + ANOVA F-test) that reduces features to 50 informative inputs, combined with a deep residual MLP architecture with batch normalization, residual connections, and progressive dropout. We systematically compare four class balancing strategies: unbalanced baseline with class weights, SMOTE, SMOTE-Tomek, and SMOTE-ENN. Counter-intuitively, the unbalanced baseline with class weights achieves the highest minority recall (0.99), accuracy (0.9900), AUC-ROC (0.9994), and lowest false negatives (58, 1.0% FNR), outperforming all SMOTE variants on recall. SMOTE-Tomek achieves the best precision for malicious payloads (0.9938) and overall accuracy (0.9920), while SMOTE-ENN achieves the best recall among SMOTE variants (0.9811). SHAP analysis reveals statistical entropy, special character frequency, and JavaScript keyword presence as the most important features, with local explanations providing transparent justifications for each prediction. Our framework bridges the gap between detection effectiveness and interpretability, offering security analysts actionable insights for trust, forensic investigation, and regulatory compliance.
No takes yet. Share an insight, caveat, or question.
Deneke et al. (2026) studied this question.
Synapse has enriched 8 closely related papers on similar clinical questions. Consider them for comparative context: