{"id":46997,"date":"2017-03-22T17:25:58","date_gmt":"2017-03-22T11:55:58","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=46997"},"modified":"2017-03-22T17:33:20","modified_gmt":"2017-03-22T12:03:20","slug":"xss-cross-site-scripting-blog-series-i-blog-1-overview-vulnerabilities-and-types-of-attacks","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/xss-cross-site-scripting-blog-series-i-blog-1-overview-vulnerabilities-and-types-of-attacks\/","title":{"rendered":"XSS (Cross Site Scripting) Blog Series I Blog 1: Overview, Vulnerabilities and Types of Attacks"},"content":{"rendered":"<p>Have you witnessed a scenario where a trusted site gets injected with a malicious script attack? Well, commonly people refer this as a &#8220;&#8216;Cross Site Scripting&#8217; attack. The XSS scripts injected into a site can leak out sensitive data and information including cookies, session tokens, and auth tokens. The vulnerability of the XSS attack is very frequent but hard to patch.<\/p>\n<p><strong>How does XSS work?<\/strong><\/p>\n<p>On a web page, we generally interact with input boxes however, there are text areas that act as the document objects. They take\u00a0input from the\u00a0users and these are easily vulnerable.<\/p>\n<p>An XSS attack can execute malicious script anywhere in the web app. Here&#8217;s a quick example<\/p>\n<p>1.<b>An Input Value:<\/b><\/p>\n<p>[code]&lt;input type=\u201d&lt;script&gt; window.alert(\u201cMalicious Script injected!!!!\u201d) &lt;\/script&gt;\u201d &gt; [\/code]<\/p>\n<p>2.\u00a0<b>An attribute of HTML tag:<\/b><\/p>\n<p>[code]&lt;iframe src=\u201d&lt;script&gt; window.alert(\u201cMalicious Script injected!!!!\u201d) &lt;\/script&gt;\u201d&gt; &lt;\/iframe[\/code]<\/p>\n<p>3.\u00a0<b>An event binding on HTML tag:<\/b><\/p>\n<p>[code]&lt;div onmousehover=\u201d&lt;script&gt; window.alert(\u201cMalicious Script injected!!!!\u201d) &lt;\/script&gt;\u201d&gt; &lt;\/div&gt;[\/code]<\/p>\n<p><strong>There are majorly three types of XSS attacks:<\/strong><\/p>\n<p><strong>&#8211; Non-persistent XSS:<\/strong>\u00a0Such an attack is normally prevalent where an\u00a0input\u00a0is accepted without any validation. In such a scenario, a script is sent as a request in an input and this is then shown as a response on the web page.<\/p>\n<p><strong>&#8211; Persistent XSS:<\/strong>\u00a0In such an attack a script is sent as data and stored in the database. The script is executed when the user runs the application.<\/p>\n<p><strong>&#8211; DOM based or (TYPE-0) XSS:<\/strong>\u00a0DOM based XSS only executes on the client side and not the server side. This is the most advanced and least-known types of XSS.<\/p>\n<h2 style=\"text-align: center\"><span style=\"color: #333399\">Xss Attack Model<\/span><\/h2>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-47049 aligncenter\" src=\"\/blog\/wp-ttn-blog\/uploads\/2017\/03\/how-xss-works-910x404.png\" alt=\"how-xss-works-910x404\" width=\"910\" height=\"404\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2017\/03\/how-xss-works-910x404.png 910w, \/blog\/wp-ttn-blog\/uploads\/2017\/03\/how-xss-works-910x404-300x133.png 300w, \/blog\/wp-ttn-blog\/uploads\/2017\/03\/how-xss-works-910x404-624x277.png 624w\" sizes=\"(max-width: 910px) 100vw, 910px\" \/><\/p>\n<p>Our this blog is a series wherein the first blog aims to give you an overview of XSS attack so that you can keep your application secure from XSS attacks. Our second blog will be a continuation from this blog and it will detail out an entire list of XSS preventions. Watch out our blog page for more updates.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Have you witnessed a scenario where a trusted site gets injected with a malicious script attack? Well, commonly people refer this as a &#8220;&#8216;Cross Site Scripting&#8217; attack. The XSS scripts injected into a site can leak out sensitive data and information including cookies, session tokens, and auth tokens. The vulnerability of the XSS attack is [&hellip;]<\/p>\n","protected":false},"author":904,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":10},"categories":[2026,3917,1994,1],"tags":[4513,227,4511,4512],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/46997"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/904"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=46997"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/46997\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=46997"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=46997"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=46997"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}