

Journal
Computer Standards and Interfaces
Volume
98
ISSN
09205489
Publication date
August 1, 2026
Cross-site scripting (XSS) attacks are still one of the most common and significant risks to current online and mobile applications. This paper presents a hybrid XSS detection system that combines data balance, feature selection, and deep learning to overcome the shortcomings of current detection methods. First, the Synthetic Minority Over-sampling Technique (SMOTE) is used to address an unbalanced dataset. It is used to create the structural feature space to eliminate training bias. Next, a Binary Grey Wolf Optimizer (BGWO) is developed to identify the most useful structural features. At the same time, a Transformer–LSTM architecture is used to learn semantic and sequential representations directly from tokenized XSS payloads. This enables the effective description of complex and evolving attack patterns. Then, a late feature fusion technique is used to integrate the optimal structural features and semantic representations at the dense layer. After that, a dense neural classifier is used to classify the data. The k-fold cross-validation is applied to the real-world XSS datasets containing 43,218 and 140,660 payloads to evaluate the proposed framework. Experimental results indicate that BGWO reduces the original structural features by roughly 30 % while preserving essential information. The hybrid framework achieves an average accuracy of 99.61 %, precision of 99.53 %, sensitivity of 99.67 %, and F1-score of 99.60 %.