T 5.170 Cross-Site Scripting (XSS)

Cross-Site Scripting attacks (XSS attacks) are directed against the user of a web application and their clients. Here, an attacker tries to send malicious code (usually scripts such as JavaScript that can be run on the browser side) indirectly to the client of the user of the web application.

If the input and output data of a web application are not validated adequately, then an attacker can smuggle in malicious code into the web application (e.g. within a comment to an item) and so spread it. If an infected website is called up by the user, the client (for example, browser) executes the inserted malicious code. From the user's perspective, the malicious code comes from the web application and is thus classified as trustworthy. Therefore, the malicious code is interpreted within the security context of the web application and the attacker is able to execute commands within the context of a possibly existing session of the affected user.

There are three classes of XXS attacks:

The following examples illustrate the differences between the attack classes: