A Feature Fusion-Based Detection Model Against Adversarial XSS Attacks
摘要
Cross-site scripting (XSS) attacks have emerged as a critical web threat due to their potential to compromise user data. Many schemes have been put forward to detect and mitigate XSS. However, adversarial attacks exploit confusion strings to modify raw XSS payloads, leading to high false negative rate of existing machine and deep learning models. Accurate identification of adversarial XSS attacks poses a significant challenge. Therefore, in this paper, a feature fusion-based detection framework is designed, which includes adversarial XSS vectors generation, data preprocessing, feature extraction and classification. The feature extraction model fuses Long Short-term Memory (LSTM), Convolutional Neural Network (CNN) and relevant keywords termed as F-LCK. It first maps each adversarial XSS payload into spatial vector through Word2vec. Then, a triple-block network is devised to perform feature extraction on the data. Block I: extract global semantic information of XSS through the utilization of the stacked LSTM network; Block II: extract local context information via multi-channel convolutional layers; Block III: embed highly relevant keywords to enhance the deep features of XSS payloads. The XGBoost classifier is employed to handle the detection tasks using the fused features. Experiment is conducted on the generated adversarial dataset, demonstrating that the proposed model achieved a detection rate of 98.89% against adversarial XSS samples. In other words, the triple-block feature extraction model effectively addresses the challenge posed by adversarial XSS attacks.