XSS Detection Technology Based on LSTM-Attention
Authors:
- 16 October 2020
- conference paper
- Published by Institute of Electrical and Electronics Engineers (IEEE)
- p. 175-180
Abstract
Cross-site scripting (XSS) is one of the main threats of Web applications, which has great harm. How to effectively detect and defend against XSS attacks has become more and more important. Due to the malicious obfuscation of attack codes and the gradual increase in number, the traditional XSS detection methods have some defects such as poor recognition of malicious attack codes, inadequate feature extraction and low efficiency. Therefore, we present a novel approach to detect XSS attacks based on the attention mechanism of Long Short-Term Memory (LSTM) recurrent neural network. First of all, the data need to be preprocessed, we used decoding technology to restore the XSS codes to the unencoded state for improving the readability of the code, then we used word2vec to extract XSS payload features and map them to feature vectors. And then, we improved the LSTM model by adding attention mechanism, the LSTM-Attention detection model was designed to train and test the data. We used the ability of LSTM model to extract context-related features for deep learning, the added attention mechanism made the model extract more effective features. Finally, we used the classifier to classify the abstract features. Experimental results show that the proposed XSS detection model based on LSTM-Attention achieves a precision rate of 99.3% and a recall rate of 98.2% in the actually collected dataset. Compared with traditional machine learning methods and other deep learning methods, this method can more effectively identify XSS attacks.Keywords
This publication has 12 references indexed in Scilit:
- A Review of Recurrent Neural Networks: LSTM Cells and Network ArchitecturesNeural Computation, 2019
- DeepXSS2018
- Detecting DOM-Sourced Cross-Site Scripting in Browser Extensions2017
- XSS-SAFE: A Server-Side Approach to Detect and Mitigate Cross-Site Scripting (XSS) Attacks in JavaScript CodeArabian Journal for Science and Engineering, 2015
- Current state of research on cross-site scripting (XSS) – A systematic literature reviewInformation and Software Technology, 2015
- ETSSDetector: A Tool to Automatically Detect Cross-Site Scripting Vulnerabilities2014
- Machine Learning Based Cross-Site Scripting Detection in Online Social Network2014
- A survey on server-side approaches to securing web applicationsACM Computing Surveys, 2014
- Efficient Malicious Code Detection Using N-Gram Analysis and SVM2011
- Pixy: a static analysis tool for detecting Web application vulnerabilities2006