XSS occurs when an attacker is able to inject a script, usually Javascript, into the output of a web application so that it runs in the client’s browser. The attacks are mainly caused by incorrectly validating user data, and are usually injected through a web form or through an altered link. In fact, these are one of the most frequent vulnerabilities in web applications. According to the OWASP Top 10, this vulnerability is found in around two-thirds (2/3) of all applications. XSS attacks are a type of injection in which an attacker manages to execute code in the browsers of users accessing a legitimate website.

The criticality of these vulnerabilities depends on the type of XSS and the information stored on the web page. We can generally talk about 3 types of XSS Attacks:

▸XSS Mirrored

The application uses raw data, supplied by a user and encoded as part of the output HTML or JavaScript. An example of this type of XSS could be, if when entering JavaScript code in the search engine of a page.

▸XSS Stored

The application stores data provided by the user without validating or sanitizing, which are later viewed by another user or an administrator.

▸DOM-based XSS

The application processes user-controllable data in an insecure way. Similar to Reflected XSS, an example of this attack would be if we write JavaScript code in the URL and the web has a script that adds the URL without sanitizing as part of the HTML.

As easy as an attacker can attack an unprotected website against Cross-Site Scripting attacks, a developer can defend against them. Prevention must always be taken into account even before writing the code itself.

The most basic rule or policy to always keep in mind is simple: NEVER trust data that comes from users or any other external source. Any data must be validated or escaped for its output. The measures to be taken can be divided into three: data validation, data sanitization and output escaping.

More reads:
Cyber attack on JBS – Giant meat company on the aim
RowHammer Threat Attacks Ram and GPU


Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *