WEBVTT

00:10.070 --> 00:12.050
Good morning, everyone.

00:12.350 --> 00:17.430
I am very honored to be able to be on the DevCon stage today.

00:17.730 --> 00:20.050
Maybe you can feel it.

00:20.050 --> 00:32.850
Just like when I first participated in DevCon many years ago, I felt that the style and culture of DevCon was very different from the academic meetings I used to attend, especially the academic meetings I attended in China.

00:32.850 --> 00:40.350
For example, there was no leadership instructions, and there was no academic support.

00:41.770 --> 00:52.770
So I mentioned in the opening video of DevCon that we really hope that DevCon can bring some new culture and ideas to China.

00:53.370 --> 00:58.470
You have also seen the translation next to it in the past two days.

00:58.470 --> 01:00.690
Of course, I did this translation myself.

01:02.970 --> 01:08.290
Our foreign speakers, their PPTs, are some of the volunteers I organized.

01:08.290 --> 01:11.290
Mainly some of our PhD students did some translation.

01:11.290 --> 01:14.870
One of the PhD students sent me his own feelings.

01:14.870 --> 01:19.970
I think at this point, we, DevCon China, have already done it.

01:21.550 --> 01:28.590
In the past few days, he has already experienced what it means to be a hacker in the process of communicating with foreign speakers.

01:28.590 --> 01:38.870
It is probably the curiosity and passion for technology, the yearning for freedom, and the pursuit of perfection.

01:39.450 --> 01:46.890
From this point of view, I think DevCon China has really achieved the integration of the hacker spirit and Chinese culture.

01:47.990 --> 01:54.390
Today, I mainly want to share with you some of the research we have done recently.

01:56.270 --> 01:59.570
From the outside, attacking the inside.

01:59.570 --> 02:13.310
Here, we mainly use the latest or already widely accepted standard It is called cross-domain, cross-domain resource sharing.

02:13.450 --> 02:18.190
The main work is done by my PhD student, Chen Jianjun.

02:18.190 --> 02:28.810
But in fact, there is also a cooperation from other units, including Jiang Jian from SIP Security, also a former student of mine, Dr.

02:28.810 --> 02:32.290
Wan Tao from Huawei Jiangda, Dr.

02:32.290 --> 02:38.130
Chen Shuo from Microsoft, Professor Warren Paxson from UC Berkeley, and Professor Yang Ming from Fudan University.

02:38.450 --> 02:43.710
Our work will be published in August this year.

02:44.110 --> 02:46.230
What is this specific work?

02:46.270 --> 02:48.980
Let's take a look at the current attack scene.

02:50.380 --> 02:57.780
The attackers' attacks on the internet are usually made by firewalls.

02:57.880 --> 03:02.900
Even a simple address conversion can make such an attack impossible.

03:03.760 --> 03:11.160
A very intuitive idea is whether it is possible to attack through the web.

03:12.300 --> 03:16.060
For example, right-wing users click on a website.

03:16.060 --> 03:17.920
This is a website attacked by hackers.

03:17.920 --> 03:24.260
Then through JavaScript, the attacker's script is loaded into the user's browser.

03:24.260 --> 03:27.380
Then the user's browser attacks the internet.

03:32.410 --> 03:37.510
Of course, if you are familiar with web security, you may be very clear.

03:37.510 --> 03:42.030
Now, browsers have restrictions on cross-border resource visits.

03:42.250 --> 03:48.190
The most common strategy is SOP, which stands for Same-Origin Policy.

03:48.190 --> 04:00.010
In the general sense of SOP, we can imagine that it restricts cross-border visits.

04:00.010 --> 04:06.150
At least you can't read resources from other sources.

04:08.170 --> 04:15.630
But just like safety, performance, and functionality, they are often a pair of contradictions.

04:17.150 --> 04:22.990
In many cases, developers still need cross-border visits.

04:22.990 --> 04:26.070
So there are all kinds of ways to get around.

04:26.070 --> 04:30.090
One of them is JSON-P, which is more common in recent years.

04:30.090 --> 04:31.790
You may have heard of it.

04:31.790 --> 04:37.920
JSON-P makes it very convenient for developers, but it also brings a lot of problems.

04:38.330 --> 04:42.870
In recent years, it has become a standard.

04:42.870 --> 04:47.130
For example, cross-border resource sharing.

04:48.190 --> 04:53.270
Now mainstream browsers have achieved this standard.

04:53.270 --> 04:59.290
And most mainstream websites already have this feature.

05:00.010 --> 05:09.070
You can say that cross-border is a feature that provides managers with cross-border visits.

05:09.070 --> 05:15.310
At the same time, it protects the security of resource sharing.

05:16.010 --> 05:24.230
But in recent research, we found that it is not as safe as it was originally designed.

05:25.150 --> 05:49.690
Because of the cross-border feature, you can access internal resources through the browser, including creating a new file, deleting some files in your file server, and even getting a share on the internal web server.

05:51.810 --> 05:58.130
In the past, there were some loopholes blocked by firewalls in the internal network.

05:59.050 --> 06:01.150
For example, there was a loophole in Strikes 2.

06:01.150 --> 06:04.950
Even if there is such a loophole in the internal network, the attacker can't get in.

06:04.950 --> 06:10.250
But now, with cross-border, such an attack may become a reality.

06:13.870 --> 06:16.130
I am a professor at Tsinghua University.

06:17.050 --> 06:25.030
As a professor, Jason Street just mentioned, I only gave one corner of the truth.

06:25.030 --> 06:27.130
The remaining three corners...

06:27.130 --> 06:29.710
Let's welcome my student, Chen Jianjun.

06:29.710 --> 06:32.510
Chen Jianjun is a Ph.D.

06:32.510 --> 06:33.770
student at Tsinghua University.

06:35.390 --> 06:40.330
He is my first Ph.D.

06:40.330 --> 06:40.330
student.

06:40.570 --> 06:42.490
He is about to graduate.

06:42.490 --> 06:45.210
His next step is to go to Berkeley for a Ph.D.

06:46.070 --> 06:51.670
He has already achieved a great success in the four top universities in the academic circle.

06:53.530 --> 07:02.790
Today, let's welcome Chen Jianjun to share with us the research on the cross-border attack on the internal network.

07:03.130 --> 07:04.410
Jianjun.

07:10.520 --> 07:14.020
It is a great honor to be here at DEVCON.

07:14.220 --> 07:19.740
I would like to share with you the article that is about to be published on User-Lead Security.

07:20.400 --> 07:24.960
I will talk about the details in four aspects.

07:25.580 --> 07:29.860
First, I will talk about the background of the web and cross-border.

07:29.860 --> 07:33.020
Then, I will talk about the security issues of the three cores.

07:33.820 --> 07:37.240
Then, I will talk about the security situation of the cores in a real website.

07:39.140 --> 07:41.920
Finally, I will talk about how to defend against such issues.

07:42.160 --> 07:44.480
First, let's look at the background of the web.

07:44.980 --> 07:48.560
Since we are talking about the security of the web, let's talk about the synchronization strategy.

07:48.780 --> 07:51.060
The synchronization strategy defines a circle.

07:51.060 --> 07:54.520
It is composed of three groups, which are the protocol, domain name and port.

07:54.720 --> 08:01.760
Generally speaking, the synchronization strategy is that it is isolated from two different circles.

08:01.760 --> 08:04.980
One circle cannot operate the data of another circle.

08:04.980 --> 08:05.940
It cannot cross-circle.

08:06.900 --> 08:09.680
For example, A.com cannot operate the data of B.com.

08:10.340 --> 08:15.100
However, this is just a misunderstanding of DOM.

08:18.960 --> 08:21.500
SOP has different restrictions on different network resources.

08:21.500 --> 08:22.220
Let's look at the details.

08:22.220 --> 08:23.560
For example, in this place,

08:31.560 --> 08:38.040
A.com wants to send a request to B.com and read the resource response of B.com.

08:38.040 --> 08:40.720
How will the synchronization strategy restrict it?

08:41.240 --> 08:44.460
It is not that it cannot be visited at all.

08:44.620 --> 08:46.420
It can be sent.

08:46.420 --> 08:51.400
A.com can send a request to B.com, but it cannot read the response.

08:54.470 --> 08:55.290
Why do I say it is a misunderstanding of DOM?

08:55.290 --> 08:56.490
It can be sent.

08:58.020 --> 09:00.130
For example, here is a simple example.

09:00.130 --> 09:04.130
A.com's HTML file is automatically submitted to B.com.

09:04.430 --> 09:13.490
It can also automatically click on the form request and send the request to B.com.

09:13.490 --> 09:15.090
This is a POST request.

09:15.980 --> 09:18.010
What kind of harm does this bring?

09:18.450 --> 09:20.110
It brings two harms.

09:20.110 --> 09:21.830
The first one is the attack of CSRF.

09:22.830 --> 09:27.210
As mentioned in the previous report, you used the login CSRF attack on my account.

09:27.430 --> 09:29.610
Let's talk about the principle of the CSRF attack.

09:29.890 --> 09:37.290
First, the victim logged into his own bank website and set a KUKA in the browser.

09:38.970 --> 09:47.450
Second, when he logged into the bank and operated the bank website, he wanted to check the information and accidentally visited the attacker's website.

09:47.450 --> 09:54.250
However, due to the restriction of the synchronization strategy, even if he visited the attacker's website, he couldn't read the information directly from the DOM.

09:56.630 --> 09:58.330
This is the restriction of the synchronization strategy.

09:58.630 --> 10:00.890
However, the request is not restricted by the synchronization strategy.

10:02.050 --> 10:07.670
The attacker can send a POST request to the bank website through his own website, through the browser operated by JavaScript.

10:11.650 --> 10:15.370
In this request, KUKA is used.

10:15.370 --> 10:17.870
KUKA will be automatically added to each request.

10:17.870 --> 10:23.750
In this way, the user's KUKA is included in the POST request.

10:23.910 --> 10:35.160
Then, when the KUKA verifies the origin of the request through the bank website , he thinks that the request was done by the victim himself.

10:35.530 --> 10:41.450
So he executed this operation and transferred the bill to the attacker's account.

10:43.650 --> 10:47.770
The second type of attack is the HTML form protocol attack.

10:48.590 --> 10:57.970
This attack means that the attacker can use the victim's browser to cross-protocol attack.

10:57.970 --> 11:01.750
For example, he wants to attack an SMTP server, an email server.

11:03.130 --> 11:07.990
First, the victim accidentally clicked a link, right?

11:10.010 --> 11:15.110
Then, the JavaScript in this link sends a POST request to the user's browser.

11:15.930 --> 11:25.910
In this POST request, the attacker can construct the body of the request to construct some SMTP commands in it.

