1 00:00:10,070 --> 00:00:12,050 Good morning, everyone. 2 00:00:12,350 --> 00:00:17,430 I am very honored to be able to be on the DevCon stage today. 3 00:00:17,730 --> 00:00:20,050 Maybe you can feel it. 4 00:00:20,050 --> 00: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. 5 00:00:32,850 --> 00:00:40,350 For example, there was no leadership instructions, and there was no academic support. 6 00:00:41,770 --> 00: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. 7 00:00:53,370 --> 00:00:58,470 You have also seen the translation next to it in the past two days. 8 00:00:58,470 --> 00:01:00,690 Of course, I did this translation myself. 9 00:01:02,970 --> 00:01:08,290 Our foreign speakers, their PPTs, are some of the volunteers I organized. 10 00:01:08,290 --> 00:01:11,290 Mainly some of our PhD students did some translation. 11 00:01:11,290 --> 00:01:14,870 One of the PhD students sent me his own feelings. 12 00:01:14,870 --> 00:01:19,970 I think at this point, we, DevCon China, have already done it. 13 00:01:21,550 --> 00: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. 14 00:01:28,590 --> 00:01:38,870 It is probably the curiosity and passion for technology, the yearning for freedom, and the pursuit of perfection. 15 00:01:39,450 --> 00:01:46,890 From this point of view, I think DevCon China has really achieved the integration of the hacker spirit and Chinese culture. 16 00:01:47,990 --> 00:01:54,390 Today, I mainly want to share with you some of the research we have done recently. 17 00:01:56,270 --> 00:01:59,570 From the outside, attacking the inside. 18 00:01:59,570 --> 00:02:13,310 Here, we mainly use the latest or already widely accepted standard It is called cross-domain, cross-domain resource sharing. 19 00:02:13,450 --> 00:02:18,190 The main work is done by my PhD student, Chen Jianjun. 20 00:02:18,190 --> 00: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. 21 00:02:28,810 --> 00:02:32,290 Wan Tao from Huawei Jiangda, Dr. 22 00:02:32,290 --> 00:02:38,130 Chen Shuo from Microsoft, Professor Warren Paxson from UC Berkeley, and Professor Yang Ming from Fudan University. 23 00:02:38,450 --> 00:02:43,710 Our work will be published in August this year. 24 00:02:44,110 --> 00:02:46,230 What is this specific work? 25 00:02:46,270 --> 00:02:48,980 Let's take a look at the current attack scene. 26 00:02:50,380 --> 00:02:57,780 The attackers' attacks on the internet are usually made by firewalls. 27 00:02:57,880 --> 00:03:02,900 Even a simple address conversion can make such an attack impossible. 28 00:03:03,760 --> 00:03:11,160 A very intuitive idea is whether it is possible to attack through the web. 29 00:03:12,300 --> 00:03:16,060 For example, right-wing users click on a website. 30 00:03:16,060 --> 00:03:17,920 This is a website attacked by hackers. 31 00:03:17,920 --> 00:03:24,260 Then through JavaScript, the attacker's script is loaded into the user's browser. 32 00:03:24,260 --> 00:03:27,380 Then the user's browser attacks the internet. 33 00:03:32,410 --> 00:03:37,510 Of course, if you are familiar with web security, you may be very clear. 34 00:03:37,510 --> 00:03:42,030 Now, browsers have restrictions on cross-border resource visits. 35 00:03:42,250 --> 00:03:48,190 The most common strategy is SOP, which stands for Same-Origin Policy. 36 00:03:48,190 --> 00:04:00,010 In the general sense of SOP, we can imagine that it restricts cross-border visits. 37 00:04:00,010 --> 00:04:06,150 At least you can't read resources from other sources. 38 00:04:08,170 --> 00:04:15,630 But just like safety, performance, and functionality, they are often a pair of contradictions. 39 00:04:17,150 --> 00:04:22,990 In many cases, developers still need cross-border visits. 40 00:04:22,990 --> 00:04:26,070 So there are all kinds of ways to get around. 41 00:04:26,070 --> 00:04:30,090 One of them is JSON-P, which is more common in recent years. 42 00:04:30,090 --> 00:04:31,790 You may have heard of it. 43 00:04:31,790 --> 00:04:37,920 JSON-P makes it very convenient for developers, but it also brings a lot of problems. 44 00:04:38,330 --> 00:04:42,870 In recent years, it has become a standard. 45 00:04:42,870 --> 00:04:47,130 For example, cross-border resource sharing. 46 00:04:48,190 --> 00:04:53,270 Now mainstream browsers have achieved this standard. 47 00:04:53,270 --> 00:04:59,290 And most mainstream websites already have this feature. 48 00:05:00,010 --> 00:05:09,070 You can say that cross-border is a feature that provides managers with cross-border visits. 49 00:05:09,070 --> 00:05:15,310 At the same time, it protects the security of resource sharing. 50 00:05:16,010 --> 00:05:24,230 But in recent research, we found that it is not as safe as it was originally designed. 51 00:05:25,150 --> 00: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. 52 00:05:51,810 --> 00:05:58,130 In the past, there were some loopholes blocked by firewalls in the internal network. 53 00:05:59,050 --> 00:06:01,150 For example, there was a loophole in Strikes 2. 54 00:06:01,150 --> 00:06:04,950 Even if there is such a loophole in the internal network, the attacker can't get in. 55 00:06:04,950 --> 00:06:10,250 But now, with cross-border, such an attack may become a reality. 56 00:06:13,870 --> 00:06:16,130 I am a professor at Tsinghua University. 57 00:06:17,050 --> 00:06:25,030 As a professor, Jason Street just mentioned, I only gave one corner of the truth. 58 00:06:25,030 --> 00:06:27,130 The remaining three corners... 59 00:06:27,130 --> 00:06:29,710 Let's welcome my student, Chen Jianjun. 60 00:06:29,710 --> 00:06:32,510 Chen Jianjun is a Ph.D. 61 00:06:32,510 --> 00:06:33,770 student at Tsinghua University. 62 00:06:35,390 --> 00:06:40,330 He is my first Ph.D. 63 00:06:40,330 --> 00:06:40,330 student. 64 00:06:40,570 --> 00:06:42,490 He is about to graduate. 65 00:06:42,490 --> 00:06:45,210 His next step is to go to Berkeley for a Ph.D. 66 00:06:46,070 --> 00:06:51,670 He has already achieved a great success in the four top universities in the academic circle. 67 00:06:53,530 --> 00:07:02,790 Today, let's welcome Chen Jianjun to share with us the research on the cross-border attack on the internal network. 68 00:07:03,130 --> 00:07:04,410 Jianjun. 69 00:07:10,520 --> 00:07:14,020 It is a great honor to be here at DEVCON. 70 00:07:14,220 --> 00:07:19,740 I would like to share with you the article that is about to be published on User-Lead Security. 71 00:07:20,400 --> 00:07:24,960 I will talk about the details in four aspects. 72 00:07:25,580 --> 00:07:29,860 First, I will talk about the background of the web and cross-border. 73 00:07:29,860 --> 00:07:33,020 Then, I will talk about the security issues of the three cores. 74 00:07:33,820 --> 00:07:37,240 Then, I will talk about the security situation of the cores in a real website. 75 00:07:39,140 --> 00:07:41,920 Finally, I will talk about how to defend against such issues. 76 00:07:42,160 --> 00:07:44,480 First, let's look at the background of the web. 77 00:07:44,980 --> 00:07:48,560 Since we are talking about the security of the web, let's talk about the synchronization strategy. 78 00:07:48,780 --> 00:07:51,060 The synchronization strategy defines a circle. 79 00:07:51,060 --> 00:07:54,520 It is composed of three groups, which are the protocol, domain name and port. 80 00:07:54,720 --> 00:08:01,760 Generally speaking, the synchronization strategy is that it is isolated from two different circles. 81 00:08:01,760 --> 00:08:04,980 One circle cannot operate the data of another circle. 82 00:08:04,980 --> 00:08:05,940 It cannot cross-circle. 83 00:08:06,900 --> 00:08:09,680 For example, A.com cannot operate the data of B.com. 84 00:08:10,340 --> 00:08:15,100 However, this is just a misunderstanding of DOM. 85 00:08:18,960 --> 00:08:21,500 SOP has different restrictions on different network resources. 86 00:08:21,500 --> 00:08:22,220 Let's look at the details. 87 00:08:22,220 --> 00:08:23,560 For example, in this place, 88 00:08:31,560 --> 00:08:38,040 A.com wants to send a request to B.com and read the resource response of B.com. 89 00:08:38,040 --> 00:08:40,720 How will the synchronization strategy restrict it? 90 00:08:41,240 --> 00:08:44,460 It is not that it cannot be visited at all. 91 00:08:44,620 --> 00:08:46,420 It can be sent. 92 00:08:46,420 --> 00:08:51,400 A.com can send a request to B.com, but it cannot read the response. 93 00:08:54,470 --> 00:08:55,290 Why do I say it is a misunderstanding of DOM? 94 00:08:55,290 --> 00:08:56,490 It can be sent. 95 00:08:58,020 --> 00:09:00,130 For example, here is a simple example. 96 00:09:00,130 --> 00:09:04,130 A.com's HTML file is automatically submitted to B.com. 97 00:09:04,430 --> 00:09:13,490 It can also automatically click on the form request and send the request to B.com. 98 00:09:13,490 --> 00:09:15,090 This is a POST request. 99 00:09:15,980 --> 00:09:18,010 What kind of harm does this bring? 100 00:09:18,450 --> 00:09:20,110 It brings two harms. 101 00:09:20,110 --> 00:09:21,830 The first one is the attack of CSRF. 102 00:09:22,830 --> 00:09:27,210 As mentioned in the previous report, you used the login CSRF attack on my account. 103 00:09:27,430 --> 00:09:29,610 Let's talk about the principle of the CSRF attack. 104 00:09:29,890 --> 00:09:37,290 First, the victim logged into his own bank website and set a KUKA in the browser. 105 00:09:38,970 --> 00: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. 106 00:09:47,450 --> 00: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. 107 00:09:56,630 --> 00:09:58,330 This is the restriction of the synchronization strategy. 108 00:09:58,630 --> 00:10:00,890 However, the request is not restricted by the synchronization strategy. 109 00:10:02,050 --> 00:10:07,670 The attacker can send a POST request to the bank website through his own website, through the browser operated by JavaScript. 110 00:10:11,650 --> 00:10:15,370 In this request, KUKA is used. 111 00:10:15,370 --> 00:10:17,870 KUKA will be automatically added to each request. 112 00:10:17,870 --> 00:10:23,750 In this way, the user's KUKA is included in the POST request. 113 00:10:23,910 --> 00: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. 114 00:10:35,530 --> 00:10:41,450 So he executed this operation and transferred the bill to the attacker's account. 115 00:10:43,650 --> 00:10:47,770 The second type of attack is the HTML form protocol attack. 116 00:10:48,590 --> 00:10:57,970 This attack means that the attacker can use the victim's browser to cross-protocol attack. 117 00:10:57,970 --> 00:11:01,750 For example, he wants to attack an SMTP server, an email server. 118 00:11:03,130 --> 00:11:07,990 First, the victim accidentally clicked a link, right? 119 00:11:10,010 --> 00:11:15,110 Then, the JavaScript in this link sends a POST request to the user's browser. 120 00:11:15,930 --> 00:11:25,910 In this POST request, the attacker can construct the body of the request to construct some SMTP commands in it. 121 00:11:25,910 --> 00: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. 122 00:11:38,590 --> 00:11:46,590 In this way, he can use the user's browser to send an email to the email server. 123 00:11:49,450 --> 00:11:55,770 Maybe this email server is in the user's network and can cross-network and cross-protocol attack. 124 00:12:00,020 --> 00:12:04,720 As we mentioned earlier, SOP has two parts. 125 00:12:04,720 --> 00:12:06,000 One is cross-development. 126 00:12:06,080 --> 00:12:09,460 It can be allowed to send, but it can't be read. 127 00:12:09,500 --> 00:12:12,820 It can be allowed to send, but the harm is the attack of CSF, HFPA. 128 00:12:14,360 --> 00:12:16,120 But it can't be read. 129 00:12:16,120 --> 00:12:20,940 This affects the web and limits the development of the web. 130 00:12:21,060 --> 00:12:24,520 Many times, the web needs a language to read other languages. 131 00:12:24,520 --> 00: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. 132 00:12:35,320 --> 00:12:38,220 How does this function work? 133 00:12:38,220 --> 00:12:41,440 It needs a cross-source reading information. 134 00:12:43,740 --> 00: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. 135 00:12:52,820 --> 00:12:56,780 The JSONP solution was first proposed in 2005. 136 00:12:58,560 --> 00:13:01,060 This solution is very dangerous. 137 00:13:04,020 --> 00:13:06,360 JSONP brings a series of security issues. 138 00:13:06,360 --> 00:13:11,380 The most prominent security issue is that JSONP itself does not have an anti-counterfeiting mechanism. 139 00:13:11,380 --> 00:13:15,960 It can't say which website I want to visit and which website I don't want to visit. 140 00:13:16,000 --> 00:13:20,660 In order to solve this problem, the JSONP solution came up with CORS. 141 00:13:22,040 --> 00:13:26,840 In Chinese, CORS stands for cross-source sharing. 142 00:13:27,180 --> 00:13:30,640 It is an anti-counterfeiting mechanism that shows authorization. 143 00:13:35,840 --> 00:13:41,440 Its principle is to generate an anti-counterfeiting strategy to limit the scope of SOP. 144 00:13:43,520 --> 00:13:46,300 In 2009, this protocol was supported by all browsers. 145 00:13:46,620 --> 00:13:49,260 In 2014, it became W3C's standard. 146 00:13:49,260 --> 00:13:51,060 This is how the protocol works. 147 00:13:51,500 --> 00:13:52,580 It is quite simple. 148 00:13:52,580 --> 00:13:54,480 It is divided into three steps. 149 00:13:55,120 --> 00:14:00,340 For example, now the browser has loaded a Javascript from A.com. 150 00:14:00,340 --> 00:14:02,480 After that, Javascript will issue a cross-source request. 151 00:14:02,480 --> 00:14:04,040 For example, I want to issue a cross-source request to B.com. 152 00:14:04,040 --> 00: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. 153 00:14:17,940 --> 00: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. 154 00:14:29,720 --> 00: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. 155 00:14:38,380 --> 00:14:40,980 If it is consistent, it will allow the Javascript to be read. 156 00:14:40,980 --> 00:14:44,260 If it is inconsistent, it will not allow the Javascript to be read. 157 00:14:44,440 --> 00:14:45,720 The principle is very simple. 158 00:14:45,720 --> 00:14:47,560 It is divided into three steps. 159 00:14:48,960 --> 00:15:01,260 But Quartz also provides some more detailed control, including method, header, and credentials. 160 00:15:02,860 --> 00:15:04,740 Including cookies and the like. 161 00:15:07,620 --> 00:15:09,880 For example, here is a simple example. 162 00:15:09,880 --> 00: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. 163 00:15:22,740 --> 00:15:24,060 But what is the problem with this? 164 00:15:24,060 --> 00:15:25,900 It is too flexible. 165 00:15:25,960 --> 00:15:27,360 It is too flexible for the web. 166 00:15:27,360 --> 00:15:31,360 It may damage some applications' CSR defense. 167 00:15:31,360 --> 00:15:35,860 Some applications rely on the customized header to do CSR defense. 168 00:15:35,880 --> 00:15:38,440 So Quartz divides the request into two categories. 169 00:15:38,460 --> 00:15:41,080 One is a simple request, and the other is a non-simple request. 170 00:15:41,080 --> 00:15:43,100 A simple request can be sent directly. 171 00:15:43,720 --> 00:15:46,220 Just like the previous process, the request can be sent directly. 172 00:15:46,220 --> 00:15:47,240 It is not harmful to the server. 173 00:15:47,240 --> 00:15:50,260 I will go directly to the request, and then you return me the visit policy. 174 00:15:50,980 --> 00:15:53,700 But a non-simple request is not safe. 175 00:15:53,700 --> 00:15:55,200 It cannot be sent directly. 176 00:15:55,200 --> 00:15:58,480 It requires an additional verification operation. 177 00:15:59,540 --> 00:16:01,980 How to judge whether a request is simple or not? 178 00:16:02,000 --> 00:16:03,340 There are three conditions. 179 00:16:03,340 --> 00:16:05,540 These three conditions look complicated. 180 00:16:05,700 --> 00:16:07,080 The principle is simple. 181 00:16:07,080 --> 00:16:08,720 It is the white list mechanism. 182 00:16:09,020 --> 00:16:11,860 The request header must be in the white list. 183 00:16:12,140 --> 00:16:13,900 The request method must be in the white list. 184 00:16:14,040 --> 00:16:16,740 The content type value must also be in the white list. 185 00:16:19,160 --> 00:16:20,860 What if it is a non-simple request? 186 00:16:20,860 --> 00:16:21,980 How to do it? 187 00:16:22,420 --> 00:16:27,760 Since the request cannot be sent directly, I will send a preflight request first. 188 00:16:27,760 --> 00:16:29,760 This request is safe. 189 00:16:30,180 --> 00:16:34,400 There is no user-created header. 190 00:16:34,400 --> 00:16:37,240 It is a header built in the browser. 191 00:16:37,500 --> 00:16:41,860 It tells the server that I am going to send this request later. 192 00:16:41,860 --> 00:16:42,820 There is a dangerous request. 193 00:16:42,820 --> 00:16:43,920 Will you let me send it? 194 00:16:44,020 --> 00:16:46,080 Then the server says you can send it. 195 00:16:46,080 --> 00:16:48,220 Then it checks whether this strategy is allowed to be sent. 196 00:16:48,780 --> 00:16:51,140 Then it performs this real operation. 197 00:16:51,140 --> 00:16:53,680 It is equivalent to adding a part of the request process. 198 00:16:53,680 --> 00:16:54,400 It is divided into two parts. 199 00:16:54,400 --> 00:16:55,180 One is preflight. 200 00:16:55,180 --> 00:16:58,200 The other is a real interview. 201 00:17:03,060 --> 00:17:04,880 What kind of problems may arise with such a cross mechanism? 202 00:17:05,980 --> 00:17:08,960 Here we found three problems. 203 00:17:09,240 --> 00:17:13,220 The first is that it is too relaxed to send the front end. 204 00:17:13,320 --> 00:17:15,280 It may cause security issues. 205 00:17:19,020 --> 00:17:22,360 Just now we talked about the request to automatically submit a post. 206 00:17:22,360 --> 00:17:24,700 It has caused a huge security threat to the current web. 207 00:17:24,700 --> 00:17:27,980 Such as the attack of CSF and HLPA. 208 00:17:31,300 --> 00:17:41,160 But when CORS designed the XHR interface, it is hidden and relaxed the forwarding front end. 209 00:17:41,400 --> 00:17:46,780 It can give the attacker a more flexible front end and bring some new security issues. 210 00:17:46,780 --> 00:17:54,180 We found that using this new security front end can bring four types of attacks. 211 00:17:54,920 --> 00: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. 212 00:18:05,060 --> 00:18:11,300 It can also attack the code execution loopholes of the internal network to get the files of the internal network server. 213 00:18:11,300 --> 00:18:15,920 It can also attack the CSF loopholes that could not be used before. 214 00:18:15,920 --> 00:18:22,340 It can even speculate the privacy information of any website. 215 00:18:22,340 --> 00:18:28,080 These loopholes are not only the loopholes of the service end, but also the loopholes of the browser. 216 00:18:28,260 --> 00:18:30,340 So in March, we have... 217 00:18:34,280 --> 00:18:36,460 In March, we have... 218 00:18:36,460 --> 00:18:38,640 I can't synchronize. 219 00:18:38,640 --> 00:18:43,720 In March, we have reported the loopholes to the browser manufacturers. 220 00:18:45,580 --> 00:18:49,680 But the browser manufacturers haven't fixed it yet. 221 00:18:49,940 --> 00:18:53,740 We reported it to Chrome, Firefox, Safari, Edge and IE. 222 00:18:54,000 --> 00:19:00,740 The main problem is that it may bring some destructive effects to the current web. 223 00:19:00,900 --> 00:19:03,400 If it needs to be fixed, it may have side effects. 224 00:19:03,400 --> 00:19:05,440 So it is difficult for them to fix it. 225 00:19:05,440 --> 00:19:15,580 They ask us not to reveal the details of the loopholes on DiverCon China to check if our PPT is safe. 226 00:19:16,240 --> 00:19:18,120 So they attach great importance to this issue. 227 00:19:18,120 --> 00:19:19,760 We also agree with their advice. 228 00:19:19,760 --> 00:19:23,660 But what we can do now can't let you down. 229 00:19:23,660 --> 00:19:26,960 So let's play a video. 230 00:19:28,520 --> 00:19:32,120 Please let the staff play the video. 231 00:19:32,220 --> 00:19:34,360 On the left is a browser. 232 00:19:34,360 --> 00:19:38,000 On the right is a remote attacker. 233 00:19:38,000 --> 00:19:40,380 The user on the left refreshes the browser. 234 00:19:40,600 --> 00:19:46,580 The attacker on the right gets the server. 235 00:19:50,870 --> 00:19:53,750 This is the attack effect. 236 00:19:58,230 --> 00:20:05,210 Now let's talk about the key points of today's talk. 237 00:20:06,270 --> 00:20:08,590 The first one is the risk of trust. 238 00:20:08,670 --> 00:20:12,130 The safety issue caused by the risk of trust. 239 00:20:16,920 --> 00:20:22,520 The core function of the course requires a user to trust another user to share the data. 240 00:20:22,520 --> 00:20:27,500 Of course, this kind of trust may increase the risk of attack. 241 00:20:28,300 --> 00:20:30,600 A website may not have a security loop. 242 00:20:30,600 --> 00:20:32,380 But it has a security loop in the trust area. 243 00:20:32,380 --> 00: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. 244 00:20:42,620 --> 00:20:47,380 Here we find that there are two types of risk of trust. 245 00:20:49,220 --> 00:20:52,940 The first type is the HTTPS trust HTTP. 246 00:20:55,820 --> 00:21:00,860 HTTPS can provide confidential and complete protection for the network communication. 247 00:21:00,860 --> 00: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. 248 00:21:09,100 --> 00:21:21,280 But if an HTTPS website trusts an HTTP website, the attacker can first hijack the HTTP website. 249 00:21:21,280 --> 00:21:26,540 Then through the HTTP website, send a request to read the resources of the HTTPS website. 250 00:21:27,360 --> 00:21:30,520 Here is a diagram of the process. 251 00:21:31,740 --> 00:21:40,680 When the victim visits another website, the attacker enters an iframe and forces the victim to visit the HTTP example.com. 252 00:21:43,200 --> 00:21:49,600 Then the attacker hijacks the HTTP example.com and enters some malicious JavaScript. 253 00:21:51,280 --> 00:21:57,520 Then the JavaScript sends the request to the HTTPS server. 254 00:21:59,440 --> 00:22:03,140 The HTTPS server is obviously from the HTTP example.com. 255 00:22:03,140 --> 00:22:04,620 I trust it. 256 00:22:04,940 --> 00:22:07,340 It returns the resources. 257 00:22:08,600 --> 00:22:12,240 Then the attacker's JavaScript gets the content. 258 00:22:13,000 --> 00:22:16,460 Then it can send the content to the attacker. 259 00:22:16,460 --> 00:22:22,960 This is the effect of the middleman hijacking the HTTPS website. 260 00:22:24,580 --> 00:22:29,580 The second type of reliance, which is risky, is the reliance on other fields. 261 00:22:29,600 --> 00:22:33,300 For example, the reliance on all subsidiary fields. 262 00:22:35,000 --> 00:22:42,580 The danger of this is that a subsidiary field's CSS may affect the security of the main field. 263 00:22:43,280 --> 00:22:45,500 For example, we found a case here. 264 00:22:45,500 --> 00:22:47,320 This is mail.riu. 265 00:22:48,520 --> 00:22:54,160 Its main field has a very strong security defense. 266 00:22:54,160 --> 00:23:00,620 It deploys CSP, HTTP Owing, Cookie, to prevent this CSS and provide a loophole reward. 267 00:23:01,380 --> 00:23:06,520 But its subsidiary field does not deploy CSP and does not provide a loophole reward. 268 00:23:06,520 --> 00:23:08,440 So it is very easy to find a subsidiary field's CSS. 269 00:23:08,920 --> 00:23:10,900 But its main field trusts all subsidiary fields. 270 00:23:10,900 --> 00:23:20,060 So we found such a loophole to use this subsidiary field's CSS to read sensitive information on the main field. 271 00:23:22,160 --> 00:23:25,660 The second one is that it trusts the third party's domain. 272 00:23:25,660 --> 00:23:26,920 It may bring a security risk. 273 00:23:26,920 --> 00:23:32,680 As I just said, even if your domain is safe, it cannot guarantee that your information is not leaked. 274 00:23:32,680 --> 00:23:36,000 Because you may have a security problem with the third party's reliance. 275 00:23:36,740 --> 00:23:38,840 We found a case here. 276 00:23:39,200 --> 00:23:42,660 A Korean e-commerce website has expired its trusted domain name. 277 00:23:43,320 --> 00:23:49,940 The attacker can register the expired domain name to carry out the attack. 278 00:23:52,720 --> 00:23:56,840 The third problem is the complexity of the course strategy. 279 00:23:57,700 --> 00:24:02,520 We found that four types of course strategies are prone to misconfiguration. 280 00:24:04,940 --> 00: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. 281 00:24:16,980 --> 00: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. 282 00:24:30,020 --> 00:24:36,060 As for the misconfiguration of the course, there have been a lot of research by researchers. 283 00:24:36,060 --> 00:24:41,960 Here we summarize the previous research and find some new cases of misconfiguration. 284 00:24:44,020 --> 00:24:54,300 Let's watch a video on how to bypass the SOP limit to read the information on the SOHU video website. 285 00:24:55,920 --> 00:24:57,860 This loophole has been broken. 286 00:24:59,240 --> 00:25:01,020 So it has been fixed. 287 00:25:01,020 --> 00:25:03,520 Let's look at the SOHU video. 288 00:25:03,520 --> 00:25:09,540 This is a website of Alex Top, ranked 5th in China and 14th in the world. 289 00:25:14,590 --> 00:25:16,770 We can see that there is only one acquisition address in the acquisition address. 290 00:25:16,770 --> 00:25:17,210 Right ? 291 00:25:17,570 --> 00:25:18,590 Only one acquisition address. 292 00:25:18,970 --> 00:25:24,850 Then let's visit the attacker's evildoing.com. 293 00:25:24,850 --> 00:25:29,050 We find that it has become two acquisition addresses and can read the user's information. 294 00:25:29,050 --> 00:25:32,490 Let's see if it has become two user addresses. 295 00:25:32,490 --> 00:25:38,350 We find that it can not only read the user's information but also write information to the user's account. 296 00:25:39,810 --> 00:25:41,710 So this is a very serious hazard. 297 00:25:41,730 --> 00:25:45,350 Let's see why there is a misconfiguration of the course strategy. 298 00:25:45,350 --> 00:25:46,770 What may happen? 299 00:25:47,930 --> 00:25:55,150 First of all, the strategy of the course is that the access control alone origin allows the configuration of the value. 300 00:25:55,470 --> 00:25:56,990 There are two standards for the course. 301 00:25:56,990 --> 00:26:00,130 One is the W3C standard, and the other is the WG standard. 302 00:26:00,130 --> 00:26:04,470 The WG standard is a standard launched by several browser manufacturers. 303 00:26:04,810 --> 00:26:11,850 In the W3C standard, the access control alone origin can be an origin list, or a NOR, or a signal. 304 00:26:11,850 --> 00:26:18,390 But in the WG standard, it can only be a single origin, or a NOR, or a signal. 305 00:26:20,090 --> 00:26:25,310 And in all the browsers, all the browsers we tested followed the WG standard. 306 00:26:25,310 --> 00:26:31,250 That is to say, only such a configuration, a green configuration, is legal. 307 00:26:31,390 --> 00:26:34,990 And the other two configurations are all wrong. 308 00:26:37,850 --> 00:26:41,210 We found that many websites did not notice this. 309 00:26:42,110 --> 00:26:48,870 The issue of the origin configuration actually includes some large websites with the origin configuration. 310 00:26:49,570 --> 00:26:54,090 And although this configuration cannot cause security issues, it is indeed a misconfiguration. 311 00:26:58,760 --> 00:26:59,280 Uh... 312 00:27:00,740 --> 00:27:07,120 So, if a website wants to share data to multiple regions, what should it do? 313 00:27:08,440 --> 00:27:11,660 I just want to be able to share data to A.com and B.com at the same time. 314 00:27:11,660 --> 00:27:15,380 Then we must have a dynamic access control strategy. 315 00:27:17,060 --> 00:27:21,760 In this dynamic process, we found that in fact, security issues are very easy to occur. 316 00:27:22,360 --> 00:27:24,480 We have four types of security issues. 317 00:27:24,560 --> 00:27:26,340 The first type of security issue is... 318 00:27:26,340 --> 00:27:28,280 We have five types of security issues. 319 00:27:28,280 --> 00:27:29,860 The first type of security issue is... 320 00:27:29,860 --> 00:27:37,340 Many websites when configuring this configuration strategy, there is an example here, which is a configuration of NGX. 321 00:27:37,380 --> 00:27:41,700 Directly add this access control to this NGX. 322 00:27:41,700 --> 00:27:43,960 Alone origin, ATP origin. 323 00:27:45,620 --> 00:27:48,200 It is equivalent to reflection of any origin header. 324 00:27:48,200 --> 00:27:49,720 This can achieve the effect of functionality. 325 00:27:49,720 --> 00:27:54,300 However, the harm is that it trusts any language. 326 00:27:54,300 --> 00:27:57,060 It is equivalent to the SOP of the browser. 327 00:27:57,060 --> 00:27:58,040 It completely fails. 328 00:27:58,520 --> 00:28:00,740 Any language can be read directly. 329 00:28:02,700 --> 00:28:06,260 This configuration is also the highest in our discovery. 330 00:28:06,260 --> 00:28:08,860 is also the highest in our discovery. 331 00:28:08,860 --> 00:28:13,660 In 2016, someone did for X-top 1 million. 332 00:28:13,660 --> 00:28:14,320 a statistic for X-top 1 million. 333 00:28:14,320 --> 00:28:17,640 The result of the measurement is that there is a problem in each of the 10 websites that configure the course. 334 00:28:17,640 --> 00:28:18,240 that configure the course . 335 00:28:19,380 --> 00:28:26,540 And in our recent measurement, there is a configuration that comes out with this problem. 336 00:28:26,920 --> 00: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. 337 00:28:38,610 --> 00:28:43,270 The problem with the previous configuration is that it does not do any training. 338 00:28:43,290 --> 00:28:44,410 What is the origin header? 339 00:28:44,410 --> 00:28:46,230 What is the origin header I allow ? 340 00:28:46,330 --> 00: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 . 341 00:28:56,310 --> 00:28:58,190 whether it is the origin header For example, here is a configuration of NGX. 342 00:28:59,170 --> 00:29:01,890 Is this configuration safe? 343 00:29:04,570 --> 00:29:08,190 This is obviously not safe for us. 344 00:29:08,610 --> 00:29:12,670 It is that there is a lack of an end service at the last place . 345 00:29:13,070 --> 00:29:19,950 Then the attacker can add a .evil .com at the back .com to realize the bypassing strategy. 346 00:29:20,110 --> 00:29:25,370 The example we just demonstrated in the video is the example of the search video that made this mistake. 347 00:29:28,330 --> 00: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 . 348 00:29:36,230 --> 00:29:39,590 But they fixed this problem but did not fix it well. 349 00:29:39,590 --> 00:29:41,390 What is the reason for not fixing it well? 350 00:29:41,390 --> 00:29:44,790 The first error avoidance jumped into the second error pit. 351 00:29:46,910 --> 00:29:50,430 What is the second error pit? 352 00:29:50,470 --> 00:29:51,990 I can't see its misconfiguration . 353 00:29:51,990 --> 00:29:57,210 This is me on stackoverflow to see a configuration method recommended by others . 354 00:29:58,990 --> 00:30:05,250 I see this because the previous configuration said you do not have the example.com there is a security issue. 355 00:30:05,250 --> 00:30:09,550 Then I will check whether you are at the end of the example.com right? 356 00:30:10,890 --> 00:30:12,630 But this is also problematic. 357 00:30:12,630 --> 00:30:14,010 What may be the problem? 358 00:30:15,930 --> 00: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. 359 00:30:26,810 --> 00:30:28,650 So it is also not safe. 360 00:30:30,110 --> 00:30:34,290 We also reported this error pit to him. 361 00:30:37,410 --> 00:30:39,690 I haven't seen if it has been fixed. 362 00:30:39,710 --> 00:30:41,530 It was reported a few days ago. 363 00:30:46,510 --> 00:30:55,890 Then this did not transfer the last two types did not transfer this point. 364 00:30:55,890 --> 00:31:03,110 Many websites will check when they hold the origin they will use the positive expression to check. 365 00:31:04,130 --> 00:31:07,070 When they write the positive expression they did not transfer this point. 366 00:31:07,890 --> 00:31:10,510 This causes this point to be replaced by any alphabet. 367 00:31:12,570 --> 00:31:16,450 Because in the positive expression a point is a common match. 368 00:31:17,270 --> 00:31:19,850 So it can cause a security issue. 369 00:31:19,850 --> 00:31:24,450 We also found that there are websites that even have purple -wearing matching. 370 00:31:25,210 --> 00:31:33,670 We found that as long as the host from the origin is a self -proclaimed purple-wearing host, it is allowed. 371 00:31:38,730 --> 00:31:41,110 We talked about the five types of matching earlier. 372 00:31:47,070 --> 00:31:51,290 Then we will look at the second category of questions. 373 00:31:51,290 --> 00:31:53,610 The first one is the x-control we just talked about . 374 00:31:53,610 --> 00:32:05,470 There can be three types of questions in The first one is in 375 00:32:08,810 --> 00: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 . 376 00:32:23,690 --> 00:32:26,250 I will set it to this one. 377 00:32:26,770 --> 00:32:32,810 But it didn't define what is a private sensitive domain. 378 00:32:33,230 --> 00:32:35,350 Local documents are considered a private sensitive domain. 379 00:32:35,350 --> 00:32:36,450 Is there anything else? 380 00:32:38,150 --> 00:32:48,690 So when many websites are doing this hyper app, that is, when mixing apps, it allows this... 381 00:32:48,690 --> 00:32:53,830 Because the hyper app needs this ATM25 to do the interface. 382 00:32:54,670 --> 00:32:56,270 It will allow this... 383 00:32:56,270 --> 00:32:59,250 JavaScript will send a request directly from the local file. 384 00:32:59,250 --> 00:33:00,870 The output is a lore. 385 00:33:01,770 --> 00:33:04,470 It allows this lore to read. 386 00:33:04,470 --> 00:33:05,290 But it brings... 387 00:33:05,290 --> 00:33:10,890 We found that in the actual browser, this lore can be forged by any website. 388 00:33:12,490 --> 00:33:15,770 Through this iframe sandbox script. 389 00:33:17,510 --> 00:33:22,590 This means that all trustable lore websites are not safe. 390 00:33:22,590 --> 00:33:25,190 It is also a trustable website. 391 00:33:26,670 --> 00:33:30,850 The yellow one is our POC. 392 00:33:32,830 --> 00:33:37,550 This kind of lore example has also caused a lot of security issues in history. 393 00:33:37,630 --> 00:33:43,570 For example, in 2016, Facebook Messenger was discovered. 394 00:33:43,570 --> 00:33:48,170 Because of this trustable lore, any user can read it. 395 00:33:48,170 --> 00:33:54,450 And any attacker can read Facebook Messenger's chat message. 396 00:33:57,990 --> 00:33:59,590 The third category is... 397 00:33:59,850 --> 00:34:02,690 Let's see what kind of problems the signal might bring. 398 00:34:05,330 --> 00:34:09,550 The signal in the course allows any desire. 399 00:34:09,550 --> 00:34:11,030 It looks very intuitive. 400 00:34:11,030 --> 00:34:13,030 But it allows any desire. 401 00:34:13,030 --> 00:34:16,030 It is too loose. 402 00:34:16,490 --> 00:34:19,190 The course has another rule. 403 00:34:19,190 --> 00:34:22,050 The signal can't be used with Cookies. 404 00:34:22,050 --> 00:34:24,150 It can't be used at the same time. 405 00:34:24,830 --> 00:34:28,230 This means that the signal can only be shared in public. 406 00:34:28,230 --> 00:34:29,770 It doesn't need authentic resources. 407 00:34:29,770 --> 00:34:33,170 If you want to bring Cookies to visit this resource, you can't use the signal. 408 00:34:33,530 --> 00:34:35,810 And all browsers follow this standard. 409 00:34:35,810 --> 00:34:38,150 As long as you match this configuration, it is considered unsafe. 410 00:34:38,190 --> 00:34:41,870 It will refuse to say that this configuration is a false configuration. 411 00:34:42,550 --> 00:34:50,850 In the actual website, we found that many websites didn't notice that this configuration is a false configuration. 412 00:34:51,510 --> 00:34:54,090 Including some big websites. 413 00:34:54,650 --> 00:34:56,270 For example, security.harvard.edu. 414 00:34:56,270 --> 00:35:00,550 It is not the security department. 415 00:35:00,550 --> 00:35:03,550 It is the information security department of Harvard. 416 00:35:04,750 --> 00:35:06,630 There is still no configuration. 417 00:35:07,410 --> 00:35:09,290 The problem is that there is no configuration team. 418 00:35:13,670 --> 00:35:17,990 What is more interesting is that we found that there is a framework. 419 00:35:17,990 --> 00: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. 420 00:35:26,210 --> 00:35:29,030 The reflection-friendly orange we mentioned earlier is very dangerous. 421 00:35:31,470 --> 00:35:35,410 We tested 11 mainstream frameworks. 422 00:35:35,410 --> 00:35:36,530 We found that there are 8. 423 00:35:36,610 --> 00: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. 424 00:35:48,110 --> 00:35:51,290 The fourth problem is the security problem caused by the course and cache. 425 00:36:00,110 --> 00:36:03,470 For example, there is a resource server, c.com. 426 00:36:03,470 --> 00:36:08,570 It wants to share data with a.com and b.com at the same time. 427 00:36:09,350 --> 00: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. 428 00:36:23,250 --> 00:36:24,910 Then the user... 429 00:36:24,910 --> 00:36:28,430 But this response will be delayed by the middle cache. 430 00:36:28,870 --> 00:36:33,690 It may be a browser cache or a transparent cache in the middle. 431 00:36:36,960 --> 00:36:44,860 So if b.com also wants to visit the resources of c.com, but it will be detected by this cache. 432 00:36:46,360 --> 00:36:52,140 Then the feedback is to allow a.com to save the content before. 433 00:36:52,260 --> 00:36:55,660 This a.com obviously does not match the b.com issued by the request. 434 00:36:56,120 --> 00:36:59,080 This leads to the failure of the b.com in the later visit. 435 00:36:59,900 --> 00:37:04,340 This leads to a failure of the function of the course. 436 00:37:08,280 --> 00:37:14,780 For this kind of situation, the ATP protocol provides the VeryHeader to solve this problem. 437 00:37:14,780 --> 00: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. 438 00:37:23,960 --> 00:37:35,340 Of course, we found that many websites, when developing anti-cache control strategies, did not match the VeryOriginHeader. 439 00:37:41,640 --> 00:37:46,200 Now we have found a bunch of mis-configuration problems. 440 00:37:46,460 --> 00:37:49,500 Let's take a look at the real website. 441 00:37:49,500 --> 00:37:51,760 What kind of security problems may there be on the real website? 442 00:37:52,040 --> 00:37:54,080 What will the security situation be like? 443 00:37:54,860 --> 00:37:57,140 We are going to do a measurement in four parts. 444 00:37:57,800 --> 00:38:00,060 First, we select the target. 445 00:38:00,880 --> 00:38:10,280 We select a website with 50,000 AlexTurps as our measurement target, because it is a highly influential website. 446 00:38:11,320 --> 00:38:14,840 Then we extract their domain name from the 50,000 websites. 447 00:38:15,720 --> 00:38:18,140 We extracted 90 million domain names. 448 00:38:18,320 --> 00:38:21,800 The data comes from the passive DNS data provided by 360 Internet Security Union. 449 00:38:25,780 --> 00:38:32,300 Then we dynamically detect the configuration of the course for each domain name. 450 00:38:32,560 --> 00:38:35,840 Why do we have to detect it dynamically, instead of scanning it directly? 451 00:38:36,000 --> 00:38:43,400 Mainly because the anti-cache control strategy of the course does not return to each response directly. 452 00:38:43,420 --> 00:38:45,380 Because it needs to be dynamically generated. 453 00:38:45,660 --> 00:38:49,940 Only if your OriginHeader hits its anti-cache control strategy, will it return. 454 00:38:50,300 --> 00:38:55,320 If you don't have an OriginHeader, or OriginHeader does not hit its anti-cache control strategy, it will not return. 455 00:38:57,180 --> 00:38:59,880 So we need to take the initiative to detect it. 456 00:39:01,580 --> 00:39:09,260 For example, here we are going to detect if the service end has the configuration to allow NOR to visit. 457 00:39:09,260 --> 00:39:18,040 We set the OriginNOR in the request, and then see if it returns the access control, along OriginNOR, such a value. 458 00:39:20,340 --> 00:39:25,540 The result of the test is that we found that 480,000 domain names are configured to the course. 459 00:39:26,240 --> 00:39:29,270 Basically, it covers every website of X50,000. 460 00:39:32,220 --> 00:39:37,080 Among them, 130,000 are configured to have a problem, which is about 27.5%. 461 00:39:37,080 --> 00:39:42,820 So this problem is widespread on the Internet. 462 00:39:43,300 --> 00:39:44,040 This kind of... 463 00:39:44,920 --> 00:39:46,960 Electro 50,000 is relatively safe. 464 00:39:46,960 --> 00:39:50,160 Not to mention other websites that are not on this list. 465 00:39:53,260 --> 00:39:55,320 So how to prevent this kind of loophole? 466 00:39:56,360 --> 00:40:03,800 We reported all the security problems we found to the relevant manufacturers. 467 00:40:05,740 --> 00:40:08,200 Some manufacturers have already fixed it, such as Sohu. 468 00:40:08,200 --> 00:40:09,840 Some are still being fixed. 469 00:40:10,580 --> 00:40:14,300 For such a problem, how to prevent it? 470 00:40:14,440 --> 00:40:16,240 This problem is divided into two aspects. 471 00:40:16,240 --> 00:40:20,080 One is the overloading of the course. 472 00:40:20,160 --> 00:40:22,360 The other is the problem of read configuration. 473 00:40:22,800 --> 00:40:28,180 For overloading, we reported to the Chrome browser, Firefox browser. 474 00:40:28,180 --> 00: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. 475 00:40:40,100 --> 00:40:42,660 That is, cross-network is not allowed. 476 00:40:43,060 --> 00:40:45,020 Use the browser as a jump board to visit the internal network. 477 00:40:48,440 --> 00:40:52,280 As for the problem of misconfiguration, we found that... 478 00:40:52,800 --> 00:40:55,220 Of course, we can blame the developers for not noticing it. 479 00:40:55,220 --> 00:40:57,860 Of course, the developers have to bear a lot of responsibility. 480 00:40:57,940 --> 00:41:05,280 Another big responsibility is that the course has a lot of weird cases, such as the case of Nord. 481 00:41:06,300 --> 00:41:09,920 Many websites do not clearly write this standard. 482 00:41:10,140 --> 00:41:16,260 Many website developers do not know there is such a weird case. 483 00:41:16,260 --> 00:41:22,180 So it's best to clarify all kinds of security risks in this standard. 484 00:41:23,520 --> 00:41:31,660 And what the website manager can do is check if your course configuration has this problem. 485 00:41:31,780 --> 00:41:38,540 We provide a source tool, which is the course scanner. 486 00:41:39,860 --> 00:41:45,360 You can use this to scan a website to see if it is safe. 487 00:41:45,360 --> 00:41:47,700 This is a screenshot. 488 00:41:48,560 --> 00:41:54,520 We scanned the top 100 websites, and we found a lot of misconfiguration. 489 00:41:57,240 --> 00:42:00,360 You are welcome to download and use this tool. 490 00:42:00,780 --> 00:42:07,000 Since I used this tool, I don't find bugs every day at work. 491 00:42:07,000 --> 00:42:09,640 There are too many bugs, because there are too many misconfigurations. 492 00:42:09,640 --> 00:42:10,620 I can't handle it. 493 00:42:11,020 --> 00:42:12,820 So you are welcome to use this tool. 494 00:42:12,820 --> 00:42:17,920 You can definitely find a lot of security issues. 495 00:42:27,490 --> 00:42:34,430 To sum up, there are three types of problems with the course. 496 00:42:34,430 --> 00:42:39,810 The first one is that it may cause security issues for the internal network due to its too lenient forwarding . 497 00:42:39,810 --> 00:42:44,330 This is not detailed, but it is a very important contribution to our work. 498 00:42:44,330 --> 00:42:49,410 Maybe we will talk about this specific security issue in the next session. 499 00:42:49,410 --> 00:42:55,730 The second type of problem is that the course brings new people's dependence and new people's security risks. 500 00:42:55,730 --> 00:42:59,070 The third type is that there are a lot of corollary cases in the course. 501 00:43:00,670 --> 00:43:06,350 There are a lot of misconfigurations in the actual website , which brings new security issues. 502 00:43:07,030 --> 00:43:08,510 This is my report. 503 00:43:08,670 --> 00:43:09,350 Thank you.