Comparative Analysis of Machine Learning Algorithms for Cross-Site Scripting (XSS) Attack Detection - Hamzah, Khairatun Hisan; Osman, Mohd Zamri; Anthony, Tumusiime; Ismail, Mohd Arfian; Abdullah, Zubaile; Alanda, Alde (JOIV : International Journal on Informatics Visualization, 2024)
Cross-Site Scripting (XSS) attacks pose a significant cybersecurity threat by exploiting vulnerabilities in web applications to inject malicious scripts, enabling unauthorized access and execution of malicious code. Traditional XSS detection systems often struggle to identify increasingly complex XSS payloads. To address this issue, this research evaluated the efficacy of Machine Learning algorithms in detecting XSS threats within online web applications. The study conducts a comprehensive comparative analysis of XSS attack detection using four prominent Machine Learning algorithms, which consist of Extreme Gradient Boosting (XGBoost), Random Forest (RF), K-Nearest Neighbors (KNN), and Support Vector Machine (SVM). This research utilizes a comparative methodology to assess the selected Machine Learning algorithms by analyzing their performance metrics, including confusion matrix, 10-fold cross-validation, and assessment of training time to thoroughly evaluate the models. By exploring dataset characteristics and evaluating the performance metrics of each selected algorithm, the study determined the most robust Machine Learning solution for XSS detection. Results indicate that Random Forest is the top performer, achieving 99.93% accuracy and balanced metrics across all criteria evaluated. These findings will significantly enhance web application security by providing reliable defenses against evolving XSS threats.