XSS
What is XSS (cross site scripting) ?
Cross site scripting or XSS has consistency been ranked as one of the top of 10 threats a web application security project .In short XSS happens when attacker can inject something in to your website that you don’t want to be there.
Imagine a comment or reviews section on your site where costumer or visitor can leave their own remark. They are supposed to type a nice message in to field which will their be saved and shown on your website to other visitor. What if they type something else in there. What if they type malicious code in the field.
Basic example of xss.
<script>alert(xss)</script>
.Types of xss
1.reflected xss.
2.stored xss.
3.dom xss.
1. Reflected xss : Reflected xss occurs when user input is immediately returned by a web application in an error message search result , or any other response that include some or all of the input provided by the user part of the request ,without that data being being made safe to render in the browser ,and without permanently storing the user provided data.in some cases , the user provided data may never even leave the browser .
2. Stored xss : To successfully execute a stored xss attack a perpetrate has to locate a vulnerability in a web application and then inject malicious script into its server.
One of the most frequent target are websites that allow user to share content , including blogs, social networks ,video sharing platform and message board. Every time the injected page is viewed, the malicious script is transmitted to the victim browser.
3. Dom xss : Dom base xss is a form of xss where the entire tainted data flow from source to sink take place in the browser. The source of the data is in the dom, the sink is also in the dom , and the flow never leaves the browser. The source could be the URL of the page or it could be an element of the html and the sink is a sensitive method call that causes the execution of the malicious data.
Types of cross site scripting the research of two new term to help organize the types of xss that can occur=
.server xss
.client xss
Server xss :-
Server xss occurs when entrusted user supplied data is included in an html response generated by the server. The source of the data could be from of the request, or from a stored location. As such you can have both reflected server xss and stored server xss.
In this case the entire vulnerability is in server-side code and the browser is simply rendering the response and executing and valid script embedded in it.
Client xss : Client xss occur when entrusted user supplied data is used to update the DOM with an unsafe JavaScript call is considered unsafe if it can be used to introduce valid JavaScript in to the dom . this source of this data could be form the DOM or it could have been sent by the server . the ultimate source of the data could have been from the request or from a stored location on the client or the server. As such you can have both reflected client xss and stored client xss.
Written By : Rohit Jolly
Very useful info.
Thank you Deepak for sharing