11:25.910 --> 11:37.710
In this process, due to the strong tolerance of many services, he will ignore the unknown commands and execute the SMTP commands he knows in it.

11:38.590 --> 11:46.590
In this way, he can use the user's browser to send an email to the email server.

11:49.450 --> 11:55.770
Maybe this email server is in the user's network and can cross-network and cross-protocol attack.

12:00.020 --> 12:04.720
As we mentioned earlier, SOP has two parts.

12:04.720 --> 12:06.000
One is cross-development.

12:06.080 --> 12:09.460
It can be allowed to send, but it can't be read.

12:09.500 --> 12:12.820
It can be allowed to send, but the harm is the attack of CSF, HFPA.

12:14.360 --> 12:16.120
But it can't be read.

12:16.120 --> 12:20.940
This affects the web and limits the development of the web.

12:21.060 --> 12:24.520
Many times, the web needs a language to read other languages.

12:24.520 --> 12:35.220
For example, an e-commerce website may want to read a package information of a courier company and then track a package on its own website.

12:35.320 --> 12:38.220
How does this function work?

12:38.220 --> 12:41.440
It needs a cross-source reading information.

12:43.740 --> 12:51.800
In order to achieve this cross-source reading, but SOP doesn't allow it, the developers came up with some ad-hoc solutions.

12:52.820 --> 12:56.780
The JSONP solution was first proposed in 2005.

12:58.560 --> 13:01.060
This solution is very dangerous.

13:04.020 --> 13:06.360
JSONP brings a series of security issues.

13:06.360 --> 13:11.380
The most prominent security issue is that JSONP itself does not have an anti-counterfeiting mechanism.

13:11.380 --> 13:15.960
It can't say which website I want to visit and which website I don't want to visit.

13:16.000 --> 13:20.660
In order to solve this problem, the JSONP solution came up with CORS.

13:22.040 --> 13:26.840
In Chinese, CORS stands for cross-source sharing.

13:27.180 --> 13:30.640
It is an anti-counterfeiting mechanism that shows authorization.

13:35.840 --> 13:41.440
Its principle is to generate an anti-counterfeiting strategy to limit the scope of SOP.

13:43.520 --> 13:46.300
In 2009, this protocol was supported by all browsers.

13:46.620 --> 13:49.260
In 2014, it became W3C's standard.

13:49.260 --> 13:51.060
This is how the protocol works.

13:51.500 --> 13:52.580
It is quite simple.

13:52.580 --> 13:54.480
It is divided into three steps.

13:55.120 --> 14:00.340
For example, now the browser has loaded a Javascript from A.com.

14:00.340 --> 14:02.480
After that, Javascript will issue a cross-source request.

14:02.480 --> 14:04.040
For example, I want to issue a cross-source request to B.com.

14:04.040 --> 14:17.320
During this process, the browser will add an origin header to the request to mark that the source code is from A.com.

14:17.940 --> 14:29.080
Then the server will generate an anti-counterfeiting strategy based on the request's origin , which is called access-control-alone-origin, and put it in the corresponding header to show that I am allowed to visit A.com.

14:29.720 --> 14:38.380
After the browser sees the corresponding header, it will compare the origin of the request to see if the corresponding strategy is consistent.

14:38.380 --> 14:40.980
If it is consistent, it will allow the Javascript to be read.

14:40.980 --> 14:44.260
If it is inconsistent, it will not allow the Javascript to be read.

14:44.440 --> 14:45.720
The principle is very simple.

14:45.720 --> 14:47.560
It is divided into three steps.

14:48.960 --> 15:01.260
But Quartz also provides some more detailed control, including method, header, and credentials.

15:02.860 --> 15:04.740
Including cookies and the like.

15:07.620 --> 15:09.880
For example, here is a simple example.

15:09.880 --> 15:22.680
When XHR sends a request, it allows the user to customize the method, customize the header, and customize whether to bring a cookie.

15:22.740 --> 15:24.060
But what is the problem with this?

15:24.060 --> 15:25.900
It is too flexible.

15:25.960 --> 15:27.360
It is too flexible for the web.

15:27.360 --> 15:31.360
It may damage some applications' CSR defense.

15:31.360 --> 15:35.860
Some applications rely on the customized header to do CSR defense.

15:35.880 --> 15:38.440
So Quartz divides the request into two categories.

15:38.460 --> 15:41.080
One is a simple request, and the other is a non-simple request.

15:41.080 --> 15:43.100
A simple request can be sent directly.

15:43.720 --> 15:46.220
Just like the previous process, the request can be sent directly.

15:46.220 --> 15:47.240
It is not harmful to the server.

15:47.240 --> 15:50.260
I will go directly to the request, and then you return me the visit policy.

15:50.980 --> 15:53.700
But a non-simple request is not safe.

15:53.700 --> 15:55.200
It cannot be sent directly.

15:55.200 --> 15:58.480
It requires an additional verification operation.

15:59.540 --> 16:01.980
How to judge whether a request is simple or not?

16:02.000 --> 16:03.340
There are three conditions.

16:03.340 --> 16:05.540
These three conditions look complicated.

16:05.700 --> 16:07.080
The principle is simple.

16:07.080 --> 16:08.720
It is the white list mechanism.

16:09.020 --> 16:11.860
The request header must be in the white list.

16:12.140 --> 16:13.900
The request method must be in the white list.

