Skip to content

Latest commit

 

History

History
58 lines (35 loc) · 2.14 KB

README.md

File metadata and controls

58 lines (35 loc) · 2.14 KB

Cross Site Scripting (XSS)

This term defines a type of attack where malicious scripts can be injected into websites. Generally speaking, XSS occurs when a user sends malicious code, in most cases browser side scripts, to a different end user.

In Unguard, XSS can be exploited by inserting a script as your own bio. The embedded script only will be executed for other users visiting your profile. If you are on your own page, the textbox with your code will be visible.

Preconditions and Requirements

For this exploit to work you need:

Exploitation

To perform Cross Site Scripting, you need to be logged in and write valid HTML code into your bio. To see it actually working, you need to access the profile page of your first user while logged in with another one.

w/o Toolkit CLI

To access the textbox you need to login and then access your profile by clicking the username in the top right corner, then you need to click on Profile and there you can type a bio into the textbox.

Example:

<button onclick="alert(`xss`)">Click me</button>

An important note: Rather than 'xss', the text of the alert is inside backticks: `xss`. The reason for this is that with single quotation marks, there would be a syntax error in the SQL statement and the attack wouldn't work. However, it is also possible to escape the single quotes differently, i.e. by using two of them:

<button onclick="alert(''xss'')">Click me</button>

In this example, you are logged in as simuser_1. If you add the above text as your bio and another user (in this case simuser_2) views your profile page, they will see the following:

Viewed by simuser_1

When clicking the bio, which in this case a button, an alert will appear, as per the onclick function:

simuser_2 clicks button

Meanwhile, when viewing your own profile, you'll still be able to edit the bio as the button is not visible:

View from simuser_1

Further Details