Repository navigation
Cross Site Scripting (XSS)
What is XSS ? XSS, also known as cross site scripting, is when a user can type Javascript or whatever code your website is using, inside a text field or any html form field, and execute malicious code, such as stealing your Json token and log in as you. the attacker could also use one of his own websites to execute malicious code into your website, this is done using something like an image tag in html
the hacker could do this for example
<img src="https://yourwebsite.com/users/1/destroy>
and if your website is not protected against these types of attacks, then the hacker will have successfully removed the user 1 from your web application in less than 30 seconds. Let's assume this hacker was a newbie. Now, imagine if the hacker would've been experienced, he could probably use different lines of codes to access even more private things, the hacker could even get to the edit section of the user profile, edit his password, and get all of his bank information if your app uses payment. a webapp becomes vulnerable to xss client-side code injection, whenever the app doesn't use a sanitizer to encrypt the user user input on a website, then the browser interprets that code as pure javascript and will then load the code everytime the page is loaded.
<script> tag a <script> tag can be extremelly dangerous, that means that the hacker could use a payload he wrote by himself, and use the <script> tag to attack your website with the script he wrote, if you know javascript, you'll know how easy it is, and how somebody with coding experience could make your website go down in less than 15 minutes.
JavaScript events JavaScript event attributes such as onload and onerror can be used in many different tags. This is a very popular XSS attack vector.
tag You can execute an xss payload using the
html tag combined with javascript together and you can execute payloads, delete things, etc.... tag
Some browsers execute JavaScript found in the
attributes.