16:14.040 --> 16:16.740
The content type value must also be in the white list.

16:19.160 --> 16:20.860
What if it is a non-simple request?

16:20.860 --> 16:21.980
How to do it?

16:22.420 --> 16:27.760
Since the request cannot be sent directly, I will send a preflight request first.

16:27.760 --> 16:29.760
This request is safe.

16:30.180 --> 16:34.400
There is no user-created header.

16:34.400 --> 16:37.240
It is a header built in the browser.

16:37.500 --> 16:41.860
It tells the server that I am going to send this request later.

16:41.860 --> 16:42.820
There is a dangerous request.

16:42.820 --> 16:43.920
Will you let me send it?

16:44.020 --> 16:46.080
Then the server says you can send it.

16:46.080 --> 16:48.220
Then it checks whether this strategy is allowed to be sent.

16:48.780 --> 16:51.140
Then it performs this real operation.

16:51.140 --> 16:53.680
It is equivalent to adding a part of the request process.

16:53.680 --> 16:54.400
It is divided into two parts.

16:54.400 --> 16:55.180
One is preflight.

16:55.180 --> 16:58.200
The other is a real interview.

17:03.060 --> 17:04.880
What kind of problems may arise with such a cross mechanism?

17:05.980 --> 17:08.960
Here we found three problems.

17:09.240 --> 17:13.220
The first is that it is too relaxed to send the front end.

17:13.320 --> 17:15.280
It may cause security issues.

17:19.020 --> 17:22.360
Just now we talked about the request to automatically submit a post.

17:22.360 --> 17:24.700
It has caused a huge security threat to the current web.

17:24.700 --> 17:27.980
Such as the attack of CSF and HLPA.

17:31.300 --> 17:41.160
But when CORS designed the XHR interface, it is hidden and relaxed the forwarding front end.

17:41.400 --> 17:46.780
It can give the attacker a more flexible front end and bring some new security issues.

17:46.780 --> 17:54.180
We found that using this new security front end can bring four types of attacks.

17:54.920 --> 18:04.960
The first type of attack is that it can attack the second-level protocol services of the internal network to create and delete the internal network files.

18:05.060 --> 18:11.300
It can also attack the code execution loopholes of the internal network to get the files of the internal network server.

18:11.300 --> 18:15.920
It can also attack the CSF loopholes that could not be used before.

18:15.920 --> 18:22.340
It can even speculate the privacy information of any website.

18:22.340 --> 18:28.080
These loopholes are not only the loopholes of the service end, but also the loopholes of the browser.

18:28.260 --> 18:30.340
So in March, we have...

18:34.280 --> 18:36.460
In March, we have...

18:36.460 --> 18:38.640
I can't synchronize.

18:38.640 --> 18:43.720
In March, we have reported the loopholes to the browser manufacturers.

18:45.580 --> 18:49.680
But the browser manufacturers haven't fixed it yet.

18:49.940 --> 18:53.740
We reported it to Chrome, Firefox, Safari, Edge and IE.

18:54.000 --> 19:00.740
The main problem is that it may bring some destructive effects to the current web.

19:00.900 --> 19:03.400
If it needs to be fixed, it may have side effects.

19:03.400 --> 19:05.440
So it is difficult for them to fix it.

19:05.440 --> 19:15.580
They ask us not to reveal the details of the loopholes on DiverCon China to check if our PPT is safe.

19:16.240 --> 19:18.120
So they attach great importance to this issue.

19:18.120 --> 19:19.760
We also agree with their advice.

19:19.760 --> 19:23.660
But what we can do now can't let you down.

19:23.660 --> 19:26.960
So let's play a video.

19:28.520 --> 19:32.120
Please let the staff play the video.

19:32.220 --> 19:34.360
On the left is a browser.

19:34.360 --> 19:38.000
On the right is a remote attacker.

19:38.000 --> 19:40.380
The user on the left refreshes the browser.

19:40.600 --> 19:46.580
The attacker on the right gets the server.

19:50.870 --> 19:53.750
This is the attack effect.

19:58.230 --> 20:05.210
Now let's talk about the key points of today's talk.

20:06.270 --> 20:08.590
The first one is the risk of trust.

20:08.670 --> 20:12.130
The safety issue caused by the risk of trust.

20:16.920 --> 20:22.520
The core function of the course requires a user to trust another user to share the data.

20:22.520 --> 20:27.500
Of course, this kind of trust may increase the risk of attack.

20:28.300 --> 20:30.600
A website may not have a security loop.

20:30.600 --> 20:32.380
But it has a security loop in the trust area.

20:32.380 --> 20:41.420
In this way, the attacker can use the security loop in the trust area to attack the security loop in the trust area indirectly.

20:42.620 --> 20:47.380
Here we find that there are two types of risk of trust.

20:49.220 --> 20:52.940
The first type is the HTTPS trust HTTP.

20:55.820 --> 21:00.860
HTTPS can provide confidential and complete protection for the network communication.

21:00.860 --> 21:08.520
Even if the network is not safe, it can ensure that the middleman in the network cannot read the data in it.

21:09.100 --> 21:21.280
But if an HTTPS website trusts an HTTP website, the attacker can first hijack the HTTP website.

21:21.280 --> 21:26.540
Then through the HTTP website, send a request to read the resources of the HTTPS website.

21:27.360 --> 21:30.520
Here is a diagram of the process.

