WEBVTT

00:00.490 --> 00:07.720
Cross site scripting is a web application vulnerability that permits an attacker to inject code typically

00:07.770 --> 00:12.410
HDMI or JavaScript into the content of an outside Web site.

00:12.910 --> 00:19.390
When a victim views an infected page on this Web site the injected code will automatically executes

00:19.420 --> 00:20.620
on the victim's browser.

00:20.950 --> 00:27.970
Thus the attacker will be able to steal private information from the victim associated with the Web

00:27.970 --> 00:28.240
site.

00:28.630 --> 00:35.140
So here the point is that the victim trusts the web application which is in legitimate web application

00:35.470 --> 00:43.770
but it's a vulnerable one and the attacker will inject this malicious code in order to exploit this

00:43.770 --> 00:44.730
trust.

00:44.740 --> 00:51.820
We have two types or mainly two types of course I scripting deflected which is known to be non persistent

00:51.850 --> 00:54.890
and stored which is known to be persistent.

00:55.030 --> 01:01.960
The reflected one actually occurs when a malicious script is deflected off a web application to the

01:01.960 --> 01:02.990
victims of browser.

01:03.220 --> 01:11.020
So the person here or the vulnerability actually takes place on the web browser and not on the application

01:11.020 --> 01:11.700
itself.

01:11.710 --> 01:13.830
The application is only vulnerable.

01:13.870 --> 01:20.590
The script is activated through a link which sends a request to a Web site with a vulnerability that

01:20.620 --> 01:23.810
enables the execution of a malicious script.

01:23.830 --> 01:31.090
The vulnerability is typically a result of incoming requests not being sufficiently sanitized by the

01:31.160 --> 01:38.980
website which allows for the manipulation of Web applications functions and activation of the malicious

01:38.980 --> 01:39.940
script.

01:39.940 --> 01:47.140
So here the issue is in the vulnerability of the Web site which allows an attacker to exploit this in

01:47.140 --> 01:54.760
order to execute external scripts on the victims browser to distribute the malicious link.

01:54.760 --> 02:02.560
The perpetrator typically embeds it into an email or a third party website such as comments on some

02:02.560 --> 02:04.480
of the social media sections.

02:04.480 --> 02:11.500
The link is embedded inside an anchor text that provokes the user to click on it.

02:11.500 --> 02:17.180
Once the click happens the attack is executed or recall it.

02:17.170 --> 02:19.660
It reflects off to the user.

02:19.660 --> 02:23.990
The second type is this toward attack or stored cross site scripting.

02:24.190 --> 02:32.020
It's known to be persistent and it is more damaging than the reflected one because it occurs when a

02:32.020 --> 02:38.100
militia script is injected permanently into a vulnerable web application.

02:38.110 --> 02:44.710
This injection takes place when there is a place to write when there is a place for user input such

02:44.740 --> 02:51.260
as weakness or such as comments or such as comments and the discussion forums.

02:51.280 --> 03:00.220
The impact of course such scripting is moderate for the reflected one but severe for the stored type

03:00.760 --> 03:01.540
in Cali.

03:01.540 --> 03:09.280
We have many automated tools that can help us find cross site scripting problems automatically in our

03:09.280 --> 03:10.710
web applications.

03:10.720 --> 03:15.250
Let's take an example here for it afflicted access as attack.

03:15.250 --> 03:24.850
First the attacker will send an evil email to the victim after identifying that this domain is vulnerable

03:24.850 --> 03:26.550
to cross site scripting.

03:26.590 --> 03:33.510
So this is a legitimate domain but he attached a javascript file to it.

03:33.520 --> 03:41.560
Using this link the victim receives this link through email and once he presses on the link the vulnerable

03:41.560 --> 03:47.800
bank application takes data and includes it in a valid web page.

03:47.820 --> 03:56.680
Now the victim browser thrusts the script from this domain and the attacker has full access to the victim's

03:56.770 --> 03:57.460
accounts.

03:57.490 --> 04:05.290
The next type of attack is the stored one where the perpetrator discovers a Web site that has a vulnerability

04:05.680 --> 04:14.200
and will inject the script directly into the Web site or in the database through the front end.

04:14.200 --> 04:16.600
Next the perpetrator injects.

04:16.600 --> 04:23.770
As we said the script that is key now for each visit to the Web site.

04:23.800 --> 04:32.330
The malicious script is activated automatically maybe on load and the attacker will have access to the

04:32.330 --> 04:35.370
session cookies of the visitor.

04:35.440 --> 04:39.620
Now help to protect ourselves from these types of attacks.

04:39.640 --> 04:46.450
The most important thing is to use frameworks that automatically escape the cross site scripting by

04:46.450 --> 04:55.920
design such as using the latest Dot Net framework the latest Ruby on Rails the latest react as etc..

04:56.020 --> 05:01.230
It is also recommended to filter and sanitize input as much as possible.

05:01.380 --> 05:09.030
It is also recommended to filter output or encode output in order to escape the characters that might

05:09.030 --> 05:14.650
be used for coarse site scripting by using base64 encoding for example.

05:14.850 --> 05:24.060
And it's advisable to enable the content security policy which is a defense in the mitigating control

05:24.420 --> 05:26.130
against cross site scripting.
