Testing for reflected XSS
The XSS vulnerability is one of the most common web application injection attacks. This attack falls into number 3 in the OWASP Top 10:2021 – Injection category. XSS tricks the user’s browser into running malicious JavaScript code that an attacker has crafted to steal a user’s sensitive information, such as session cookies or passwords. In some cases, the attacker could take over the entire application if the session information of an administrator account were to be compromised. XSS attacks are possible in any application that uses input data from a user to produce an output. There are multiple XSS vulnerability types: Reflected XSS, Stored XSS, and DOM XSS. DOM XSS will be discussed in Chapter 9, Client-Side Testing.
In this recipe, we will attack the OWASP Juice Shop application with a Reflected XSS payload and intercept the traffic using ZAP to manipulate the request and see the attack reflected, back in the browser.