21:31.740 --> 21:40.680
When the victim visits another website, the attacker enters an iframe and forces the victim to visit the HTTP example.com.

21:43.200 --> 21:49.600
Then the attacker hijacks the HTTP example.com and enters some malicious JavaScript.

21:51.280 --> 21:57.520
Then the JavaScript sends the request to the HTTPS server.

21:59.440 --> 22:03.140
The HTTPS server is obviously from the HTTP example.com.

22:03.140 --> 22:04.620
I trust it.

22:04.940 --> 22:07.340
It returns the resources.

22:08.600 --> 22:12.240
Then the attacker's JavaScript gets the content.

22:13.000 --> 22:16.460
Then it can send the content to the attacker.

22:16.460 --> 22:22.960
This is the effect of the middleman hijacking the HTTPS website.

22:24.580 --> 22:29.580
The second type of reliance, which is risky, is the reliance on other fields.

22:29.600 --> 22:33.300
For example, the reliance on all subsidiary fields.

22:35.000 --> 22:42.580
The danger of this is that a subsidiary field's CSS may affect the security of the main field.

22:43.280 --> 22:45.500
For example, we found a case here.

22:45.500 --> 22:47.320
This is mail.riu.

22:48.520 --> 22:54.160
Its main field has a very strong security defense.

22:54.160 --> 23:00.620
It deploys CSP, HTTP Owing, Cookie, to prevent this CSS and provide a loophole reward.

23:01.380 --> 23:06.520
But its subsidiary field does not deploy CSP and does not provide a loophole reward.

23:06.520 --> 23:08.440
So it is very easy to find a subsidiary field's CSS.

23:08.920 --> 23:10.900
But its main field trusts all subsidiary fields.

23:10.900 --> 23:20.060
So we found such a loophole to use this subsidiary field's CSS to read sensitive information on the main field.

23:22.160 --> 23:25.660
The second one is that it trusts the third party's domain.

23:25.660 --> 23:26.920
It may bring a security risk.

23:26.920 --> 23:32.680
As I just said, even if your domain is safe, it cannot guarantee that your information is not leaked.

23:32.680 --> 23:36.000
Because you may have a security problem with the third party's reliance.

23:36.740 --> 23:38.840
We found a case here.

23:39.200 --> 23:42.660
A Korean e-commerce website has expired its trusted domain name.

23:43.320 --> 23:49.940
The attacker can register the expired domain name to carry out the attack.

23:52.720 --> 23:56.840
The third problem is the complexity of the course strategy.

23:57.700 --> 24:02.520
We found that four types of course strategies are prone to misconfiguration.

24:04.940 --> 24:16.980
We know that the core of the course is to generate a network control strategy at the service end to guide the browser to expand the SOP limit and achieve cross-domain sharing.

24:16.980 --> 24:27.880
But if the course strategy is wrong and the generation is wrong, it may lead to the trust of an attacker to achieve the SOP bypass.

24:30.020 --> 24:36.060
As for the misconfiguration of the course, there have been a lot of research by researchers.

24:36.060 --> 24:41.960
Here we summarize the previous research and find some new cases of misconfiguration.

24:44.020 --> 24:54.300
Let's watch a video on how to bypass the SOP limit to read the information on the SOHU video website.

24:55.920 --> 24:57.860
This loophole has been broken.

24:59.240 --> 25:01.020
So it has been fixed.

25:01.020 --> 25:03.520
Let's look at the SOHU video.

25:03.520 --> 25:09.540
This is a website of Alex Top, ranked 5th in China and 14th in the world.

25:14.590 --> 25:16.770
We can see that there is only one acquisition address in the acquisition address.

25:16.770 --> 25:17.210
Right ?

25:17.570 --> 25:18.590
Only one acquisition address.

25:18.970 --> 25:24.850
Then let's visit the attacker's evildoing.com.

25:24.850 --> 25:29.050
We find that it has become two acquisition addresses and can read the user's information.

25:29.050 --> 25:32.490
Let's see if it has become two user addresses.

25:32.490 --> 25:38.350
We find that it can not only read the user's information but also write information to the user's account.

25:39.810 --> 25:41.710
So this is a very serious hazard.

25:41.730 --> 25:45.350
Let's see why there is a misconfiguration of the course strategy.

25:45.350 --> 25:46.770
What may happen?

25:47.930 --> 25:55.150
First of all, the strategy of the course is that the access control alone origin allows the configuration of the value.

25:55.470 --> 25:56.990
There are two standards for the course.

25:56.990 --> 26:00.130
One is the W3C standard, and the other is the WG standard.

26:00.130 --> 26:04.470
The WG standard is a standard launched by several browser manufacturers.

26:04.810 --> 26:11.850
In the W3C standard, the access control alone origin can be an origin list, or a NOR, or a signal.

26:11.850 --> 26:18.390
But in the WG standard, it can only be a single origin, or a NOR, or a signal.

26:20.090 --> 26:25.310
And in all the browsers, all the browsers we tested followed the WG standard.

26:25.310 --> 26:31.250
That is to say, only such a configuration, a green configuration, is legal.

26:31.390 --> 26:34.990
And the other two configurations are all wrong.

26:37.850 --> 26:41.210
We found that many websites did not notice this.

26:42.110 --> 26:48.870
The issue of the origin configuration actually includes some large websites with the origin configuration.

26:49.570 --> 26:54.090
And although this configuration cannot cause security issues, it is indeed a misconfiguration.

