journal article·2023-07-05Open access

Detection of Reflected XSS Vulnerabilities Based on Paths-Attention Method

Xiaobo Tan, Yingjie Xu, Tong Wu, Bohan Li

Applied Sciences· Volume 13· Issue 13

Abstract

Cross-site scripting vulnerability (XSS) is one of the most frequently exploited and harmful vulnerabilities among web vulnerabilities. In recent years, many researchers have used different machine learning methods to detect network attacks, but these methods have not achieved high accuracy and recall rates and cannot effectively combat XSS attacks. Designing a model that can achieve high accuracy and truly proactive defense against reflected XSS vulnerabilities has become a top priority for maintaining user network security at this stage. In this paper, we propose a detection model for reflected XSS vulnerabilities based on the paths-attention method (PATS model). Firstly, the model converts vulnerability data into an intermediate representation of abstract syntax trees, then traverses the abstract syntax tree to generate multiple sets of syntactic paths, and then converts them into vector representations through word embedding matrices. The model extracts semantic features using attention mechanisms to improve training effectiveness by assigning appropriate weights to different sets of syntactic paths as it learns with neural networks, which realizes the transformation from passive defense to active defense. Additionally, in the dataset processing section, we point out the shortcomings of current research datasets and construct a reliable dataset composed of 1000 malicious samples from NIST and 10,000 benign samples from GitHub for experimentation purposes. Experimental results show that compared with other machine learning models, the paths-attention method can achieve an accuracy rate of 90.25% and F1-score of 81.62%, while reducing the training time by half to 30 h.
Source: crossref · Quality: baseline

Research context

OpenAlex topics: Software Engineering Research · Web Application Security Vulnerabilities · Advanced Malware Detection Techniques

SciVX discovery tags are terminology-based. OpenAlex topics are source-provided classifications.

Affiliations

School of Information Science and Engineering, Shenyang Ligong University, Shenyang 110159, China

Funding

Liaoning Provincial Department of Education

References (25)

Show source-provided references
1. Defending against web application vulnerabilities10.1109/MC.2011.259 ↗
2. Huang, J., Guan, X., and Li, S. (2021, January 25–27). Software defect prediction model based on attention mechanism. Proceedings of the 2021 International Conference on Computer Engineering and Application (ICCEA), Kunming, China.10.1109/ICCEA53728.2021.00073 ↗
3. Detection of Reflected Cross-Site Scripting Vulnerabilities Based on Fuzzy Testing
4. Wang, X., Chen, J., and Gu, Y. (2015, January 14–16). Generalized graph signal sampling and reconstruction. Proceedings of the 2015 IEEE Global Conference on Signal and Information Processing (GlobalSIP), Orlando, FL, USA.10.1109/GlobalSIP.2015.7418259 ↗
5. Client-side cross-site scripting protection10.1016/j.cose.2009.04.008 ↗
6. Qin, Y. (2019). Key Technology Research and Implementation of Stored Cross-Site Scripting Vulnerabilities. [Ph.D. Thesis, Beijing University of Technology].
7. Zhang, W. (2019). Research and Improvement of White Box Fuzz Testing Technology. [Ph.D. Thesis, Nanjing University of Posts and Telecommunications].
8. Simos, D.E., Garn, B., Zivanovic, J., and Leithner, M. (2019, January 22–23). Practical combinatorial testing for XSS detection using locally optimized attack models. Proceedings of the 2019 IEEE International Conference on Software Testing, Verification and Validation Workshops (ICSTW), Xi’an, China.10.1109/ICSTW.2019.00040 ↗
9. A survey of exploitation and detection methods of XSS vulnerabilities10.1109/ACCESS.2019.2960449 ↗
10. Allamanis, M., Tarlow, D., Gordon, A., and Wei, Y. (2015, January 6–11). Bimodal modelling of source code and natural language. Proceedings of the International Conference on Machine Learning, Lille, France.
11. Gamez-Diaz, A., Fernandez, P., and Ruiz-Cortes, A. (2017, January 13–16). An analysis of RESTful APIs offerings in the industry. Proceedings of the Service-Oriented Computing: 15th International Conference, ICSOC 2017, Malaga, Spain.10.1007/978-3-319-69035-3_43 ↗
12. A Penetration Testing Method for XSS Vulnerabilities Based on Attack Vector Generation
13. Sivanesan, A.P., Mathur, A., and Javaid, A.Y. (2018, January 3–5). A google chromium browser extension for detecting XSS attack in html5 based websites. Proceedings of the 2018 IEEE International Conference on Electro/Information Technology (EIT), Rochester, MI, USA.10.1109/EIT.2018.8500284 ↗
14. GraphXSS: An efficient XSS payload detection approach based on graph convolutional network10.1016/j.cose.2021.102597 ↗
15. (2021, May 01). Software Assurance Reference Dataset from the National Institute of Standards and Technology (NIST), Available online: https://www.nist.gov/itl/ssd/software-quality-group/samate/software-assurance-reference-dataset-sard.
16. A Review of Research on Recurrent Neural Networks
17. Iyer, S., Konstas, I., Cheung, A., and Zettlemoyer, L. (2016, January 7–12). Summarizing source code using a neural attention model. Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics, Berlin, Germany.10.18653/v1/P16-1195 ↗
18. Bielik, P., Raychev, V., and Vechev, M. (2016, January 19–24). PHOG: Probabilistic model for code. Proceedings of the International Conference on Machine Learning, New York, NY, USA.10.1145/2983990.2984041 ↗
19. code2vec: Learning distributed representations of code10.1145/3290353 ↗
20. Detection of Reflected XSS Using Dynamic Information Flow Tracking
21. Mishne, A., Shoham, S., and Yahav, E. (2012, January 19–26). Typestate-based semantic code search over partial programs. Proceedings of the ACM International Conference on Object Oriented Programming Systems Languages and Applications, Tucson, AZ, USA.10.1145/2384616.2384689 ↗
22. VDSimilar: Vulnerability detection based on code similarity of vulnerabilities and patches10.1016/j.cose.2021.102417 ↗
23. Cross-site scripting detection method based on classifier and improved n-gram model in OSN
24. Dam, H.K., Pham, T., Ng, S.W., Tran, T., Grundy, J., Ghose, A., Kim, T., and Kim, C.-J. (2019, January 25–31). Lessons learned from using a deep tree-based model for software defect prediction in practice. Proceedings of the 2019 IEEE/ACM 16th International Conference on Mining Software Repositories (MSR), Montreal, QC, Canada.10.1109/MSR.2019.00017 ↗
25. Vuldetector: Detecting vulnerabilities using weighted feature graph comparison10.1109/TIFS.2020.3047756 ↗