{"id":192,"date":"2021-11-14T17:26:18","date_gmt":"2021-11-14T17:26:18","guid":{"rendered":"https:\/\/www.davincivirus.com\/?p=192"},"modified":"2021-11-14T17:26:18","modified_gmt":"2021-11-14T17:26:18","slug":"cross-site-scripting","status":"publish","type":"post","link":"https:\/\/www.davincivirus.com\/?p=192","title":{"rendered":"Cross Site Scripting"},"content":{"rendered":"\n<p>Cross Site Scripting (XSS) will allow an attacker\u2019s malformed parameter to manipulate the anticipated functionality of the web application. This is usually performed via modifying underlying HTML or JavaScript. The most common XSS attack vector results in malicious JavaScript running on a client\u2019s browser within the scope of the vulnerable web application. Attackers attempt to levy this initial foothold to: steal session data, compromise sensitive information from either the site or browser, or run exploits against the end user\u2019s client system.<\/p>\n\n\n\n<h2>Exploitation<\/h2>\n\n\n\n<p> A &#8220;textbook&#8221; XSS attack can be demonstrated stealing random user session IDs (SIDs) visiting a blog.  A malformed comment value is provided by the attacker containing JavaScript.  Once rendered, the Javascript transmits a SID to an attacker controlled endpoint.  <\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><img loading=\"lazy\" width=\"1024\" height=\"406\" src=\"https:\/\/www.davincivirus.com\/wp-content\/uploads\/2021\/11\/xss_flowchart-1024x406.jpg\" alt=\"\" class=\"wp-image-193\" srcset=\"https:\/\/www.davincivirus.com\/wp-content\/uploads\/2021\/11\/xss_flowchart-1024x406.jpg 1024w, https:\/\/www.davincivirus.com\/wp-content\/uploads\/2021\/11\/xss_flowchart-300x119.jpg 300w, https:\/\/www.davincivirus.com\/wp-content\/uploads\/2021\/11\/xss_flowchart-768x305.jpg 768w, https:\/\/www.davincivirus.com\/wp-content\/uploads\/2021\/11\/xss_flowchart.jpg 1358w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>XSS exploitation usually necessitates overcoming multiple site-specific technical challenges.  Its rarely this simplistic.<\/p>\n\n\n\n<h2>Remediation<\/h2>\n\n\n\n<p>XSS is best prevented by a combination of input validation and output encoding.  Functionality to automate this safeguard is available within most modern frameworks\/languages; such as the ASP.Net AntiXssEncoder. <\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-style-default\"><img loading=\"lazy\" width=\"472\" height=\"60\" src=\"https:\/\/www.davincivirus.com\/wp-content\/uploads\/2021\/11\/XXS_encoding-1.jpg\" alt=\"\" class=\"wp-image-195\" srcset=\"https:\/\/www.davincivirus.com\/wp-content\/uploads\/2021\/11\/XXS_encoding-1.jpg 472w, https:\/\/www.davincivirus.com\/wp-content\/uploads\/2021\/11\/XXS_encoding-1-300x38.jpg 300w\" sizes=\"(max-width: 472px) 100vw, 472px\" \/><\/figure>\n\n\n\n<p>Other security mechanisms are constantly evolving to outmaneuver prevalent XSS techniques.  For example, the &#8220;HTTP-ONLY&#8221; parameter prevents JavaScript from accessing a SID. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Cross Site Scripting (XSS) will allow an attacker\u2019s malformed parameter to manipulate the anticipated functionality of the web application. This&hellip; <a class=\"read-more\" href=\"https:\/\/www.davincivirus.com\/?p=192\">Continue Reading<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[9],"tags":[],"_links":{"self":[{"href":"https:\/\/www.davincivirus.com\/index.php?rest_route=\/wp\/v2\/posts\/192"}],"collection":[{"href":"https:\/\/www.davincivirus.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.davincivirus.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.davincivirus.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.davincivirus.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=192"}],"version-history":[{"count":1,"href":"https:\/\/www.davincivirus.com\/index.php?rest_route=\/wp\/v2\/posts\/192\/revisions"}],"predecessor-version":[{"id":196,"href":"https:\/\/www.davincivirus.com\/index.php?rest_route=\/wp\/v2\/posts\/192\/revisions\/196"}],"wp:attachment":[{"href":"https:\/\/www.davincivirus.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=192"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.davincivirus.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=192"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.davincivirus.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=192"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}