26:58.760 --> 26:59.280
Uh...

27:00.740 --> 27:07.120
So, if a website wants to share data to multiple regions, what should it do?

27:08.440 --> 27:11.660
I just want to be able to share data to A.com and B.com at the same time.

27:11.660 --> 27:15.380
Then we must have a dynamic access control strategy.

27:17.060 --> 27:21.760
In this dynamic process, we found that in fact, security issues are very easy to occur.

27:22.360 --> 27:24.480
We have four types of security issues.

27:24.560 --> 27:26.340
The first type of security issue is...

27:26.340 --> 27:28.280
We have five types of security issues.

27:28.280 --> 27:29.860
The first type of security issue is...

27:29.860 --> 27:37.340
Many websites when configuring this configuration strategy, there is an example here, which is a configuration of NGX.

27:37.380 --> 27:41.700
Directly add this access control to this NGX.

27:41.700 --> 27:43.960
Alone origin, ATP origin.

27:45.620 --> 27:48.200
It is equivalent to reflection of any origin header.

27:48.200 --> 27:49.720
This can achieve the effect of functionality.

27:49.720 --> 27:54.300
However, the harm is that it trusts any language.

27:54.300 --> 27:57.060
It is equivalent to the SOP of the browser.

27:57.060 --> 27:58.040
It completely fails.

27:58.520 --> 28:00.740
Any language can be read directly.

28:02.700 --> 28:06.260
This configuration is also the highest in our discovery.

28:06.260 --> 28:08.860
is also the highest in our discovery.

28:08.860 --> 28:13.660
In 2016, someone did for X-top 1 million.

28:13.660 --> 28:14.320
a statistic for X-top 1 million.

28:14.320 --> 28:17.640
The result of the measurement is that there is a problem in each of the 10 websites that configure the course.

28:17.640 --> 28:18.240
that configure the course .

28:19.380 --> 28:26.540
And in our recent measurement, there is a configuration that comes out with this problem.

28:26.920 --> 28:34.400
Although this configuration does not look obvious, but in fact, it is very harmful and it is very easy to have this problem.

28:38.610 --> 28:43.270
The problem with the previous configuration is that it does not do any training.

28:43.290 --> 28:44.410
What is the origin header?

28:44.410 --> 28:46.230
What is the origin header I allow ?

28:46.330 --> 28:56.310
Then there is a more advanced error method, that is, I take a look at this origin header I take a look at this origin header whether it is the origin header I want .

28:56.310 --> 28:58.190
whether it is the origin header For example, here is a configuration of NGX.

28:59.170 --> 29:01.890
Is this configuration safe?

29:04.570 --> 29:08.190
This is obviously not safe for us.

29:08.610 --> 29:12.670
It is that there is a lack of an end service at the last place .

29:13.070 --> 29:19.950
Then the attacker can add a .evil .com at the back .com to realize the bypassing strategy.

29:20.110 --> 29:25.370
The example we just demonstrated in the video is the example of the search video that made this mistake.

29:28.330 --> 29:35.390
The search video we put this loophole because the search itself does not have a safe response center we reported this loophole to them through freebuff .

29:36.230 --> 29:39.590
But they fixed this problem but did not fix it well.

29:39.590 --> 29:41.390
What is the reason for not fixing it well?

29:41.390 --> 29:44.790
The first error avoidance jumped into the second error pit.

29:46.910 --> 29:50.430
What is the second error pit?

29:50.470 --> 29:51.990
I can't see its misconfiguration .

29:51.990 --> 29:57.210
This is me on stackoverflow to see a configuration method recommended by others .

29:58.990 --> 30:05.250
I see this because the previous configuration said you do not have the example.com there is a security issue.

30:05.250 --> 30:09.550
Then I will check whether you are at the end of the example.com right?

30:10.890 --> 30:12.630
But this is also problematic.

30:12.630 --> 30:14.010
What may be the problem?

30:15.930 --> 30:25.390
The attacker can send such a attack example.com It is also at the end of the example.com But this domain can be registered by the attacker.

30:26.810 --> 30:28.650
So it is also not safe.

30:30.110 --> 30:34.290
We also reported this error pit to him.

30:37.410 --> 30:39.690
I haven't seen if it has been fixed.

30:39.710 --> 30:41.530
It was reported a few days ago.

30:46.510 --> 30:55.890
Then this did not transfer the last two types did not transfer this point.

30:55.890 --> 31:03.110
Many websites will check when they hold the origin they will use the positive expression to check.

31:04.130 --> 31:07.070
When they write the positive expression they did not transfer this point.

31:07.890 --> 31:10.510
This causes this point to be replaced by any alphabet.

31:12.570 --> 31:16.450
Because in the positive expression a point is a common match.

31:17.270 --> 31:19.850
So it can cause a security issue.

31:19.850 --> 31:24.450
We also found that there are websites that even have purple -wearing matching.

31:25.210 --> 31:33.670
We found that as long as the host from the origin is a self -proclaimed purple-wearing host, it is allowed.

31:38.730 --> 31:41.110
We talked about the five types of matching earlier.

31:47.070 --> 31:51.290
Then we will look at the second category of questions.

31:51.290 --> 31:53.610
The first one is the x-control we just talked about .

31:53.610 --> 32:05.470
There can be three types of questions in The first one is in

32:08.810 --> 32:23.690
RFC 6454 where it is defined as if a language comes from a private domain , then the query origin cannot directly show the domain .

