Lets learn "XSS (Cross Site Scripting - A web application vulnerability"

 In this tutorial we'll learn about one of the most important web application vulnerability known as XSS (i.e Cross Site Scripting) . As the name says this vulnerability occurs when it is possible to run js segment be an user on site different from site of current user .

We'll study two types of XSS
  • Reflected XSS
  • Stored XSS
Reflected XSS

Reflected cross-site scripting vulnerabilities arise when data is copied from a request and echoed into the application's immediate response in an unsafe way. An attacker can use the vulnerability to construct a request that, if issued by another application user, will cause JavaScript code supplied by the attacker to execute within the user's browser in the context of that user's session with the application.
The attacker-supplied code can perform a wide variety of actions, such as stealing the victim's session token or login credentials, performing arbitrary actions on the victim's behalf, and logging their keystrokes.
Users can be induced to issue the attacker's crafted request in various ways. For example, the attacker can send a victim a link containing a malicious URL in an email or instant message. They can submit the link to popular web sites that allow content authoring, for example in blog comments. And they can create an innocuous looking web site that causes anyone viewing it to make arbitrary cross-domain requests to the vulnerable application (using either the GET or the POST method).
The security impact of cross-site scripting vulnerabilities is dependent upon the nature of the vulnerable application, the kinds of data and functionality that it contains, and the other applications that belong to the same domain and organization. If the application is used only to display non-sensitive public content, with no authentication or access control functionality, then a cross-site scripting flaw may be considered low risk. However, if the same application resides on a domain that can access cookies for other more security-critical applications, then the vulnerability could be used to attack those other applications, and so may be considered high risk. Similarly, if the organization that owns the application is a likely target for phishing attacks, then the vulnerability could be leveraged to lend credibility to such attacks, by injecting Trojan functionality into the vulnerable application and exploiting users' trust in the organization in order to capture credentials for other applications that it owns. In many kinds of application, such as those providing online banking functionality, cross-site scripting should always be considered high risk.

Stored XSS

Stored XSS arise if hacker is able to store some js segment(harmful) which is accessed by all the user . So when the users access the page that contains that vulnerable js segment , then that js segment runs on client side and perform its action like sending session cookies (If you are not familiar with the HTTP cookies , I reccomend you to first visit here ) to the hacker's email . Let us understand this by a simple example .
e.g : Any e-commerce website allows the user to give reviews about their products where users are allowed to give ratings to the products and some messages about the product . Now if in case Stored XSS is there in this web application (reviews and ratings) so hacker can submit a review that contains the js-segment (that access the cookies using document.write and send that cookies to the hacker's email id ) , Now when any user load that review page , the js segment run and send the session details of the user to the hacker and once hacker get the session details of any user , he can login his account on its own PC .

Comments

Popular posts from this blog

Lets learn "About kube proxy in iptables mode"

Lets learn "System design for paste bin (or any text sharing website)"

Lets learn "Factory design pattern"