What is XSS?

There are billions of websites on the internet, and one of the most common vulnerabilities found in websites is Cross Site Scripting (XSS). XSS vulnerabilities can occur when user input is not properly sanitized which can allow an attacker change the webpages markup. Someone can achieve XSS from POST or GET requests. There are three types of XSS, but today we will be focusing on these two types: Reflected XSS and Persistent XSS.

Reflected XSS

Reflected XSS is when the XSS comes from a users request. For example, clicking on a link with a malicious GET request can cause the person that clicked on the link to have cookies or other personal data stolen.

You can test for possible XSS in urls by trying to put some html in the url like this: ?xss=<h1>Test</h1> or ?xss="><h1>Test</h1>, but sometimes the website will try to escape the XSS inefficiently, luckily OWASP has posted a large list of things to try to get reflected XSS. You can access that here: https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet. You can practice this here: reflected XSS

Persistent XSS

Persistent XSS is when the XSS is stored in the web-page, without needing to have a link with a specifically crafted get request. This could commonly be found in unescaped blogs or chats. If an attacker injected malicious javascript to a blog and another blog member went to check the blog, the member could have their information stolen. You can test for Persistent XSS on our site. To delete any current payloads inside of the Persistent XSS sandbox click this. To go to the Persistent XSS sandbox click here.