32:23.690 --> 32:26.250
I will set it to this one.

32:26.770 --> 32:32.810
But it didn't define what is a private sensitive domain.

32:33.230 --> 32:35.350
Local documents are considered a private sensitive domain.

32:35.350 --> 32:36.450
Is there anything else?

32:38.150 --> 32:48.690
So when many websites are doing this hyper app, that is, when mixing apps, it allows this...

32:48.690 --> 32:53.830
Because the hyper app needs this ATM25 to do the interface.

32:54.670 --> 32:56.270
It will allow this...

32:56.270 --> 32:59.250
JavaScript will send a request directly from the local file.

32:59.250 --> 33:00.870
The output is a lore.

33:01.770 --> 33:04.470
It allows this lore to read.

33:04.470 --> 33:05.290
But it brings...

33:05.290 --> 33:10.890
We found that in the actual browser, this lore can be forged by any website.

33:12.490 --> 33:15.770
Through this iframe sandbox script.

33:17.510 --> 33:22.590
This means that all trustable lore websites are not safe.

33:22.590 --> 33:25.190
It is also a trustable website.

33:26.670 --> 33:30.850
The yellow one is our POC.

33:32.830 --> 33:37.550
This kind of lore example has also caused a lot of security issues in history.

33:37.630 --> 33:43.570
For example, in 2016, Facebook Messenger was discovered.

33:43.570 --> 33:48.170
Because of this trustable lore, any user can read it.

33:48.170 --> 33:54.450
And any attacker can read Facebook Messenger's chat message.

33:57.990 --> 33:59.590
The third category is...

33:59.850 --> 34:02.690
Let's see what kind of problems the signal might bring.

34:05.330 --> 34:09.550
The signal in the course allows any desire.

34:09.550 --> 34:11.030
It looks very intuitive.

34:11.030 --> 34:13.030
But it allows any desire.

34:13.030 --> 34:16.030
It is too loose.

34:16.490 --> 34:19.190
The course has another rule.

34:19.190 --> 34:22.050
The signal can't be used with Cookies.

34:22.050 --> 34:24.150
It can't be used at the same time.

34:24.830 --> 34:28.230
This means that the signal can only be shared in public.

34:28.230 --> 34:29.770
It doesn't need authentic resources.

34:29.770 --> 34:33.170
If you want to bring Cookies to visit this resource, you can't use the signal.

34:33.530 --> 34:35.810
And all browsers follow this standard.

34:35.810 --> 34:38.150
As long as you match this configuration, it is considered unsafe.

34:38.190 --> 34:41.870
It will refuse to say that this configuration is a false configuration.

34:42.550 --> 34:50.850
In the actual website, we found that many websites didn't notice that this configuration is a false configuration.

34:51.510 --> 34:54.090
Including some big websites.

34:54.650 --> 34:56.270
For example, security.harvard.edu.

34:56.270 --> 35:00.550
It is not the security department.

35:00.550 --> 35:03.550
It is the information security department of Harvard.

35:04.750 --> 35:06.630
There is still no configuration.

35:07.410 --> 35:09.290
The problem is that there is no configuration team.

35:13.670 --> 35:17.990
What is more interesting is that we found that there is a framework.

35:17.990 --> 35:26.210
Because the configuration signal and true will be wrong, the framework will take the initiative to convert the signal and true into a reflection-friendly orange.

35:26.210 --> 35:29.030
The reflection-friendly orange we mentioned earlier is very dangerous.

35:31.470 --> 35:35.410
We tested 11 mainstream frameworks.

35:35.410 --> 35:36.530
We found that there are 8.

35:36.610 --> 35:46.250
If the user directly matches the signal and true in this configuration, it will take the initiative to reflect it into a reflection-friendly orange.

35:48.110 --> 35:51.290
The fourth problem is the security problem caused by the course and cache.

36:00.110 --> 36:03.470
For example, there is a resource server, c.com.

36:03.470 --> 36:08.570
It wants to share data with a.com and b.com at the same time.

36:09.350 --> 36:21.030
If the user first visits c.com via a.com, and then c.com returns and says, I allow a.com, you are in my list.

36:23.250 --> 36:24.910
Then the user...

36:24.910 --> 36:28.430
But this response will be delayed by the middle cache.

36:28.870 --> 36:33.690
It may be a browser cache or a transparent cache in the middle.

36:36.960 --> 36:44.860
So if b.com also wants to visit the resources of c.com, but it will be detected by this cache.

36:46.360 --> 36:52.140
Then the feedback is to allow a.com to save the content before.

36:52.260 --> 36:55.660
This a.com obviously does not match the b.com issued by the request.

36:56.120 --> 36:59.080
This leads to the failure of the b.com in the later visit.

36:59.900 --> 37:04.340
This leads to a failure of the function of the course.

37:08.280 --> 37:14.780
For this kind of situation, the ATP protocol provides the VeryHeader to solve this problem.

37:14.780 --> 37:23.720
When you set up the VeryOriginHeader in the response to guide the cache, you have to drag the origin into the cache key.

37:23.960 --> 37:35.340
Of course, we found that many websites, when developing anti-cache control strategies, did not match the VeryOriginHeader.

37:41.640 --> 37:46.200
Now we have found a bunch of mis-configuration problems.

37:46.460 --> 37:49.500
Let's take a look at the real website.

37:49.500 --> 37:51.760
What kind of security problems may there be on the real website?

