Cross-Site Scripting Attacks and Defensive Techniques: A Comprehensive Survey
Cross-Site Scripting Attacks and Defensive Techniques: A Comprehensive Survey
net/publication/362579539
Article in International Journal of Communications Network and System Sciences · August 2022
DOI: 10.4236/ijcns.2022.158010
CITATIONS READS
14 2,186
1 author:
Sonkarlay J. Y. Weamie
Hunan University
7 PUBLICATIONS 41 CITATIONS
SEE PROFILE
All content following this page was uploaded by Sonkarlay J. Y. Weamie on 10 August 2022.
Sonkarlay J. Y. Weamie
Independent Researcher, College of Computer Science & Electronic Engineering, Hunan University, Changsha, China
Keywords
XSS Attacks, Defensive Techniques, Vulnerabilities, Web Application
Security
1. Introduction
XSS (Cross-Site Scripting) is a programming-related flaw [1] that occurs when
*Cross-site scripting attacks.
DOI: 10.4236/ijcns.2022.158010 Aug. 9, 2022 126 Int. J. Communications, Network and System Sciences
S. J. Y. Weamie
user input data is not correctly sanitized. The attacker exploits this vulnerability
to inject unfiltered scripting code into the web application, resulting in account
takeover, session or cooking stealing, and rerouting to the attacker’s website
when the parser processes the script [2] [3]. XSS attack can be initiated on any
susceptible website written in any programming language.
A thorough analysis of Cross-Site Scripting vulnerabilities has been presented
in detail. We talked about what XSS is, the numerous forms of XSS assaults, how
an attacker may exploit this weakness, the results of an XSS attack, and the pro-
tective strategies established by the research community to fight against XSS at-
tacks. On the other hand, we examined those defensive strategies and identified
the shortcomings in how they were defended against particular XSS attacks.
However, despite researchers’ efforts, XSS attacks [4] can still disrupt web ap-
plications at a larger skill irrespective of the fact that various tactics and ap-
proaches for preventing vulnerabilities have been established. Due to the vir-
tually unchanged browser behavior, it is difficult to detect XSS attacks and diffe-
rentiate between malicious JavaScript and legitimate online content.
Several sections of the paper are precisely organized according to their respec-
tive topics: The definition and classification of XSS, as well as the injection me-
thods utilized by XSS and the damage it causes to web-based applications, are
covered in Segment 2. Segment 3 describes the research data composition and
compares the CWE Names using the software development vulnerability data
for analysis. Segment 4 presents the related work. Segment 5 discusses the XSS
prevention and defense mechanism along with the researchers’ defensive tech-
niques for XSS attacks (advantages & disadvantages). Segment 6 describes the
challenges associated with detecting and defending against XSS attacks along
with the precise precautionary measures that should be implemented in response
to a given episode. The current issues are broken down into their parts, and then
the perspective for the future is presented.
Although each of the four categories of attacks takes a somewhat different ap-
proach to exploiting web applications, they are still geared toward the same end
goal of collecting user account information as generally illustrated in Figure 2.
However, if you’re not familiar with XSS attacks, this should help put things
into perspective. As indicated in Figure 1 regarding the four categories of XSS
assaults and also displayed in Figure 2 depicting the typical circumstances of
XSS attack vector, the following details about the aforementioned categories are
explained respectively.
will then be executed unintentionally inside the client’s internet browser if other
clients later access that resource, as shown in Figure 3.
On the other hand, reflected XSS attacks work like stored XSS attacks but
don’t require a database or a server. No server is involved in a reflected XSS at-
tack because the client code is affected directly in the browser, as demonstrated
in Figure 4. Web applications can be vulnerable to this type of attack (see Figure
4) because of actions taken by a user that executes an unstored (interconnected)
script on the user’s computer.
When an external actor injects something that appears safe, as shown in Fig-
ure 6, the browser rewrites and modifies it while processing the HTML, result-
ing in a mutated XSS attack [19]. This makes it incredibly difficult to find and
sanitize bugs in application logic. Despite its novelty and widespread misinter-
pretation, mXSS attacks have been utilized to bypass the most sophisticated XSS
filters available. mXSS has been used to circumvent solutions such as DOMPu-
rify [20], OWASP AntiSamy, and Google Caja, and a large number of popular
web apps (especially email clients) have been discovered to be vulnerable [21]
[17]. At its foundation, mXSS works by employing filter-safe payloads that mu-
tate into insecure payloads after filtration. All major browsers are vulnerable to
mXSS attacks. Developers must understand how browsers handle optimizations
and conditional expressions when rendering DOM nodes.
Figure 7. A brief overview of the dataset used for analyzing XSS vulnerability.
The pie charts below illustrate the number of the top 20 Software Development
Vulnerabilities based on CWE Name from 2014 to 2022. Over the last nine
years, the most frequent report of a cross-site scripting (XSS) vulnerability has
been alarmingly received, as shown in Figure 8. I used python Jupiter Notebook
[27] to analyze the data.
4. Related Works
Different security organizations have revealed that XSS has been prevalent in in-
ternet security threats in the past years. Cross-Site Scripting (XSS) vulnerability
has infiltrated approximately 70% [28] of web applications, including MySpace,
Cisco, NASA, Facebook, Twitter, Google, YouTube, eBay, ads.tiktok.com [29],
etc. Its emergence is primarily due to security flaws in web application develop-
ment and incorrect input validation submitted by users in website input fields.
The Samy MySpace worm in 2005 brought the XSS vulnerability to the notice of
a wider audience globally [30]. So far, a wide variety of XSS attacks have been
discussed. Interestingly, after conducting a comprehensive survey and reading
over sixty research papers and publications, I have provided in this paper as
Protective Approaches the defensive mechanisms revealed by previous research-
ers concerning XSS vulnerabilities. These defensive measures assist us in identi-
fying and categorizing the articles based on the model employed to resolve the
web application security problems.
Technique Explanation
/ / or & #47
‘ ‘ or & #39
# & #35
) & #41
( & #40
tacks have been identified as a potential security risk. This study recommenda-
tion emphasizes the importance of developing solutions capable of offering ef-
fective defense against the newly identified variant of XSS. Using the survey re-
sults, we believe that the research community can better understand XSS protec-
tion measures and that this survey can also guide the development of more inte-
grated and pragmatic security solutions. This survey suggested an efficient and
robust XSS defensive architecture for future research. This study significantly
contributes to the development of effective defensive mechanisms to limit the
effects of such attacks on rapidly expanding web application platforms. Evalua-
tion of existing XSS attack defensive solutions at the client-side, proxy-side, and
server-side levels, as well as a machine learning technique that will undoubtedly
aid in the evaluation of the impact of such an advanced level attack.
Combining static testing, dynamic testing, code auditing with secure coding,
and ongoing initiatives to educate users about XSS developing vulnerabilities is
critical. XSS will persist unless internet users become more aware of their secu-
rity and privacy and software developers construct secure programs. According
to this survey, XSS attacks can seize control of vital services and sensitive data if
these safeguards are not established and maintained regularly.
Acknowledgements
This publication was made possible by the direction of the research laboratory of
Hunan University’s College of Computer Science and Electronic Engineering. I
am grateful for the opportunity to utilize the facility and necessary electronic
equipment to complete the data analysis task for this research.
I would like to express my gratitude to the entire research community for
pointing me in the right direction and providing clarity regarding the principles
that support web application security through the use of papers, books, surveys,
online articles, and blogs.
Conflicts of Interest
The author states that there are no competing interests involved. This article’s
structure, as well as its contents and authorship, are solely the author’s responsi-
bility.
References
[1] Kirsten, S. (2016) Cross Site Scripting (XSS) Software Attack.
https://owasp.org/www-community/attacks/xss/
[2] Agrawal, D.P. and Wang, H. (2018) Computer and Cyber Security. Auerbach Pub-
lications, New York. https://doi.org/10.1201/9780429424878
[3] Jiang, F., Fu, Y., Gupta, B.B., Liang, Y., Rho, S., Lou, F., et al. (2020) Deep Learning
Based Multi-Channel Intelligent Attack Detection for Data Security. IEEE Transac-
tions on Sustainable Computing, 5, 204-212.
https://doi.org/10.1109/TSUSC.2018.2793284
[4] Baş Seyyar, M., Çatak, F.Ö. and Gül, E. (2018) Detection of Attack-Targeted Scans from
the Apache HTTP Server Access Logs. Applied Computing and Informatics, 14, 28-36.
https://doi.org/10.1016/j.aci.2017.04.002
[5] Chen, H.-C., Nshimiyimana, A., Damarjati, C. and Chang, P.-H. (2021) Detection and
Prevention of Cross-Site Scripting Attack with Combined Approaches. 2021 Interna-
tional Conference on Electronics, Information, and Communication (ICEIC), Jeju, 31
January-3 February 2021, 1-4. https://doi.org/10.1109/ICEIC51217.2021.9369796
[6] Gan, J.-M., Ling, H.-Y. and Leau, Y.-B. (2021) A Review on Detection of Cross-Site
Scripting Attacks (XSS) in Web Security. International Conference on Advances in
Cyber Security, Penang, 8-9 December 2020, 685-709.
https://link.springer.com/chapter/10.1007/978-981-33-6835-4_45
[7] Wibowo, R.M. and Sulaksono, A. (2021) Web Vulnerability Through Cross Site
Scripting (XSS) Detection with OWASP Security Shepherd. Indonesian Journal of
Information Systems, 3, 149-59. https://doi.org/10.24002/ijis.v3i2.4192
[8] Dora, J.R. and Nemoga, K. (2021) Ontology for Cross-Site-Scripting (XSS) Attack in
Cybersecurity. Journal of Cybersecurity and Privacy, 2021, 319-339.
https://doi.org/10.3390/jcp1020018
[9] Nirmal, K., Janet, B. and Kumar, R. (2018) Web Application Vulnerabilities—The
Hacker’s Treasure. 2018 International Conference on Inventive Research in Com-
puting Applications (ICIRCA), Coimbatore, 11-12 July 2018, 58-62.
https://doi.org/10.1109/ICIRCA.2018.8597221
[10] Cui, Y., Cui, J. and Hu, J. (2020) A Survey on XSS Attack Detection and Prevention
in Web Applications. Proceedings of the 2020 12th International Conference on
Machine Learning and Computing, Shenzhen, 15-17 February 2020, 443-449.
https://doi.org/10.1145/3383972.3384027
[11] Khazal, I. and Hussain, M. (2021) Server Side Method to Detect and Prevent Stored
XSS Attack. Iraqi Journal for Electrical and Electronic Engineering, 17, 58-65.
https://doi.org/10.37917/ijeee.17.2.8
[12] Revyakina, Y., Cherckesova, L., Safaryan, O., Korochentsev, D., Boldyrikhin, N. and
Ivanov, Y. (2020) Possibilities of Conducting XSS-Attacks and the Development of
Countermeasures. E3S Web of Conferences, 224, Article No. 01040.
https://doi.org/10.1051/e3sconf/202022401040
[13] Maurel, H., Vidal, S. and Rezk, T. (2022) Statically Identifying XSS Using Deep
Learning. Science of Computer Programming, 219, Article ID: 102810.
https://doi.org/10.1016/j.scico.2022.102810
[14] Hickling, J. (2021) What Is DOM XSS and Why Should You Care? Computer Fraud
& Security, 2021, 6-10. https://doi.org/10.1016/S1361-3723(21)00040-3
[15] Ninawe, S. and Wajgi, R. (2020) Detection of DOM-Based XSS Attack on Web Ap-
plication. Intelligent Communication Technologies and Virtual Mobile Networks
2019, Tirunelveli, 14-15 February 2019, 633-641.
https://link.springer.com/chapter/10.1007/978-3-030-28364-3_65
[16] Wang, P., Bangert, J. and Kern, C. (2021) If It’s Not Secure, It Should Not Compile:
Preventing DOM-Based XSS in Large-Scale Web Development with API Harden-
ing. 2021 IEEE/ACM 43rd International Conference on Software Engineering
(ICSE), Madrid, 22-30 May 2021, 1360-1372.
https://doi.org/10.1109/ICSE43902.2021.00123
[17] Hoffman, A. (2020) Web Application Security: Exploitation and Countermeasures
for Modern Web Applications. O’Reilly Media, Inc., Sebastopol.
https://books.google.com/books?hl=en&lr=&id=3R3UDwAAQBAJ&oi=fnd&pg=P
R2&dq=Web+application+security%E2%80%AF:+exploitation+and+countermeasu
res+for+modern+web+applications&ots=PGdlEp9ORy&sig=0EKCDxN_UPA9rpV
KQvwPPjvzmyk#v=onepage&q=Web%20application%20security%E2%80%AF%3A
%20exploitation%20and%20countermeasures%20for%20modern%20web%20applic
ations&f=false
[18] Remya, S. and Praveen, K. (2016) Protecting the Augmented Browser Extension
from Mutation Cross-Site Scripting. Proceedings of the 2nd International Confe-
rence on Computer and Communication Technologies, Vol. 1, Hyderabad, 24-26
July 2015, 215-223.
https://link.springer.com/chapter/10.1007/978-81-322-2517-1_22
[19] Kaur, J. and Garg, U. (2021) A Detailed Survey on Recent XSS Web-Attacks Ma-
chine Learning Detection Techniques. 2021 2nd Global Conference for Advance-
ment in Technology (GCAT 2021), Bangalore, 1-3 October 2021, 1-6.
https://doi.org/10.1109/GCAT52182.2021.9587569
[20] Pazos, J.C., Légaré, J.S. and Beschastnikh, I. (2021) XSnare: Application-Specific
Client-Side Cross-Site Scripting Protection. Proceedings of 2021 IEEE International
Conference on Software Analysis, Evolution and Reengineering (SANER 2021),
Honolulu, 9-12 March 2021, 154-165.
https://doi.org/10.1109/SANER50967.2021.00023
[21] Mohammadi, M., Chu, B. and Richter Lipford, H. (2019) Automated Repair of
Cross-Site Scripting Vulnerabilities through Unit Testing. Proceedings of 2019 IEEE
30th International Symposium on Software Reliability Engineering Workshops,
(ISSREW 2019), Berlin, 27-30 October 2019, 370-377.
https://doi.org/10.1109/ISSREW.2019.00098
[22] Wang, Y., Zhou, Y., Zou, X., Miao, Q. and Wang, W. (2020) The Analysis Method
of Security Vulnerability Based on the Knowledge Graph. 2020 10th International
Conference on Communication and Network Security, Tokyo, 27-29 November
2020, 135-145. https://doi.org/10.1145/3442520.3442535
[23] Williams, M.A., Dey, S., Barranco, R.C., Naim, S.M., Hossain, M.S. and Akbar, M.
(2018) Analyzing Evolving Trends of Vulnerabilities in National Vulnerability Da-
tabase. 2018 IEEE International Conference on Big Data (Big Data), Seattle, 10-13
December 2018, 3011-3020. https://doi.org/10.1109/BigData.2018.8622299
[24] Forain, I., de Oliveira Albuquerque, R. and de Sousa Júnior, R.T. (2022) Towards
System Security: What a Comparison of National Vulnerability Databases Reveals.
2022 17th Iberian Conference on Information Systems and Technologies (CISTI),
Madrid, 22-25 June 2022, 1-6. https://doi.org/10.23919/CISTI54924.2022.9820232
[25] Guo, H., Xing, Z., Chen, S., Li, X., Bai, Y. and Zhang, H. (2021) Key Aspects Aug-
mentation of Vulnerability Description based on Multiple Security Databases. 2021
IEEE 45th Annual Computers, Software, and Applications Conference (COMPSAC),
Madrid, 12-16 July 2021, 1020-1025.
https://doi.org/10.1109/COMPSAC51774.2021.00138
[26] Wang, T., Qin, S. and Chow, K.P. (2021) Towards Vulnerability Types Classifica-
tion Using Pure Self-Attention: A Common Weakness Enumeration Based Ap-
proach. 2021 IEEE 24th International Conference on Computational Science and
Engineering (CSE), Shenyang, 20-22 October 2021, 146-153.
https://doi.org/10.1109/CSE53436.2021.00030
[27] Mantha, B.R.K., Jung, Y. and Garcia De Soto, B. (2020) Implementation of the
Common Vulnerability Scoring System to Assess the Cyber Vulnerability in Con-
struction Projects. Creative Construction E-Conference 2020, Online, 28 June-1 July
2020, 117-124.
[28] Fangohr, H., Kluyver, T. and DiPierro, M. (2021) Jupyter in Computational Science.
[54] Wang, R., Jia, X., Li, Q. and Zhang, D. (2015) Improved N-Gram Approach for
Cross-Site Scripting Detection in Online Social Network. 2015 Science and Infor-
mation Conference (SAI), London, 28-30 July 2015, 1206-1212.
https://doi.org/10.1109/SAI.2015.7237298
[55] Mokbal, F.M.M., Wang, D., Imran, A., Jiuchuan, L., Akhtar, F. and Wang, X. (2019)
MLPXSS: An Integrated XSS-Based Attack Detection Scheme in Web Applications
Using Multilayer Perceptron Technique. IEEE Access, 7, 100567-100580.
https://doi.org/10.1109/ACCESS.2019.2927417
[56] Moniruzzaman, M., Bagirov, A., Gondal, I. and Brown, S. (2018) A Server Side Solu-
tion for Detecting WebInject: A Machine Learning Approach. Pacific-Asia Confe-
rence on Knowledge Discovery and Data Mining, Melbourne, 3 June 2018, 162-167.
https://doi.org/10.1007/978-3-030-04503-6_16
[57] Tariq, I., Sindhu, M.A., Abbasi, R.A., Khattak, A.S., Maqbool, O. and Siddiqui, G.F.
(2021) Resolving Cross-Site Scripting Attacks through Genetic Algorithm and
Reinforcement Learning. Expert Systems with Applications, 168, Article ID: 114386.
https://doi.org/10.1016/j.eswa.2020.114386
[58] Fang, Y., Huang, C., Xu, Y. and Li, Y. (2019) RLXSS: Optimizing XSS Detection
Model to Defend Against Adversarial Attacks Based on Reinforcement Learning.
Future Internet, 11, Article 177. https://doi.org/10.3390/fi11080177
[59] Fang, Y., Li, Y., Liu, L. and Huang, C. (2018) DeepXSS: Cross Site Scripting Detec-
tion Based on Deep Learning. Proceedings of the 2018 International Conference on
Computing and Artificial Intelligence, Chengdu, 12-14 March 2018, 47-51.
https://doi.org/10.1145/3194452.3194469
[60] Kaur, G., Malik, Y., Samuel, H. and Jaafar, F. (2018) Detecting Blind Cross-Site
Scripting Attacks Using Machine Learning. Proceedings of the 2018 International
Conference on Signal Processing and Machine Learning, Shanghai, 28-30 Novem-
ber 2018, 22-25. https://doi.org/10.1145/3297067.3297096
[61] Lekies, S., Stock, B. and Johns, M. (2013) 25 Million Flows Later: Large-Scale Detec-
tion of DOM-Based XSS. Proceedings of the 2013 ACM SIGSAC Conference on
Computer & Communications Security, Berlin, 4-8 November 2013, 1193-1204.
https://doi.org/10.1145/2508859.2516703
[62] Van Acker, S., Nikiforakis, N., Desmet, L., Joosen, W. and Piessens, F. (2012) Fla-
shOver: Automated Discovery of Cross-Site Scripting Vulnerabilities in Rich Inter-
net Applications. Proceedings of the 7th ACM Symposium on Information, Com-
puter and Communications Security, Seoul, 2-4 May 2012, 12-13.
https://doi.org/10.1145/2414456.2414462
[63] Vishnu, B.A. and Jevitha, K.P. (2014) Prediction of Cross-Site Scripting Attack Us-
ing Machine Learning Algorithms. Proceedings of the 2014 International Confe-
rence on Interdisciplinary Advances in Applied Computing, Amritapuri, October
2014, Article No. 55. https://doi.org/10.1145/2660859.2660969
[64] Rocha, T.S. and Souto, E. (2014) ETSSDetector: A Tool to Automatically Detect
Cross-Site Scripting Vulnerabilities. 2014 IEEE 13th International Symposium on
Network Computing and Applications, Cambridge, 21-23 August 2014, 306-309.
https://doi.org/10.1109/NCA.2014.53
[65] Khan, N., Abdullah, J. and Khan, A.S. (2015) Towards Vulnerability Prevention
Model for Web Browser Using Interceptor Approach. 2015 9th International Con-
ference on IT in Asia (CITA), Sarawak, 4-5 August 2015, 1-5.
https://doi.org/10.1109/CITA.2015.7349842
[66] Ruse, M.E. and Basu, S. (2013) Detecting Cross-Site Scripting Vulnerability Using
Appendix
A. Proxy-Based XSS prevention techniques
Advantages Disadvantages
[47] presents a research paper in which the authors proposed that XSS attacks can be
identified by investigating the implementation flow of an AJAX application. The
JavaScript code is inspected on the browser side at the very beginning in order to This method is ineffective against
generate a finite state machine for the typical mode of operation of the applications. XSS attacks based on the Document
The scripts that are encoded in the response web page are then monitored by this Object Model.
machine in conjunction with a proxy. Malicious flow and XSS attacks can take place if
the machine’s execution path does not match the machine’s finite state machine.
IPAAS is an input validation approach proposed by the authors [48]. After first
interfering with the page containing the answer and retrieving all of the parameters, it
then analyzes the context of those parameters. This leads to the development of input The IPAAS parameter extractor may
validation policies, which are subsequently applied to every page of reappearance on be unable to parse parameter
the internet for examination. If the requirements are not satisfied, the request will be key-value pairs in this approach.
denied; in any other case, it will not be. Failures in type learning are possible when
bespoke query string formats are used.
The authors [49] proposed that this strategy employs the use of dynamic analysis of
Performing its functions, however,
JavaScript code that is embedded within a web page. By using this method, an abstract
incurs significant performance
syntax tree will be constructed for the internal representation of JavaScript code.
overhead and requires a substantial
Following that, the tree is transferred to the taint engine, which analyzes the JS code to
amount of processing time.
determine whether or not it attempts to access the private data.
The researchers [51] proposed that DOM-based XSS attack can no longer be carried Exploits are reported to the client
out using this technique, thanks to its robustness. Taint tracking and exploit reporting after all vulnerabilities have been
are the foundations of this strategy. To a large extent, it gets rid of the JavaScript code discovered. In terms of security, it
that can’t be trusted and then examines it on its own, following its execution flow, to does not guard against non-scripting
determine whether or not it has been contaminated. It generates XSS test payloads code and has a negative impact on
based on the log information it receives. performance.
Table A2. Advantages and disadvantages of machine learning XSS defensive techniques.
Advantages Disadvantages
The researchers [52] proposed a data mining and static analysis approach for
This approach cannot adequately
eliminating XSS vulnerabilities. The approach seeks to discover and eliminate
prevent XSS against mXSS and
harmful links from the source code. Their technique outperforms the upgraded
DOM-based cross-site scripting (XSS)
ngram model. Following a discussion of the subclasses of XSS attacks,
attacks.
the paper briefly addresses the risks and concerns posed by XSS.
Continued
The researchers [54] proposed a method for preventing cross-site scripting that utilizes For XSS assaults, it has not been
ANN-Multilayer Perceptron in conjunction with dynamic feature extraction. When tested on actual web applications
compared to other machine-learning algorithms, this strategy outperforms others. that are used in the world today.
The researchers [56] Proposed a hybrid solution for preventing XSS in web
applications. They claim that their method is the first of its kind since it blends a This strategy has not been put through
metaheuristic algorithm (the Genetic Algorithm) with a framework for machine any kind of proof-of-concept testing
learning. This combination distinguishes their methodology. They used a threat on real-world mission-critical web
intelligence model and reinforcement learning in addition to GA and statistical applications.
inference to protect them from XSS attacks.
The authors [57] presented RLXSS, a method for detecting cross-site scripting attacks
dependent on reinforcement learning, and uses both adversarial and retraining
This approach cannot work against
models. This method made use of XSS detection technologies like SafeDog and
mXSS attack that usually employs
XSSChop in addition to DDQN (dueling deep Q networks), an escape technique,
filter-safe payloads and mutate them
and a reward mechanism. The adversarial samples that were obtained from the
into insecure payloads after filtration.
adversarial model were included in the retraining model so that optimization
could be performed on them.
The authors [58] proposed a deep learning approach to the Cross-site scripting
identification in which the original data is first decoded, and then the word2vec
algorithm is used to acquire information regarding the qualities of XSS payloads. This approach is ineffective against
The input is then placed into a Model of the LSTM neural network. Cross-validation DOM-based XSS attacks.
of the tenfold test is utilized in the last step of this analysis to see how well the
proposed method compares to the ADTree and AdaBoost methods.
The authors [59] proposed a supervised machine learning method for detecting
potentially hazardous links before they execute on the victim’s computer. Their
solution makes use of a Linear Support Vector Machine classifier to detect blind XSS
This approach is entirely limited to
attacks and differentiate between the primary characteristics of reflected and stored
handling DOM-base and mXSS
XSS attacks. JavaScript events were run during the features extraction process,
attacks.
which attackers use to inject malicious payloads. For testing purposes,
a linearly separable dataset was used. Mutillidae, a free vulnerable website,
was used to mimic a blind XSS attack.
Advantages Disadvantages
The researchers [61] have proposed a method for detecting DOM-based XSS This method is ineffective against
attacks that employ dynamic taint tracking and context-sensitive sanitization. stored XSS attacks.
The researchers [64] proposed a method that operates by imitating the browser’s
behavior. It interacts with the website in issue and detects any potentially risky This approach cannot identify
places before injecting a payload for testing the system’s level of security. DOM-based XSS attacks.
If the code executes, It is vulnerable to XSS attacks.
Advantages Disadvantages
This method [66], according to the researchers, is intended for JSP-based web-related Since this method relies on jCute
applications and is a jCute concolic testing. They employ static analysis and real-time concolic testing, output variables with
monitoring. When an XSS attack is attempted, it helps to establish the relationship more than three of the characters
between input and output values that facilitate the attack. cannot be recognized.
The researchers [67] proposed that in addition to being able to detect XSS attack
In this method, HTML5 tags and
vectors constructed utilizing new HTML5 features, this approach is targeted for
attributes are the sole attack vectors it
webmail applications. Five injection points in the webmail system are used to inject
considers, ignoring other potentially
attack vectors for the purpose of testing. As the last step, it is determined whether or
dangerous circumstances.
not an attack vector was thoroughly sanitized.
In [68], the authors have taken precautionary measures against XSS attacks by In order to use this method, sanitized
employing static analysis, pattern matching, and context-aware sanitization code must be manually entered
techniques. into the website.
Continued
The researchers [69] who conducted the study hypothesized that fuzz testing activates
This would necessitate an application
XSS vulnerabilities. Fuzz testing is a black-box detection method that makes use of
reset for live applications, which is not
malicious payload injection into web applications. It’s more accurate to think of it as a
an option. Additionally, human
two-step extension of the LigRE model: first, the production of malicious input, and
interpretation is essential to the
then the taint analysis in order to find the vulnerability. For instance, it avoids a
process of developing attack vectors.
cross-site scripting attack that is stored as well as reflected.
In [70] script characteristics can be used to detect malicious script injection, according
Partially injected scripts and
to the authors. These features are taken and then evaluated to see how they are used to
obfuscated script injection are
create harmful scripts in this case. Once the malicious script and benign script are
ineffective with this strategy.
detected, they can be utilized to identify an XSS attack and prevent further damage.
In [71] Django Checker is a dynamic taint analysis tool proposed by the authors. This
method determines whether the primitives of the sanitizers that are already in use in This technique is limited to
the web application are proper. It also determines the context in which these attributes Django-based web applications and
are used and assesses the appropriateness of implementing sanitization. It determines cannot detect DOM-based XSS attacks.
whether or not sanitization is context-sensitive.
Advantages Disadvantages
The researchers [73] have presented defensive strategies against DOM-based XSS
attacks. Under normal circumstances, the DOM tree is constructed, scripting nodes
This technique may block the
are extracted, and a whitelist is created for future use. The DOM tree is generated for
execution of harmless JavaScript code
malicious websites, and the nodes of the DOM tree are parsed for injected script code.
if the whitelist is not matched.
Any differences found between the whitelist and the XSS attack are viewed as
suspicious compared to each other.
The researchers [74] proposed the usage of a client-server model to ensure the This method, which needs
integrity of the document structure. This approach uses combined runtime tracking modifications on both the client and
and randomization to prevent XSS attacks. As a result of this method, harmful data the server, is unusable in preventing a
cannot affect web application content by manipulating the document structure. DOM-based XSS attack.
Continued
The researchers [76] have proposed a new approach to data cleaning using
This technique does not defend
context-sensitive sanitization. Here, the server-side and client-side contexts are
against malicious script code
determined statically and dynamically. After this, sanitizers’ primitives are applied to
obtained from a third party.
the vulnerable variable in accordance with its context.