37:52.040 --> 37:54.080
What will the security situation be like?

37:54.860 --> 37:57.140
We are going to do a measurement in four parts.

37:57.800 --> 38:00.060
First, we select the target.

38:00.880 --> 38:10.280
We select a website with 50,000 AlexTurps as our measurement target, because it is a highly influential website.

38:11.320 --> 38:14.840
Then we extract their domain name from the 50,000 websites.

38:15.720 --> 38:18.140
We extracted 90 million domain names.

38:18.320 --> 38:21.800
The data comes from the passive DNS data provided by 360 Internet Security Union.

38:25.780 --> 38:32.300
Then we dynamically detect the configuration of the course for each domain name.

38:32.560 --> 38:35.840
Why do we have to detect it dynamically, instead of scanning it directly?

38:36.000 --> 38:43.400
Mainly because the anti-cache control strategy of the course does not return to each response directly.

38:43.420 --> 38:45.380
Because it needs to be dynamically generated.

38:45.660 --> 38:49.940
Only if your OriginHeader hits its anti-cache control strategy, will it return.

38:50.300 --> 38:55.320
If you don't have an OriginHeader, or OriginHeader does not hit its anti-cache control strategy, it will not return.

38:57.180 --> 38:59.880
So we need to take the initiative to detect it.

39:01.580 --> 39:09.260
For example, here we are going to detect if the service end has the configuration to allow NOR to visit.

39:09.260 --> 39:18.040
We set the OriginNOR in the request, and then see if it returns the access control, along OriginNOR, such a value.

39:20.340 --> 39:25.540
The result of the test is that we found that 480,000 domain names are configured to the course.

39:26.240 --> 39:29.270
Basically, it covers every website of X50,000.

39:32.220 --> 39:37.080
Among them, 130,000 are configured to have a problem, which is about 27.5%.

39:37.080 --> 39:42.820
So this problem is widespread on the Internet.

39:43.300 --> 39:44.040
This kind of...

39:44.920 --> 39:46.960
Electro 50,000 is relatively safe.

39:46.960 --> 39:50.160
Not to mention other websites that are not on this list.

39:53.260 --> 39:55.320
So how to prevent this kind of loophole?

39:56.360 --> 40:03.800
We reported all the security problems we found to the relevant manufacturers.

40:05.740 --> 40:08.200
Some manufacturers have already fixed it, such as Sohu.

40:08.200 --> 40:09.840
Some are still being fixed.

40:10.580 --> 40:14.300
For such a problem, how to prevent it?

40:14.440 --> 40:16.240
This problem is divided into two aspects.

40:16.240 --> 40:20.080
One is the overloading of the course.

40:20.160 --> 40:22.360
The other is the problem of read configuration.

40:22.800 --> 40:28.180
For overloading, we reported to the Chrome browser, Firefox browser.

40:28.180 --> 40:39.960
They haven't released the fix yet, but one of the preventive measures they want to do is to prohibit external websites from visiting the internal network.

40:40.100 --> 40:42.660
That is, cross-network is not allowed.

40:43.060 --> 40:45.020
Use the browser as a jump board to visit the internal network.

40:48.440 --> 40:52.280
As for the problem of misconfiguration, we found that...

40:52.800 --> 40:55.220
Of course, we can blame the developers for not noticing it.

40:55.220 --> 40:57.860
Of course, the developers have to bear a lot of responsibility.

40:57.940 --> 41:05.280
Another big responsibility is that the course has a lot of weird cases, such as the case of Nord.

41:06.300 --> 41:09.920
Many websites do not clearly write this standard.

41:10.140 --> 41:16.260
Many website developers do not know there is such a weird case.

41:16.260 --> 41:22.180
So it's best to clarify all kinds of security risks in this standard.

41:23.520 --> 41:31.660
And what the website manager can do is check if your course configuration has this problem.

41:31.780 --> 41:38.540
We provide a source tool, which is the course scanner.

41:39.860 --> 41:45.360
You can use this to scan a website to see if it is safe.

41:45.360 --> 41:47.700
This is a screenshot.

41:48.560 --> 41:54.520
We scanned the top 100 websites, and we found a lot of misconfiguration.

41:57.240 --> 42:00.360
You are welcome to download and use this tool.

42:00.780 --> 42:07.000
Since I used this tool, I don't find bugs every day at work.

42:07.000 --> 42:09.640
There are too many bugs, because there are too many misconfigurations.

42:09.640 --> 42:10.620
I can't handle it.

42:11.020 --> 42:12.820
So you are welcome to use this tool.

42:12.820 --> 42:17.920
You can definitely find a lot of security issues.

42:27.490 --> 42:34.430
To sum up, there are three types of problems with the course.

42:34.430 --> 42:39.810
The first one is that it may cause security issues for the internal network due to its too lenient forwarding .

42:39.810 --> 42:44.330
This is not detailed, but it is a very important contribution to our work.

42:44.330 --> 42:49.410
Maybe we will talk about this specific security issue in the next session.

42:49.410 --> 42:55.730
The second type of problem is that the course brings new people's dependence and new people's security risks.

42:55.730 --> 42:59.070
The third type is that there are a lot of corollary cases in the course.

43:00.670 --> 43:06.350
There are a lot of misconfigurations in the actual website , which brings new security issues.

43:07.030 --> 43:08.510
This is my report.

43:08.670 --> 43:09.350
Thank you.

