1 00:00:00,660 --> 00:00:07,120 hello everyone welcome to our talk in this also zero days can hackers launch zero the rc attack 2 00:00:07,120 --> 00:00:13,440 on popular software only with chromium and this in this talk i will introduce how we use chromium 3 00:00:13,440 --> 00:00:19,520 and this pop-up operators in many popular software hoping to draw attention to browser 4 00:00:19,520 --> 00:00:26,560 security and application software this is our first defcon presentation let's introduce ourselves 5 00:00:26,560 --> 00:00:32,440 self first we are all security researchers at tyson security xuan lab i'm bohan liu 6 00:00:32,440 --> 00:00:39,340 made engaged in browser security i'm also a google chrome bug hunter and zhong wang is our 7 00:00:39,340 --> 00:00:45,980 co-speaker he made engaged in browser security and kernel security he found several bugs in 8 00:00:45,980 --> 00:00:52,300 apple safari linux kernel and virtualbox another cost speaker is going truly he is co-founder and 9 00:00:52,300 --> 00:00:56,040 the former captain of recapping ctft he previously 10 00:00:56,560 --> 00:00:58,940 worked on all kinds of software but this time he will focus on system and software security 11 00:00:58,940 --> 00:01:09,460 currently focus on rlm with security this there are six sections in this talk let's begin first is 12 00:01:09,460 --> 00:01:17,740 introduction as a browser security researcher i researched chromium bugs for avail and wrote many 13 00:01:17,740 --> 00:01:25,980 ending exploits and i can do a little reversing but i know little about web security give those 14 00:01:25,980 --> 00:01:26,540 skills as i said i just lost my main focus i'd like to show you a few of what's the most important 15 00:01:26,560 --> 00:01:29,940 Can I find zero DRC bugs in public software? 16 00:01:30,300 --> 00:01:33,560 And if so, what can I do to make this work easier? 17 00:01:34,360 --> 00:01:41,460 Now, let's take a look at how Chromium has been integrated into public software. 18 00:01:42,310 --> 00:01:49,820 Firstly, there is Chromium-based development, which includes default mobile browsers. 19 00:01:49,820 --> 00:01:56,340 Second, there are browser components for various programming languages. 20 00:01:56,660 --> 00:02:07,240 For example, the Electron framework is primarily used for software development in Node.js for C++, Java, and Dolphin languages. 21 00:02:07,760 --> 00:02:10,300 CEF is also a commonly used library. 22 00:02:10,600 --> 00:02:15,800 Additionally, the Qt Web Engine plugin is commonly used in Qt, 23 00:02:15,940 --> 00:02:19,800 and Chromium may also be present in other browsers. 24 00:02:19,820 --> 00:02:21,740 In addition, there are other popular subline chains. 25 00:02:22,040 --> 00:02:24,320 So, Chromium is everywhere in software. 26 00:02:25,480 --> 00:02:28,620 Based on data from CVE and Google Project Zero, 27 00:02:28,940 --> 00:02:35,920 Chrome may be found around 300 vulnerabilities with CVE ID each year. 28 00:02:36,280 --> 00:02:41,520 Of those, around 10 vulnerabilities each year are from in-the-wild attacks, 29 00:02:41,840 --> 00:02:47,380 and also many of those vulnerabilities can be transferred into RenderRC through detailed analysis. 30 00:02:47,380 --> 00:02:54,820 These vulnerabilities can also be introduced into popular software through the subline chain mentioned above. 31 00:02:55,720 --> 00:03:00,420 Google has an open attitude towards vulnerability disclosure, 32 00:03:00,840 --> 00:03:08,500 and the bug detail will be made public after being fixed for 40 weeks. 33 00:03:10,400 --> 00:03:14,300 With the bug detail and unit tests in patch, 34 00:03:14,460 --> 00:03:16,720 attackers can quickly make exploited code. 35 00:03:16,720 --> 00:03:21,980 Sometimes it's even a zero-debug for the stable version of Chrome itself. 36 00:03:22,400 --> 00:03:27,800 We strongly oppose the disclosure of vulnerability details before they are fixed. 37 00:03:28,120 --> 00:03:29,580 But it's hard to see. 38 00:03:29,680 --> 00:03:35,040 Hackers have a lot of priori knowledge for Chromium-based software attacks. 39 00:03:35,640 --> 00:03:40,540 Therefore, we conducted experiments on some popular software 40 00:03:40,540 --> 00:03:46,080 to see how long the introduction of those vulnerabilities can have an impact. 41 00:03:48,080 --> 00:03:52,640 Let's start with the definition of RCE window period. 42 00:03:53,040 --> 00:03:58,500 RCE window period equals the time the vulnerability was fixed in the software, 43 00:03:58,700 --> 00:04:01,740 minus the time the vulnerability was exploitable. 44 00:04:02,280 --> 00:04:06,880 Since it's hard to precisely determine the T exploitable, 45 00:04:07,160 --> 00:04:14,820 we used a new calculation method to roughly describe a software's RCE window period. 46 00:04:15,200 --> 00:04:16,700 The method is called RCE window period. 47 00:04:16,720 --> 00:04:17,660 RCE window period is called update gap, 48 00:04:17,880 --> 00:04:21,800 which is the time difference between the software's update time 49 00:04:21,800 --> 00:04:25,000 and its Chromium component update time. 50 00:04:25,140 --> 00:04:26,780 The larger the difference, 51 00:04:27,650 --> 00:04:32,520 the higher the likelihood of the software being exploitable during the period. 52 00:04:33,020 --> 00:04:37,900 In our experiment, we selected some popular software on the market, 53 00:04:38,720 --> 00:04:43,440 including Slack, Skype, Discord, and others. 54 00:04:43,440 --> 00:04:47,520 The experiment was divided into three steps. 55 00:04:47,940 --> 00:04:52,300 In the first step, we downloaded the software's old version through mirror state. 56 00:04:53,040 --> 00:04:58,200 The second step was to identify the browser component in the software, 57 00:04:58,420 --> 00:05:00,440 the version, and the release dates. 58 00:05:01,440 --> 00:05:07,560 In the sixth step, we calculated the update gap to describe the software's RCE window period. 59 00:05:07,780 --> 00:05:09,320 We used our database, 60 00:05:09,620 --> 00:05:12,940 which concludes over 200 POCs, 61 00:05:13,440 --> 00:05:15,580 to assess in testing. 62 00:05:16,100 --> 00:05:23,040 Those POCs were used to search for high-risk exploitable vulnerabilities during the period. 63 00:05:24,180 --> 00:05:27,160 The final results varied greatly, 64 00:05:27,460 --> 00:05:35,680 with different software having an update gap ranging from 9 to 800 days. 65 00:05:36,300 --> 00:05:41,780 Wavebox's Chromium component was relatively independent, 66 00:05:41,780 --> 00:05:44,180 and updated more frequently. 67 00:05:44,600 --> 00:05:49,380 On the other hand, Dropbox hardly updated its Chromium component. 68 00:05:49,820 --> 00:05:55,420 The rest of the software mainly used Electron or Libcf components, 69 00:05:55,840 --> 00:05:59,840 which most update periods over 90 days. 70 00:06:01,200 --> 00:06:04,720 Some software has a longer update period. 71 00:06:05,140 --> 00:06:10,940 Discord has an average update time of 305 days. 72 00:06:10,940 --> 00:06:16,780 The shortest update period is over 70 days. 73 00:06:17,000 --> 00:06:20,580 As a result, 90 versions has a long RCE period, 74 00:06:20,820 --> 00:06:25,980 which was demonstrated at Black Hat USA in 2022. 75 00:06:27,500 --> 00:06:29,800 Other software, such as Slack, 76 00:06:29,980 --> 00:06:31,580 has more frequent updates, 77 00:06:31,760 --> 00:06:35,280 with a packed period of 30 days. 78 00:06:35,560 --> 00:06:38,880 However, when it hit a zero-day disclosure, 79 00:06:39,320 --> 00:06:40,640 they didn't deal with it. 80 00:06:40,640 --> 00:06:43,020 For example, 81 00:06:43,300 --> 00:06:50,500 the Chromium zero-day bug was publicly disclosed on GitHub on April 2021, 82 00:06:51,000 --> 00:06:55,080 and Slack just released its new version the day before that day. 83 00:06:55,280 --> 00:07:00,500 However, it wasn't until June that the bug was patched. 84 00:07:00,560 --> 00:07:04,520 It has an RCE window period of almost two months. 85 00:07:05,560 --> 00:07:07,340 After analyzing updates, 86 00:07:07,620 --> 00:07:09,960 we have come to several conclusions. 87 00:07:10,340 --> 00:07:10,620 First, 88 00:07:10,640 --> 00:07:14,080 RCE window periods exist in most software, 89 00:07:14,360 --> 00:07:19,320 leaving attackers periods to find the ending bugs for the exploit. 90 00:07:19,940 --> 00:07:20,660 Second, 91 00:07:20,980 --> 00:07:24,860 software built on the Electron framework 92 00:07:24,860 --> 00:07:27,740 tend to have a shorter RCE window period 93 00:07:27,740 --> 00:07:31,120 due to the lower code company, 94 00:07:31,380 --> 00:07:33,920 which makes updates easier to implement. 95 00:07:34,720 --> 00:07:35,440 Finally, 96 00:07:35,620 --> 00:07:38,700 we have observed that many companies 97 00:07:38,700 --> 00:07:40,580 have increased their updates 98 00:07:40,640 --> 00:07:42,880 at specific times. 99 00:07:43,160 --> 00:07:44,100 However, 100 00:07:44,320 --> 00:07:45,580 even with those effects, 101 00:07:46,100 --> 00:07:48,560 RCE window periods still exist. 102 00:07:50,520 --> 00:07:54,380 Let's come to attack surface and vulnerability discovery. 103 00:07:54,960 --> 00:07:56,760 For desktop software, 104 00:07:57,020 --> 00:07:58,960 developers use browser components 105 00:07:58,960 --> 00:08:00,840 to display specific pages 106 00:08:00,840 --> 00:08:04,640 and trigger certain client-side behavior 107 00:08:05,240 --> 00:08:07,200 in specific scenarios, 108 00:08:07,640 --> 00:08:10,040 making client-side users 109 00:08:10,040 --> 00:08:12,820 more convenient and universal. 110 00:08:13,120 --> 00:08:13,760 However, 111 00:08:13,880 --> 00:08:14,660 for hackers, 112 00:08:14,880 --> 00:08:16,880 during the RCE window period, 113 00:08:17,220 --> 00:08:19,380 it's easy to launch 0-day RCE attacks 114 00:08:19,760 --> 00:08:21,680 when they can control the loaded page. 115 00:08:22,160 --> 00:08:26,100 This kind of attack has many advantages for hackers, 116 00:08:26,260 --> 00:08:31,640 such as having many exploits with end-day vulnerabilities 117 00:08:31,640 --> 00:08:35,340 and no domain-specific requirements. 118 00:08:35,760 --> 00:08:36,440 Therefore, 119 00:08:36,680 --> 00:08:39,320 all hackers need to fend is a situation 120 00:08:39,320 --> 00:08:42,020 where they can control the loading page. 121 00:08:42,420 --> 00:08:43,040 So, 122 00:08:43,180 --> 00:08:45,240 what are the scenarios 123 00:08:45,240 --> 00:08:47,780 that developers tend to overlook? 124 00:08:49,160 --> 00:08:50,760 The questions arise. 125 00:08:51,120 --> 00:08:54,360 What is the function of browser components? 126 00:08:55,000 --> 00:08:58,560 What code runs in the browser component? 127 00:08:59,360 --> 00:09:01,420 Let's start with how they are developed. 128 00:09:02,880 --> 00:09:04,340 For Electron, 129 00:09:04,540 --> 00:09:08,180 all codes are developed by Node.js. 130 00:09:09,320 --> 00:09:12,720 It is divided into main process and render process, 131 00:09:14,160 --> 00:09:16,360 commuted through IPC. 132 00:09:17,020 --> 00:09:19,720 All codes are stored in a resource folder, 133 00:09:19,960 --> 00:09:21,960 and there are less modifications 134 00:09:21,960 --> 00:09:24,220 to Electron framework code. 135 00:09:24,880 --> 00:09:25,660 So, 136 00:09:25,700 --> 00:09:29,080 it's easy to locate the source code. 137 00:09:29,360 --> 00:09:30,560 If compromised, 138 00:09:32,040 --> 00:09:36,520 we can also recover them from the ASAR format. 139 00:09:37,040 --> 00:09:39,000 As for debugging, 140 00:09:39,320 --> 00:09:43,760 since there are less modifications to Electron framework code, 141 00:09:43,920 --> 00:09:44,720 most of the time, 142 00:09:44,760 --> 00:09:47,800 we can just use command flags 143 00:09:47,800 --> 00:09:50,960 to open its internal development tools, 144 00:09:51,260 --> 00:09:54,700 like ESPCT or remote debugging ports, 145 00:09:54,920 --> 00:09:57,260 just like this flag. 146 00:09:57,960 --> 00:10:01,900 Debugtron is a universal Electron framework debugging tool. 147 00:10:02,220 --> 00:10:03,380 We can see here. 148 00:10:04,180 --> 00:10:07,860 It is also compiled in this method. 149 00:10:09,920 --> 00:10:12,520 CEF is another popular component. 150 00:10:12,900 --> 00:10:17,000 Here we use libcef C++ library as an example. 151 00:10:17,180 --> 00:10:21,160 From the perspective of development, 152 00:10:21,700 --> 00:10:24,180 the code impacted by developers 153 00:10:24,180 --> 00:10:26,760 is divided into two parts. 154 00:10:27,100 --> 00:10:29,660 The privileged API function 155 00:10:29,660 --> 00:10:32,740 impacted by C or C++ 156 00:10:32,740 --> 00:10:37,660 is used to impact client behaviors 157 00:10:37,660 --> 00:10:41,640 that can't be impacted by browser components. 158 00:10:42,020 --> 00:10:42,940 The other part 159 00:10:42,940 --> 00:10:45,200 is the local resource code 160 00:10:45,200 --> 00:10:47,480 impacted by the HTML, 161 00:10:47,940 --> 00:10:51,140 which is the code running in the browser component 162 00:10:51,190 --> 00:10:54,280 and used it to display the interface. 163 00:10:54,660 --> 00:10:57,560 In the development logic, 164 00:10:58,270 --> 00:11:00,000 it initialized first, 165 00:11:00,280 --> 00:11:04,240 and then registered passing 166 00:11:04,240 --> 00:11:06,060 and processing logic 167 00:11:06,060 --> 00:11:07,560 of the privileged domain, 168 00:11:07,840 --> 00:11:12,380 and then registered the privileged API function 169 00:11:12,380 --> 00:11:15,220 to form a JS object 170 00:11:15,220 --> 00:11:17,660 for the local resource code to call. 171 00:11:17,880 --> 00:11:18,900 And finally, 172 00:11:19,020 --> 00:11:20,440 the local resource 173 00:11:20,440 --> 00:11:24,220 from the perspective of the CEF library 174 00:11:24,220 --> 00:11:27,160 is actually a series of calls 175 00:11:27,160 --> 00:11:29,560 to exploit the function. 176 00:11:30,640 --> 00:11:32,100 For CEF, 177 00:11:32,700 --> 00:11:33,940 its features are 178 00:11:33,940 --> 00:11:41,080 it exists in the form of dynamic link library, 179 00:11:41,920 --> 00:11:44,880 and the use of CEF is more flexible 180 00:11:45,940 --> 00:11:48,280 and more checked before use. 181 00:11:49,080 --> 00:11:53,140 A privileged API is implied by C or C++, 182 00:11:53,480 --> 00:11:57,860 and the local resource code is implied by HTML. 183 00:11:58,780 --> 00:12:02,160 And the location of the local resource file 184 00:12:02,160 --> 00:12:03,040 is uncertain, 185 00:12:03,040 --> 00:12:05,560 and the file may be encrypted. 186 00:12:06,180 --> 00:12:06,860 So, 187 00:12:07,000 --> 00:12:09,480 are there any common debugging methods? 188 00:12:10,280 --> 00:12:10,680 Yes, 189 00:12:10,880 --> 00:12:13,960 you can hook the API in libcf 190 00:12:13,960 --> 00:12:16,360 and then get and modify what we want. 191 00:12:16,840 --> 00:12:18,080 For example, 192 00:12:18,180 --> 00:12:20,700 the developer will use 193 00:12:20,700 --> 00:12:24,740 cfstreamreader.create for file, 194 00:12:26,160 --> 00:12:27,300 cfzipreader.create 195 00:12:27,300 --> 00:12:29,980 or other functions to load the resource. 196 00:12:30,260 --> 00:12:32,700 We can get a field location, 197 00:12:32,700 --> 00:12:36,240 and decrypted password 198 00:12:36,240 --> 00:12:39,540 via hooking the info transfer 199 00:12:39,540 --> 00:12:41,300 between API functions, 200 00:12:41,680 --> 00:12:42,780 as shown here. 201 00:12:45,300 --> 00:12:46,400 As for debugging, 202 00:12:46,780 --> 00:12:48,720 although developers call CEF 203 00:12:48,720 --> 00:12:52,500 initialized with static conf parameters, 204 00:12:53,700 --> 00:12:56,620 we can still dynamically modify 205 00:12:56,620 --> 00:12:58,160 the remote debugging port. 206 00:12:58,300 --> 00:13:01,340 A parameter to gen develops 207 00:13:01,340 --> 00:13:03,400 capabilities by hook, 208 00:13:04,010 --> 00:13:06,280 and we can also build more powerful 209 00:13:06,280 --> 00:13:09,520 debug tools based on development mode. 210 00:13:11,210 --> 00:13:13,800 Let's take a look at some cases 211 00:13:13,970 --> 00:13:16,180 that developers can overlook. 212 00:13:16,580 --> 00:13:17,580 First is 213 00:13:17,580 --> 00:13:20,460 a whitelist of loaded load. 214 00:13:21,460 --> 00:13:24,620 Developers are only allowed 215 00:13:24,620 --> 00:13:27,320 to use the browser components 216 00:13:27,320 --> 00:13:29,380 to open specific pages, 217 00:13:29,560 --> 00:13:30,100 such as 218 00:13:30,100 --> 00:13:31,480 the official homepage. 219 00:13:31,760 --> 00:13:33,960 Other pages will be opened 220 00:13:33,960 --> 00:13:35,340 by default system browser, 221 00:13:35,660 --> 00:13:37,600 maybe completed by 222 00:13:37,600 --> 00:13:40,020 shell-execute-open. 223 00:13:40,940 --> 00:13:41,920 For example, 224 00:13:42,040 --> 00:13:45,340 scap has the same logic here. 225 00:13:46,220 --> 00:13:48,520 The first way to bypass check 226 00:13:48,520 --> 00:13:50,700 is the page redirection. 227 00:13:51,780 --> 00:13:53,560 Here are three main ways. 228 00:13:53,800 --> 00:13:55,500 Type link navigation, 229 00:13:56,720 --> 00:13:58,240 30X reduction, 230 00:13:58,240 --> 00:13:59,800 JavaScript navigation. 231 00:14:00,780 --> 00:14:02,720 Its principle is that 232 00:14:03,070 --> 00:14:04,440 this kind of check is 233 00:14:04,440 --> 00:14:06,700 when handling click, 234 00:14:06,960 --> 00:14:09,440 and then the page was loaded 235 00:14:09,440 --> 00:14:11,320 in Chromium component. 236 00:14:11,880 --> 00:14:15,720 And the subsequent jump in Chromium 237 00:14:15,720 --> 00:14:17,920 will no longer trick the check logic again. 238 00:14:18,240 --> 00:14:21,660 So SSO is a good pass tool, 239 00:14:21,960 --> 00:14:25,080 as shown in the figure on the right. 240 00:14:29,080 --> 00:14:32,140 The following is a demo 241 00:14:32,140 --> 00:14:33,640 that uses page redirection 242 00:14:33,640 --> 00:14:35,260 to imply RCE attack. 243 00:14:35,580 --> 00:14:37,400 It's an ARM software. 244 00:14:37,700 --> 00:14:39,240 For security region, 245 00:14:39,480 --> 00:14:41,160 all the software mentioned 246 00:14:41,160 --> 00:14:44,540 in this topic will not disclose 247 00:14:44,540 --> 00:14:45,920 the product information. 248 00:14:47,740 --> 00:14:49,240 Okay, after click, 249 00:14:49,440 --> 00:14:52,360 a calculator is here. 250 00:14:55,080 --> 00:14:56,760 Another point is 251 00:14:56,760 --> 00:14:57,380 check itself. 252 00:14:57,380 --> 00:15:01,400 Like an incorrect regular expression 253 00:15:01,400 --> 00:15:04,920 or an incorrect triple tag. 254 00:15:05,420 --> 00:15:07,300 This is another real-world case. 255 00:15:07,600 --> 00:15:08,980 The checker uses a long 256 00:15:08,980 --> 00:15:11,020 regular expression. 257 00:15:11,360 --> 00:15:12,800 They ask check GPT. 258 00:15:13,540 --> 00:15:14,700 And around here, 259 00:15:14,800 --> 00:15:15,940 it told me that 260 00:15:15,940 --> 00:15:18,260 there are many domains 261 00:15:18,260 --> 00:15:20,720 easily redressed by hackers 262 00:15:20,720 --> 00:15:21,740 can pass the check. 263 00:15:21,880 --> 00:15:22,560 For example, 264 00:15:24,180 --> 00:15:25,620 abcdjd.hk. 265 00:15:26,640 --> 00:15:27,360 Okay, 266 00:15:28,100 --> 00:15:29,720 this is the demo 267 00:15:29,720 --> 00:15:30,480 mentioned before. 268 00:15:30,800 --> 00:15:32,920 It's also an ARM software. 269 00:15:33,260 --> 00:15:35,640 After passing the check, 270 00:15:35,800 --> 00:15:36,740 URL check, 271 00:15:36,980 --> 00:15:38,380 we can easily load 272 00:15:38,380 --> 00:15:40,520 our HTML code. 273 00:15:40,740 --> 00:15:42,280 We can easily pop up 274 00:15:42,280 --> 00:15:42,840 the calculator. 275 00:15:46,020 --> 00:15:47,080 In addition, 276 00:15:47,240 --> 00:15:48,520 another point is 277 00:15:48,520 --> 00:15:51,100 the special URL handler. 278 00:15:51,480 --> 00:15:53,660 There are two main aspects. 279 00:15:54,040 --> 00:15:55,820 One is the scheme 280 00:15:55,820 --> 00:15:57,280 registered in the system. 281 00:15:57,280 --> 00:15:59,360 And the other is 282 00:15:59,360 --> 00:16:01,320 the custom domain registered 283 00:16:01,320 --> 00:16:03,120 in the browser component. 284 00:16:03,780 --> 00:16:06,440 This is their provided domain. 285 00:16:06,940 --> 00:16:09,340 It's easy to miss some check 286 00:16:09,340 --> 00:16:12,920 while operating in them. 287 00:16:14,960 --> 00:16:17,060 The follow is the demo 288 00:16:17,060 --> 00:16:17,940 using this method. 289 00:16:18,400 --> 00:16:19,720 We can see that 290 00:16:19,720 --> 00:16:23,780 ARM software is a vulnerable area 291 00:16:23,780 --> 00:16:26,000 in this development case. 292 00:16:27,900 --> 00:16:28,780 Okay. 293 00:16:33,760 --> 00:16:35,300 The next is 294 00:16:35,300 --> 00:16:36,440 a paid code injection. 295 00:16:37,340 --> 00:16:39,700 It's a classic top. 296 00:16:40,040 --> 00:16:41,640 But let's focus on 297 00:16:41,640 --> 00:16:43,600 the unique aspects of 298 00:16:43,600 --> 00:16:46,400 XSS in Chromium-based software. 299 00:16:46,840 --> 00:16:49,700 Here are three key differences. 300 00:16:50,220 --> 00:16:50,980 Firstly, 301 00:16:51,240 --> 00:16:52,500 XSS type. 302 00:16:53,040 --> 00:16:54,460 In web security, 303 00:16:54,460 --> 00:16:56,580 XSS typically includes 304 00:16:56,580 --> 00:16:58,480 reflective stored 305 00:16:58,480 --> 00:17:01,760 and DOM-based XSS. 306 00:17:02,080 --> 00:17:03,800 In Chromium-based software, 307 00:17:04,100 --> 00:17:07,420 resources are often stored locally. 308 00:17:07,620 --> 00:17:11,980 So XSS in this context 309 00:17:11,980 --> 00:17:13,640 is typically DOM-based. 310 00:17:14,400 --> 00:17:15,440 Secondly, 311 00:17:15,680 --> 00:17:17,580 this vulnerability 312 00:17:17,580 --> 00:17:18,840 discovery method 313 00:17:18,840 --> 00:17:20,800 in web security, 314 00:17:21,020 --> 00:17:22,300 the code that handle 315 00:17:22,300 --> 00:17:23,180 a user input 316 00:17:23,180 --> 00:17:24,700 is typically located 317 00:17:24,700 --> 00:17:26,580 on the server side. 318 00:17:27,740 --> 00:17:29,180 So the bug 319 00:17:29,180 --> 00:17:32,060 is discovered mainly through 320 00:17:32,060 --> 00:17:34,840 black-box testing. 321 00:17:35,260 --> 00:17:36,040 However, 322 00:17:36,200 --> 00:17:38,480 with the code location tools 323 00:17:38,480 --> 00:17:40,900 we previously developed, 324 00:17:41,280 --> 00:17:44,340 we can white-box code review 325 00:17:44,340 --> 00:17:45,920 in Chromium-based software. 326 00:17:46,920 --> 00:17:47,310 Thirdly, 327 00:17:47,720 --> 00:17:48,680 input source. 328 00:17:48,960 --> 00:17:50,600 In web security, 329 00:17:50,840 --> 00:17:52,880 input usually comes from 330 00:17:52,880 --> 00:17:54,280 URL parameters 331 00:17:54,780 --> 00:17:55,840 or the database. 332 00:17:56,080 --> 00:17:57,240 In Chromium-based software, 333 00:17:57,500 --> 00:17:59,440 there may be fewer 334 00:17:59,440 --> 00:18:00,840 URL parameters 335 00:18:00,840 --> 00:18:02,880 but more unique input sources 336 00:18:03,660 --> 00:18:05,420 which we will discuss 337 00:18:05,420 --> 00:18:07,460 in the next section. 338 00:18:08,280 --> 00:18:10,580 Based on those features, 339 00:18:10,860 --> 00:18:12,780 as a researcher 340 00:18:12,780 --> 00:18:14,280 who knows little 341 00:18:14,280 --> 00:18:15,360 about web security, 342 00:18:15,620 --> 00:18:17,160 I mainly use the following methods 343 00:18:17,160 --> 00:18:17,820 to discover 344 00:18:17,820 --> 00:18:19,880 XSS in local resources. 345 00:18:20,280 --> 00:18:20,980 Firstly, 346 00:18:21,120 --> 00:18:22,040 I use the tools 347 00:18:22,040 --> 00:18:23,060 we developed 348 00:18:23,060 --> 00:18:25,160 to decrypt 349 00:18:25,160 --> 00:18:26,200 local resources. 350 00:18:26,460 --> 00:18:27,080 Then, 351 00:18:27,180 --> 00:18:28,540 I identify 352 00:18:28,540 --> 00:18:30,340 the unprotected 353 00:18:30,340 --> 00:18:30,820 resources 354 00:18:30,820 --> 00:18:31,420 fields 355 00:18:31,420 --> 00:18:32,020 result 356 00:18:32,020 --> 00:18:33,400 CSP 357 00:18:33,400 --> 00:18:34,600 and filter 358 00:18:34,600 --> 00:18:35,340 out 359 00:18:35,340 --> 00:18:36,600 input point 360 00:18:36,600 --> 00:18:37,260 that 361 00:18:37,260 --> 00:18:38,620 can be controlled. 362 00:18:38,880 --> 00:18:39,360 Finally, 363 00:18:39,480 --> 00:18:40,060 I trace 364 00:18:40,060 --> 00:18:40,420 whether 365 00:18:40,930 --> 00:18:41,640 this input 366 00:18:41,640 --> 00:18:42,400 can trigger 367 00:18:42,400 --> 00:18:43,140 code injection. 368 00:18:43,760 --> 00:18:44,900 This image 369 00:18:44,900 --> 00:18:47,300 is a real-world 370 00:18:47,300 --> 00:18:47,600 case 371 00:18:47,600 --> 00:18:48,060 I found. 372 00:18:48,260 --> 00:18:49,280 I have 373 00:18:49,280 --> 00:18:50,040 abstracted 374 00:18:50,740 --> 00:18:51,560 the key code 375 00:18:51,560 --> 00:18:52,020 and 376 00:18:52,040 --> 00:18:52,940 you can see 377 00:18:52,940 --> 00:18:53,760 that the 378 00:18:53,760 --> 00:18:55,240 get-url-param 379 00:18:55,240 --> 00:18:56,000 function 380 00:18:56,000 --> 00:18:56,560 process 381 00:18:56,560 --> 00:18:57,660 the 382 00:18:57,660 --> 00:18:58,640 parameters 383 00:18:58,640 --> 00:18:59,500 in the URL 384 00:18:59,500 --> 00:19:00,340 and put them 385 00:19:00,790 --> 00:19:01,800 into the 386 00:19:01,800 --> 00:19:02,740 page 387 00:19:02,740 --> 00:19:03,620 using 388 00:19:03,620 --> 00:19:05,120 inner-HTML 389 00:19:05,120 --> 00:19:05,660 in two. 390 00:19:06,220 --> 00:19:06,960 Finally, 391 00:19:07,020 --> 00:19:07,620 leading to 392 00:19:07,620 --> 00:19:08,480 XSS. 393 00:19:10,870 --> 00:19:11,980 Another thing 394 00:19:13,760 --> 00:19:14,980 to note 395 00:19:14,980 --> 00:19:15,500 is that 396 00:19:15,970 --> 00:19:16,780 XSS vulnerability 397 00:19:16,780 --> 00:19:17,820 can also be 398 00:19:18,860 --> 00:19:19,230 inducted 399 00:19:19,600 --> 00:19:20,040 through 400 00:19:20,040 --> 00:19:21,080 the subline chain. 401 00:19:21,320 --> 00:19:22,020 For example, 402 00:19:22,040 --> 00:19:22,340 the 403 00:19:22,660 --> 00:19:24,040 ECU-2959 404 00:19:24,040 --> 00:19:24,540 of 405 00:19:24,540 --> 00:19:24,980 TypePro. 406 00:19:25,900 --> 00:19:26,320 Attackers 407 00:19:26,320 --> 00:19:27,060 can execute 408 00:19:27,060 --> 00:19:27,200 the 409 00:19:27,200 --> 00:19:27,780 JS code 410 00:19:27,780 --> 00:19:28,400 in TypePro 411 00:19:28,400 --> 00:19:29,340 by exploring 412 00:19:29,340 --> 00:19:31,600 XSS vulnerability 413 00:19:31,600 --> 00:19:32,400 in the 414 00:19:32,400 --> 00:19:33,540 mermaid 415 00:19:33,540 --> 00:19:34,380 library 416 00:19:34,380 --> 00:19:35,780 and 417 00:19:35,780 --> 00:19:36,200 then 418 00:19:36,200 --> 00:19:36,580 use 419 00:19:36,580 --> 00:19:36,760 the 420 00:19:36,760 --> 00:19:37,100 provided 421 00:19:37,100 --> 00:19:37,460 API 422 00:19:37,460 --> 00:19:38,180 to achieve 423 00:19:38,180 --> 00:19:38,660 RCE. 424 00:19:38,860 --> 00:19:40,040 We can also 425 00:19:40,040 --> 00:19:40,420 use 426 00:19:40,420 --> 00:19:40,680 the 427 00:19:40,680 --> 00:19:41,720 Chrome 428 00:19:41,720 --> 00:19:42,260 NDAB 429 00:19:42,260 --> 00:19:42,540 vulnerabilities 430 00:19:42,540 --> 00:19:43,100 from 431 00:19:43,100 --> 00:19:44,720 two years ago, 432 00:19:52,040 --> 00:19:52,120 to 433 00:19:52,120 --> 00:19:52,400 do 434 00:20:01,940 --> 00:20:02,740 the 435 00:20:02,740 --> 00:20:03,120 same 436 00:20:03,120 --> 00:20:03,440 thing 437 00:20:03,440 --> 00:20:03,660 as 438 00:20:03,660 --> 00:20:03,860 the 439 00:20:03,860 --> 00:20:04,420 provided 440 00:20:04,420 --> 00:20:04,880 API 441 00:20:04,880 --> 00:20:05,300 bug. 442 00:20:20,820 --> 00:20:21,620 Here 443 00:20:21,620 --> 00:20:22,020 is 444 00:20:22,020 --> 00:20:22,160 a 445 00:20:22,160 --> 00:20:22,920 very 446 00:20:27,120 --> 00:20:27,960 simple 447 00:20:27,960 --> 00:20:28,480 example 448 00:20:28,480 --> 00:20:28,740 of 449 00:20:28,740 --> 00:20:29,020 a 450 00:20:34,980 --> 00:20:36,400 RCE bug. 451 00:20:36,720 --> 00:20:37,380 The 452 00:20:37,380 --> 00:20:37,900 RCE bug 453 00:20:37,900 --> 00:20:38,120 is a 454 00:20:38,120 --> 00:20:38,180 very 455 00:20:38,180 --> 00:20:38,520 common 456 00:20:38,520 --> 00:20:38,560 bug 457 00:20:38,560 --> 00:20:39,420 in the 458 00:20:39,420 --> 00:20:39,440 web 459 00:20:39,440 --> 00:20:39,860 security 460 00:20:39,860 --> 00:20:40,340 because 461 00:20:40,340 --> 00:20:40,900 it 462 00:20:40,900 --> 00:20:41,320 can 463 00:20:41,660 --> 00:20:41,900 be 464 00:20:41,900 --> 00:20:42,500 exploited 465 00:20:42,500 --> 00:20:42,960 with 466 00:20:42,960 --> 00:20:43,300 XSS 467 00:20:43,300 --> 00:20:43,520 or 468 00:20:44,720 --> 00:20:45,560 specific 469 00:20:45,560 --> 00:20:46,260 domain 470 00:20:46,260 --> 00:20:46,680 need. 471 00:20:46,820 --> 00:20:47,660 We 472 00:20:47,660 --> 00:20:48,000 also 473 00:20:48,000 --> 00:20:48,680 found a 474 00:20:48,680 --> 00:20:49,460 RCE bug 475 00:20:49,460 --> 00:20:49,880 in a 476 00:20:49,880 --> 00:20:50,320 popular 477 00:20:50,320 --> 00:20:51,980 note-taking 478 00:20:51,980 --> 00:20:52,440 software 479 00:20:52,440 --> 00:20:52,940 using 480 00:20:52,940 --> 00:20:53,260 this 481 00:20:53,260 --> 00:20:53,560 trick. 482 00:20:54,240 --> 00:20:54,960 We 483 00:20:54,960 --> 00:20:55,280 would 484 00:20:55,280 --> 00:20:55,440 have 485 00:20:55,440 --> 00:20:56,680 liked 486 00:20:56,680 --> 00:20:56,900 to 487 00:20:56,900 --> 00:20:57,240 release 488 00:20:57,240 --> 00:20:58,300 it 489 00:20:58,300 --> 00:20:58,760 here 490 00:20:58,760 --> 00:20:59,220 as an 491 00:20:59,220 --> 00:20:59,700 example, 492 00:20:59,800 --> 00:21:00,300 but it's 493 00:21:00,300 --> 00:21:00,840 being 494 00:21:00,840 --> 00:21:01,320 fixed, 495 00:21:01,520 --> 00:21:02,300 so 496 00:21:02,300 --> 00:21:02,500 we 497 00:21:02,500 --> 00:21:02,840 can't 498 00:21:02,840 --> 00:21:03,300 disclose 499 00:21:03,300 --> 00:21:04,080 it 500 00:21:04,080 --> 00:21:04,440 here. 501 00:21:05,560 --> 00:21:06,280 For 502 00:21:06,280 --> 00:21:06,820 desktop 503 00:21:06,820 --> 00:21:08,060 software, 504 00:21:08,260 --> 00:21:09,160 it 505 00:21:09,160 --> 00:21:09,440 may 506 00:21:09,440 --> 00:21:09,820 face 507 00:21:09,820 --> 00:21:10,500 much 508 00:21:10,500 --> 00:21:11,060 more 509 00:21:11,060 --> 00:21:12,540 complex 510 00:21:12,540 --> 00:21:13,040 situations 511 00:21:13,040 --> 00:21:13,820 than a 512 00:21:13,820 --> 00:21:14,240 website, 513 00:21:14,520 --> 00:21:15,240 such as 514 00:21:15,240 --> 00:21:15,640 no 515 00:21:15,640 --> 00:21:16,280 network 516 00:21:16,280 --> 00:21:16,940 or 517 00:21:16,940 --> 00:21:17,960 speed 518 00:21:17,960 --> 00:21:18,580 requirements. 519 00:21:19,080 --> 00:21:20,080 This 520 00:21:20,080 --> 00:21:20,580 requires 521 00:21:20,580 --> 00:21:21,040 some 522 00:21:21,040 --> 00:21:21,720 local 523 00:21:21,720 --> 00:21:22,140 cache 524 00:21:22,140 --> 00:21:22,520 to 525 00:21:22,520 --> 00:21:22,980 solve 526 00:21:22,980 --> 00:21:23,180 this 527 00:21:23,180 --> 00:21:24,060 problem. 528 00:21:24,500 --> 00:21:25,120 When 529 00:21:25,120 --> 00:21:25,540 reading 530 00:21:25,540 --> 00:21:26,180 or 531 00:21:26,180 --> 00:21:26,960 writing 532 00:21:36,280 --> 00:21:36,360 this 533 00:21:36,360 --> 00:21:36,680 logic, 534 00:21:36,900 --> 00:21:37,420 the 535 00:21:37,420 --> 00:21:38,800 developers 536 00:21:38,800 --> 00:21:39,820 usually 537 00:21:39,820 --> 00:21:40,760 trust the 538 00:21:40,760 --> 00:21:41,120 cache 539 00:21:41,120 --> 00:21:41,780 and don't 540 00:21:41,780 --> 00:21:42,260 check it 541 00:21:42,260 --> 00:21:42,600 again 542 00:21:42,600 --> 00:21:44,140 when 543 00:21:44,140 --> 00:21:45,000 updating 544 00:21:45,000 --> 00:21:45,440 or 545 00:21:45,440 --> 00:21:45,900 loading 546 00:21:45,900 --> 00:21:46,140 it. 547 00:21:47,420 --> 00:21:48,300 Cache 548 00:21:48,300 --> 00:21:48,520 data 549 00:21:48,520 --> 00:21:48,920 can 550 00:21:48,920 --> 00:21:49,400 exist 551 00:21:49,400 --> 00:21:50,060 locally 552 00:21:50,060 --> 00:21:50,380 in 553 00:21:50,380 --> 00:21:50,820 various 554 00:21:50,820 --> 00:21:52,020 forms, 555 00:21:52,200 --> 00:21:53,640 such as 556 00:21:53,640 --> 00:21:54,100 database 557 00:21:54,100 --> 00:21:55,200 JSON 558 00:21:55,200 --> 00:21:55,800 or 559 00:21:55,800 --> 00:21:56,600 custom 560 00:21:56,600 --> 00:21:57,860 format. 561 00:21:58,620 --> 00:21:59,280 So, 562 00:22:10,100 --> 00:22:10,800 if 563 00:22:10,800 --> 00:22:10,960 you 564 00:22:12,160 --> 00:22:12,860 want 565 00:22:15,200 --> 00:22:15,900 Cache 566 00:22:15,900 --> 00:22:16,000 Data 567 00:22:16,000 --> 00:22:16,380 store 568 00:22:16,380 --> 00:22:16,900 Cache 569 00:22:16,900 --> 00:22:17,220 Data, 570 00:22:17,300 --> 00:22:17,760 you 571 00:22:17,760 --> 00:22:17,940 can 572 00:22:17,940 --> 00:22:18,120 see 573 00:22:18,120 --> 00:22:18,340 that 574 00:22:18,340 --> 00:22:18,880 when 575 00:22:18,880 --> 00:22:19,080 the 576 00:22:19,080 --> 00:22:19,640 database 577 00:22:19,640 --> 00:22:20,100 content 578 00:22:20,100 --> 00:22:20,780 is 579 00:22:20,780 --> 00:22:21,300 modified, 580 00:22:22,620 --> 00:22:23,320 there 581 00:22:23,320 --> 00:22:23,580 are 582 00:22:23,580 --> 00:22:23,840 no 583 00:22:23,840 --> 00:22:24,180 valid 584 00:22:24,180 --> 00:22:24,380 data 585 00:22:24,380 --> 00:22:24,680 checks 586 00:22:24,680 --> 00:22:25,040 on 587 00:22:25,040 --> 00:22:25,180 the 588 00:22:25,180 --> 00:22:25,620 data 589 00:22:26,180 --> 00:22:26,840 when 590 00:22:26,840 --> 00:22:27,960 it's 591 00:22:27,960 --> 00:22:28,200 loaded, 592 00:22:28,340 --> 00:22:28,700 allowing 593 00:22:28,700 --> 00:22:29,360 any 594 00:22:29,360 --> 00:22:29,920 FRIM 595 00:22:29,920 --> 00:22:30,920 to be 596 00:22:30,920 --> 00:22:31,640 inserted. 597 00:22:33,760 --> 00:22:34,940 Here is 598 00:22:34,940 --> 00:22:35,300 another 599 00:22:35,300 --> 00:22:36,120 interesting 600 00:22:36,120 --> 00:22:36,660 example. 601 00:22:36,980 --> 00:22:37,240 In a 602 00:22:37,240 --> 00:22:37,540 certain 603 00:22:37,540 --> 00:22:38,040 application, 604 00:22:38,380 --> 00:22:38,720 I found 605 00:22:38,720 --> 00:22:39,700 that when 606 00:22:39,700 --> 00:22:40,500 three-party 607 00:22:40,500 --> 00:22:41,040 components 608 00:22:41,040 --> 00:22:41,800 were 609 00:22:41,800 --> 00:22:43,260 added, 610 00:22:43,540 --> 00:22:44,000 the 611 00:22:44,000 --> 00:22:44,240 app 612 00:22:44,240 --> 00:22:44,860 inserted 613 00:22:44,860 --> 00:22:45,320 an 614 00:22:45,320 --> 00:22:45,980 FRIM 615 00:22:45,980 --> 00:22:46,320 here 616 00:22:46,320 --> 00:22:47,400 into 617 00:22:47,400 --> 00:22:47,600 the 618 00:22:48,120 --> 00:22:48,640 page. 619 00:22:49,360 --> 00:22:49,880 But 620 00:22:49,880 --> 00:22:50,240 the 621 00:22:51,680 --> 00:22:52,720 SRC 622 00:22:52,720 --> 00:22:53,220 attribute 623 00:22:54,360 --> 00:22:54,880 is 624 00:22:55,060 --> 00:22:55,580 strictly 625 00:22:55,580 --> 00:22:56,340 displayed 626 00:22:56,340 --> 00:22:56,720 here. 627 00:22:56,940 --> 00:22:57,860 But 628 00:22:57,860 --> 00:22:58,820 in the 629 00:22:58,820 --> 00:22:59,620 local 630 00:22:59,620 --> 00:23:00,260 cache, 631 00:23:00,500 --> 00:23:00,880 I found 632 00:23:00,880 --> 00:23:01,620 a custom 633 00:23:02,840 --> 00:23:03,880 property 634 00:23:03,880 --> 00:23:04,480 called 635 00:23:04,480 --> 00:23:05,240 HF. 636 00:23:06,280 --> 00:23:07,320 I 637 00:23:07,320 --> 00:23:07,880 modified 638 00:23:07,880 --> 00:23:08,580 it to 639 00:23:08,580 --> 00:23:09,440 access 640 00:23:09,440 --> 00:23:09,900 code 641 00:23:09,900 --> 00:23:10,420 and 642 00:23:10,420 --> 00:23:10,860 reopen 643 00:23:10,860 --> 00:23:11,340 the 644 00:23:11,340 --> 00:23:12,320 program. 645 00:23:12,760 --> 00:23:13,960 The page 646 00:23:17,400 --> 00:23:17,540 is 647 00:23:17,560 --> 00:23:18,140 which 648 00:23:18,140 --> 00:23:18,440 means 649 00:23:18,440 --> 00:23:18,740 that 650 00:23:18,740 --> 00:23:19,280 we 651 00:23:19,280 --> 00:23:19,920 bypassed 652 00:23:19,920 --> 00:23:19,960 the 653 00:23:19,960 --> 00:23:20,320 check 654 00:23:20,320 --> 00:23:21,160 by modifying 655 00:23:21,160 --> 00:23:21,540 the 656 00:23:21,540 --> 00:23:21,880 local 657 00:23:21,880 --> 00:23:22,180 cache. 658 00:23:23,900 --> 00:23:24,520 When 659 00:23:26,700 --> 00:23:27,320 I 660 00:23:27,320 --> 00:23:28,040 assessed 661 00:23:28,040 --> 00:23:28,340 the 662 00:23:28,340 --> 00:23:28,660 web 663 00:23:28,660 --> 00:23:29,040 version 664 00:23:29,040 --> 00:23:29,220 of 665 00:23:29,220 --> 00:23:29,440 this 666 00:23:29,440 --> 00:23:29,680 app, 667 00:23:29,800 --> 00:23:30,140 I found 668 00:23:30,140 --> 00:23:30,300 that 669 00:23:30,300 --> 00:23:30,780 the 670 00:23:30,780 --> 00:23:30,940 web 671 00:23:30,940 --> 00:23:31,220 page 672 00:23:31,220 --> 00:23:31,560 also 673 00:23:31,560 --> 00:23:32,580 changes 674 00:23:32,580 --> 00:23:33,020 to 675 00:23:47,400 --> 00:23:47,460 the 676 00:23:50,120 --> 00:23:51,000 local 677 00:23:51,000 --> 00:23:51,400 Therefore, 678 00:23:51,680 --> 00:23:52,500 by using 679 00:23:52,500 --> 00:23:52,860 the 680 00:23:53,000 --> 00:23:53,440 code 681 00:23:53,440 --> 00:23:54,360 injection, 682 00:23:54,820 --> 00:23:55,860 we bypassed 683 00:23:55,860 --> 00:23:56,300 the validation 684 00:23:56,300 --> 00:23:57,360 and 685 00:23:57,360 --> 00:23:58,120 achieved 686 00:23:58,120 --> 00:23:58,820 RCE. 687 00:23:59,120 --> 00:24:00,240 And further, 688 00:24:00,460 --> 00:24:01,300 we 689 00:24:01,300 --> 00:24:02,300 polluted 690 00:24:02,300 --> 00:24:02,580 the 691 00:24:02,580 --> 00:24:03,000 server, 692 00:24:03,120 --> 00:24:03,440 which 693 00:24:03,440 --> 00:24:04,040 can lead 694 00:24:04,040 --> 00:24:04,620 to more 695 00:24:04,620 --> 00:24:05,280 remote 696 00:24:05,280 --> 00:24:05,800 attacks. 697 00:24:08,580 --> 00:24:09,460 Okay. 698 00:24:09,620 --> 00:24:10,480 Some 699 00:24:10,480 --> 00:24:11,020 applications 700 00:24:11,020 --> 00:24:11,860 also 701 00:24:11,860 --> 00:24:12,140 allow 702 00:24:12,140 --> 00:24:12,660 developers 703 00:24:12,660 --> 00:24:13,100 to 704 00:24:17,400 --> 00:24:17,700 use 705 00:24:17,700 --> 00:24:18,100 more 706 00:24:19,160 --> 00:24:20,040 convenient 707 00:24:20,040 --> 00:24:20,740 extension 708 00:24:20,740 --> 00:24:21,300 functions. 709 00:24:22,080 --> 00:24:23,040 Software gives 710 00:24:23,040 --> 00:24:24,440 developers 711 00:24:24,440 --> 00:24:25,500 more 712 00:24:25,500 --> 00:24:26,580 functionality, 713 00:24:27,000 --> 00:24:27,260 but 714 00:24:27,260 --> 00:24:28,400 plugins 715 00:24:29,020 --> 00:24:29,480 usually 716 00:24:29,480 --> 00:24:30,160 need to be 717 00:24:30,160 --> 00:24:30,600 officially 718 00:24:30,600 --> 00:24:31,340 reviewed 719 00:24:31,340 --> 00:24:31,800 before 720 00:24:31,800 --> 00:24:32,260 putting 721 00:24:32,260 --> 00:24:32,700 on the 722 00:24:32,700 --> 00:24:33,060 store. 723 00:24:33,500 --> 00:24:34,320 With the 724 00:24:34,320 --> 00:24:35,640 browser 725 00:24:35,640 --> 00:24:36,100 components, 726 00:24:36,560 --> 00:24:37,020 hackers 727 00:24:37,020 --> 00:24:37,820 may use 728 00:24:37,820 --> 00:24:38,140 it to 729 00:24:38,140 --> 00:24:38,460 bypass 730 00:24:38,460 --> 00:24:39,700 plugin 731 00:24:39,700 --> 00:24:40,220 reviews. 732 00:24:40,560 --> 00:24:41,240 For example, 733 00:24:41,240 --> 00:24:42,380 when a 734 00:24:42,380 --> 00:24:43,140 plugin 735 00:24:43,140 --> 00:24:43,880 is reviewed, 736 00:24:44,100 --> 00:24:44,460 the page 737 00:24:44,460 --> 00:24:44,960 in the 738 00:24:44,960 --> 00:24:45,900 plugin 739 00:24:45,900 --> 00:24:46,640 is a 740 00:24:46,640 --> 00:24:47,080 normal 741 00:24:47,080 --> 00:24:47,440 page. 742 00:24:48,000 --> 00:24:49,000 But when 743 00:24:49,000 --> 00:24:49,380 it is 744 00:24:49,380 --> 00:24:49,940 put on 745 00:24:49,940 --> 00:24:50,240 the 746 00:24:50,240 --> 00:24:50,800 market, 747 00:24:51,060 --> 00:24:51,300 the 748 00:24:51,300 --> 00:24:52,380 website 749 00:24:52,380 --> 00:24:53,700 is redirected 750 00:24:53,700 --> 00:24:54,060 to a 751 00:24:54,060 --> 00:24:54,380 page 752 00:24:54,380 --> 00:24:54,620 with 753 00:24:54,620 --> 00:24:55,220 expired 754 00:24:55,220 --> 00:24:55,680 code, 755 00:24:55,880 --> 00:24:56,620 thereby 756 00:24:56,620 --> 00:24:57,400 realizing 757 00:24:57,400 --> 00:24:57,860 a 758 00:24:57,860 --> 00:24:58,560 water 759 00:24:58,560 --> 00:24:59,640 hole 760 00:24:59,640 --> 00:24:59,960 attack. 761 00:25:01,860 --> 00:25:02,520 The 762 00:25:02,520 --> 00:25:02,920 following 763 00:25:03,230 --> 00:25:04,080 is an 764 00:25:04,080 --> 00:25:05,360 example of 765 00:25:05,360 --> 00:25:06,280 IntelliG 766 00:25:06,280 --> 00:25:07,260 IDEA 767 00:25:07,260 --> 00:25:08,160 software. 768 00:25:08,560 --> 00:25:09,220 The 769 00:25:09,220 --> 00:25:09,920 Medicare 770 00:25:09,920 --> 00:25:11,140 plugin is 771 00:25:11,140 --> 00:25:11,580 loaded, 772 00:25:11,780 --> 00:25:12,520 and attackers 773 00:25:12,520 --> 00:25:13,380 can use 774 00:25:13,380 --> 00:25:13,980 the browser 775 00:25:13,980 --> 00:25:14,500 component 776 00:25:14,500 --> 00:25:14,980 to 777 00:25:14,980 --> 00:25:15,620 achieve 778 00:25:15,620 --> 00:25:16,180 RCE. 779 00:25:17,780 --> 00:25:18,680 So, 780 00:25:18,740 --> 00:25:19,560 when a 781 00:25:19,560 --> 00:25:20,020 plugin 782 00:25:20,020 --> 00:25:20,380 is 783 00:25:20,380 --> 00:25:20,860 reviewed, 784 00:25:21,180 --> 00:25:21,960 it is 785 00:25:21,960 --> 00:25:22,600 necessary 786 00:25:22,600 --> 00:25:23,180 to pay 787 00:25:23,180 --> 00:25:24,040 attention 788 00:25:24,040 --> 00:25:24,580 to the 789 00:25:24,580 --> 00:25:25,360 URL in 790 00:25:25,360 --> 00:25:25,520 it. 791 00:25:26,520 --> 00:25:27,480 Now, 792 00:25:27,580 --> 00:25:28,020 in the 793 00:25:28,020 --> 00:25:28,360 video, 794 00:25:28,480 --> 00:25:28,680 we 795 00:25:28,680 --> 00:25:29,340 load 796 00:25:29,340 --> 00:25:29,620 the 797 00:25:29,620 --> 00:25:30,100 plugin. 798 00:25:45,160 --> 00:25:46,120 Okay. 799 00:25:49,440 --> 00:25:49,920 Some 800 00:25:50,080 --> 00:25:50,560 functions 801 00:25:51,200 --> 00:25:51,680 may 802 00:25:51,680 --> 00:25:52,040 have 803 00:25:52,040 --> 00:25:53,120 arbitrary 804 00:25:54,380 --> 00:25:54,860 page 805 00:25:55,520 --> 00:25:55,900 processing 806 00:25:55,900 --> 00:25:56,180 process, 807 00:25:56,200 --> 00:25:56,900 such as 808 00:25:56,900 --> 00:25:57,060 the 809 00:25:57,060 --> 00:25:57,660 preventing 810 00:25:57,660 --> 00:25:58,280 of 811 00:25:58,280 --> 00:25:59,280 crawlers 812 00:25:59,280 --> 00:25:59,840 or 813 00:25:59,840 --> 00:26:00,140 nodes. 814 00:26:00,520 --> 00:26:01,440 For 815 00:26:01,440 --> 00:26:01,940 example, 816 00:26:02,040 --> 00:26:02,320 the 817 00:26:02,320 --> 00:26:02,560 was 818 00:26:02,560 --> 00:26:03,500 found 819 00:26:03,500 --> 00:26:03,700 a 820 00:26:03,700 --> 00:26:04,220 RCE 821 00:26:04,220 --> 00:26:04,560 bug 822 00:26:04,560 --> 00:26:04,840 in 823 00:26:04,840 --> 00:26:05,360 a 824 00:26:05,360 --> 00:26:06,620 passive 825 00:26:06,620 --> 00:26:07,440 scanning 826 00:26:07,440 --> 00:26:07,940 function 827 00:26:07,940 --> 00:26:08,460 in 828 00:26:08,460 --> 00:26:09,380 2021. 829 00:26:11,300 --> 00:26:12,340 Now, 830 00:26:12,340 --> 00:26:13,640 our 831 00:26:13,640 --> 00:26:14,320 co- 832 00:26:14,320 --> 00:26:14,900 speaker 833 00:26:14,900 --> 00:26:15,480 will 834 00:26:15,480 --> 00:26:16,400 give 835 00:26:25,520 --> 00:26:25,740 you 836 00:26:25,740 --> 00:26:26,280 I will 837 00:26:26,280 --> 00:26:26,640 finish 838 00:26:26,640 --> 00:26:27,460 the 839 00:26:27,460 --> 00:26:28,340 last 840 00:26:28,340 --> 00:26:28,680 part. 841 00:26:29,480 --> 00:26:30,500 Given the 842 00:26:30,500 --> 00:26:30,760 short 843 00:26:30,760 --> 00:26:31,320 duration 844 00:26:31,320 --> 00:26:31,760 of 845 00:26:31,760 --> 00:26:32,380 RCE window 846 00:26:32,380 --> 00:26:32,700 period, 847 00:26:33,140 --> 00:26:33,800 it is 848 00:26:33,800 --> 00:26:34,520 crucial to 849 00:26:34,520 --> 00:26:34,920 develop 850 00:26:34,920 --> 00:26:35,540 its 851 00:26:35,540 --> 00:26:35,840 voice 852 00:26:35,840 --> 00:26:36,360 quickly. 853 00:26:36,580 --> 00:26:37,480 When it 854 00:26:37,480 --> 00:26:38,260 comes to 855 00:26:38,260 --> 00:26:38,560 type 856 00:26:38,560 --> 00:26:39,640 vulnerabilities, 857 00:26:40,200 --> 00:26:41,020 a common 858 00:26:41,020 --> 00:26:41,520 technique 859 00:26:41,520 --> 00:26:42,360 is to 860 00:26:42,360 --> 00:26:42,640 use 861 00:26:42,640 --> 00:26:43,180 optimized 862 00:26:43,180 --> 00:26:43,860 functions 863 00:26:43,860 --> 00:26:45,060 to create 864 00:26:46,220 --> 00:26:46,620 inconsistencies 865 00:26:46,620 --> 00:26:47,160 that 866 00:26:47,160 --> 00:26:47,660 ultimately 867 00:26:47,660 --> 00:26:48,560 lead to 868 00:26:48,560 --> 00:26:48,820 type 869 00:26:48,820 --> 00:26:49,240 confusion. 870 00:26:49,580 --> 00:26:50,200 However, 871 00:26:50,540 --> 00:26:51,040 for 872 00:26:51,040 --> 00:26:51,280 use 873 00:26:51,280 --> 00:26:51,480 number 874 00:26:51,480 --> 00:26:51,840 three 875 00:26:51,840 --> 00:26:52,100 bugs, 876 00:26:52,500 --> 00:26:52,900 there 877 00:26:52,900 --> 00:26:53,320 doesn't 878 00:26:53,320 --> 00:26:53,520 seem 879 00:26:53,520 --> 00:26:53,920 to be 880 00:26:53,920 --> 00:26:54,060 a 881 00:26:54,060 --> 00:26:54,400 publicly 882 00:26:54,400 --> 00:26:55,640 universal 883 00:26:55,640 --> 00:26:56,260 exploit 884 00:26:56,260 --> 00:26:56,920 method. 885 00:26:57,440 --> 00:26:57,900 Here, 886 00:26:58,080 --> 00:26:58,460 we 887 00:26:58,460 --> 00:26:58,980 propose 888 00:26:58,980 --> 00:26:59,320 a 889 00:27:12,060 --> 00:27:12,580 solution 890 00:27:13,100 --> 00:27:13,280 Let's 891 00:27:13,280 --> 00:27:13,640 start 892 00:27:13,640 --> 00:27:14,160 by 893 00:27:14,160 --> 00:27:14,700 discussing 894 00:27:14,700 --> 00:27:15,140 some 895 00:27:15,140 --> 00:27:15,660 relevant 896 00:27:15,660 --> 00:27:16,660 background 897 00:27:16,660 --> 00:27:17,260 knowledge. 898 00:27:17,560 --> 00:27:18,080 We 899 00:27:18,080 --> 00:27:18,340 know 900 00:27:18,340 --> 00:27:20,000 garbage 901 00:27:20,000 --> 00:27:20,400 collection 902 00:27:20,400 --> 00:27:22,060 recycles 903 00:27:22,060 --> 00:27:22,560 objects 904 00:27:22,560 --> 00:27:23,400 from 905 00:27:23,400 --> 00:27:23,600 the 906 00:27:23,600 --> 00:27:23,840 young 907 00:27:23,840 --> 00:27:24,380 generation, 908 00:27:24,540 --> 00:27:25,240 which 909 00:27:25,240 --> 00:27:25,780 divides 910 00:27:25,780 --> 00:27:26,820 memory 911 00:27:41,520 --> 00:27:41,640 and 912 00:27:41,640 --> 00:27:42,000 copies 913 00:27:42,000 --> 00:27:42,340 them 914 00:27:42,340 --> 00:27:43,080 from the 915 00:27:43,080 --> 00:27:43,620 from space 916 00:27:43,620 --> 00:27:44,540 to the 917 00:27:44,540 --> 00:27:45,060 to space, 918 00:27:45,320 --> 00:27:46,100 updating 919 00:27:46,100 --> 00:27:46,720 object 920 00:27:46,720 --> 00:27:47,420 pointers. 921 00:27:47,880 --> 00:27:48,660 Then, 922 00:27:48,760 --> 00:27:49,180 the 923 00:27:49,180 --> 00:27:50,220 from space 924 00:27:50,220 --> 00:27:50,880 and 925 00:27:50,880 --> 00:27:51,800 to space 926 00:27:51,800 --> 00:27:52,920 are swapped, 927 00:27:53,140 --> 00:27:54,020 and the 928 00:27:54,020 --> 00:27:54,740 next round 929 00:27:54,740 --> 00:27:55,540 of garbage 930 00:27:55,540 --> 00:27:55,920 collection 931 00:27:55,920 --> 00:27:56,440 is 932 00:27:56,440 --> 00:27:56,860 performed. 933 00:27:57,420 --> 00:27:58,000 During 934 00:27:58,000 --> 00:27:58,840 scavenging, 935 00:28:00,000 --> 00:28:00,900 there is 936 00:28:00,900 --> 00:28:01,360 also 937 00:28:01,360 --> 00:28:01,700 an 938 00:28:01,700 --> 00:28:02,520 additional 939 00:28:02,520 --> 00:28:03,240 set of 940 00:28:03,240 --> 00:28:03,460 root 941 00:28:03,460 --> 00:28:04,100 objects, 942 00:28:04,340 --> 00:28:05,260 which are 943 00:28:05,260 --> 00:28:06,560 pointers from 944 00:28:06,560 --> 00:28:07,240 old space 945 00:28:07,240 --> 00:28:08,440 to new space 946 00:28:08,440 --> 00:28:09,000 objects, 947 00:28:09,340 --> 00:28:10,160 where it 948 00:28:10,160 --> 00:28:11,040 uses 949 00:28:11,040 --> 00:28:12,260 red barriers 950 00:28:12,260 --> 00:28:13,240 to track 951 00:28:13,240 --> 00:28:14,240 these references. 952 00:28:15,850 --> 00:28:16,420 When the 953 00:28:16,420 --> 00:28:17,180 garbage collection 954 00:28:17,990 --> 00:28:18,400 identifies 955 00:28:18,930 --> 00:28:19,340 relevant 956 00:28:19,340 --> 00:28:20,000 references 957 00:28:20,000 --> 00:28:20,920 in the 958 00:28:20,920 --> 00:28:21,460 old space, 959 00:28:21,780 --> 00:28:22,360 it does 960 00:28:22,360 --> 00:28:23,320 not reclaim 961 00:28:23,320 --> 00:28:24,080 the objects 962 00:28:24,080 --> 00:28:24,940 in the 963 00:28:24,940 --> 00:28:25,380 new space. 964 00:28:26,660 --> 00:28:27,900 Here is 965 00:28:27,900 --> 00:28:28,080 a 966 00:28:28,080 --> 00:28:28,500 Chrome 967 00:28:28,500 --> 00:28:28,880 issue 968 00:28:32,880 --> 00:28:33,760 101307610. 969 00:28:34,800 --> 00:28:35,480 This was 970 00:28:35,480 --> 00:28:36,220 caused by 971 00:28:36,220 --> 00:28:37,080 a missing red 972 00:28:37,080 --> 00:28:37,500 barrier 973 00:28:37,500 --> 00:28:39,000 when generating 974 00:28:39,000 --> 00:28:39,740 the last index 975 00:28:39,740 --> 00:28:40,280 object 976 00:28:40,280 --> 00:28:41,380 for a 977 00:28:41,380 --> 00:28:41,640 red 978 00:28:41,640 --> 00:28:42,280 expression 979 00:28:42,280 --> 00:28:42,900 object. 980 00:28:43,360 --> 00:28:44,160 When last 981 00:28:44,160 --> 00:28:44,420 index 982 00:28:44,420 --> 00:28:45,060 acts 983 00:28:45,060 --> 00:28:45,500 the 984 00:28:45,500 --> 00:28:46,420 SMI 985 00:28:46,420 --> 00:28:46,760 range 986 00:28:46,760 --> 00:28:47,320 and 987 00:28:47,320 --> 00:28:47,520 the 988 00:28:47,520 --> 00:28:48,200 red 989 00:28:48,200 --> 00:28:48,640 expression 990 00:28:48,640 --> 00:28:49,160 is 991 00:28:49,160 --> 00:28:49,420 in 992 00:28:49,420 --> 00:28:49,720 the 993 00:28:58,880 --> 00:28:59,200 red 994 00:28:59,200 --> 00:28:59,720 space, 995 00:28:59,720 --> 00:28:59,940 reclaimable 996 00:28:59,940 --> 00:29:00,600 due to 997 00:29:00,600 --> 00:29:00,800 the 998 00:29:00,800 --> 00:29:01,080 lack 999 00:29:01,080 --> 00:29:01,420 of 1000 00:29:01,420 --> 00:29:01,920 reference 1001 00:29:01,920 --> 00:29:02,340 information, 1002 00:29:02,760 --> 00:29:03,680 resulting 1003 00:29:03,680 --> 00:29:04,420 in a 1004 00:29:04,420 --> 00:29:04,740 use 1005 00:29:04,740 --> 00:29:04,900 of 1006 00:29:04,900 --> 00:29:05,800 free 1007 00:29:05,800 --> 00:29:07,180 vulnerability. 1008 00:29:08,800 --> 00:29:09,640 In 1009 00:29:09,640 --> 00:29:10,020 V8, 1010 00:29:10,300 --> 00:29:11,020 there is 1011 00:29:11,020 --> 00:29:11,540 a type 1012 00:29:11,540 --> 00:29:11,740 of 1013 00:29:11,740 --> 00:29:12,240 string 1014 00:29:12,240 --> 00:29:12,660 called 1015 00:29:12,660 --> 00:29:13,820 1-byte 1016 00:29:13,820 --> 00:29:14,920 internalized 1017 00:29:14,920 --> 00:29:15,340 string. 1018 00:29:15,760 --> 00:29:16,400 Its 1019 00:29:16,400 --> 00:29:17,180 memory layout 1020 00:29:17,180 --> 00:29:17,800 is as 1021 00:29:17,800 --> 00:29:18,180 follows. 1022 00:29:19,180 --> 00:29:20,040 From front 1023 00:29:20,040 --> 00:29:20,620 to back, 1024 00:29:20,760 --> 00:29:21,500 there are 1025 00:29:21,500 --> 00:29:21,620 the 1026 00:29:21,620 --> 00:29:22,660 object's 1027 00:29:22,660 --> 00:29:23,060 map, 1028 00:29:23,260 --> 00:29:23,860 hash, 1029 00:29:24,180 --> 00:29:25,160 string length 1030 00:29:25,160 --> 00:29:25,800 and the 1031 00:29:25,800 --> 00:29:26,300 string's 1032 00:29:26,300 --> 00:29:26,680 content. 1033 00:29:27,740 --> 00:29:28,760 The core 1034 00:29:28,760 --> 00:29:29,860 idea we used 1035 00:29:29,860 --> 00:29:30,560 was to 1036 00:29:30,560 --> 00:29:31,100 forge a 1037 00:29:31,100 --> 00:29:31,480 string 1038 00:29:31,480 --> 00:29:32,440 with an 1039 00:29:32,440 --> 00:29:33,000 extremely 1040 00:29:33,000 --> 00:29:33,460 large 1041 00:29:33,460 --> 00:29:33,820 length 1042 00:29:33,820 --> 00:29:34,740 and place 1043 00:29:34,740 --> 00:29:35,420 the target 1044 00:29:35,420 --> 00:29:35,940 object 1045 00:29:35,940 --> 00:29:37,200 after the 1046 00:29:37,200 --> 00:29:37,500 string 1047 00:29:37,500 --> 00:29:38,240 in memory. 1048 00:29:38,240 --> 00:29:39,020 Then, 1049 00:29:39,240 --> 00:29:40,180 we can use 1050 00:29:40,180 --> 00:29:40,680 the search 1051 00:29:40,680 --> 00:29:41,580 method of 1052 00:29:41,580 --> 00:29:41,960 the string 1053 00:29:41,960 --> 00:29:42,660 to find 1054 00:29:42,660 --> 00:29:43,180 the address 1055 00:29:43,180 --> 00:29:44,000 of the 1056 00:29:44,000 --> 00:29:44,740 target object 1057 00:29:44,740 --> 00:29:45,920 after the 1058 00:29:45,920 --> 00:29:46,160 mark. 1059 00:29:47,020 --> 00:29:47,700 Thus, 1060 00:29:47,900 --> 00:29:48,640 we can 1061 00:29:48,640 --> 00:29:49,220 construct 1062 00:29:49,220 --> 00:29:50,020 the 1063 00:29:50,020 --> 00:29:50,340 address 1064 00:29:50,340 --> 00:29:50,760 of 1065 00:29:50,760 --> 00:29:51,920 primitive. 1066 00:29:53,600 --> 00:29:54,280 Using 1067 00:29:54,280 --> 00:29:54,640 the same 1068 00:29:54,640 --> 00:29:55,060 technique, 1069 00:29:55,500 --> 00:29:56,200 we can 1070 00:29:56,200 --> 00:29:56,720 place 1071 00:29:56,720 --> 00:29:56,980 a 1072 00:29:56,980 --> 00:29:57,280 JS 1073 00:29:57,280 --> 00:29:57,620 array 1074 00:29:57,620 --> 00:29:58,360 after 1075 00:29:58,360 --> 00:29:58,700 the 1076 00:29:58,700 --> 00:29:59,040 fixed 1077 00:29:59,040 --> 00:29:59,300 string. 1078 00:29:59,780 --> 00:30:00,440 By using 1079 00:30:00,440 --> 00:30:01,120 the string's 1080 00:30:01,120 --> 00:30:01,960 auto-bound 1081 00:30:01,960 --> 00:30:02,240 spread, 1082 00:30:02,560 --> 00:30:03,240 we can 1083 00:30:03,240 --> 00:30:04,060 modify the 1084 00:30:04,060 --> 00:30:04,720 elements 1085 00:30:04,720 --> 00:30:05,900 member of 1086 00:30:05,900 --> 00:30:06,080 the 1087 00:30:06,080 --> 00:30:06,340 JS 1088 00:30:06,340 --> 00:30:06,720 array 1089 00:30:06,720 --> 00:30:07,720 to point 1090 00:30:07,720 --> 00:30:08,820 to arbitrary 1091 00:30:08,820 --> 00:30:09,420 address 1092 00:30:09,420 --> 00:30:10,660 and achieve 1093 00:30:10,660 --> 00:30:11,220 arbitrary 1094 00:30:11,220 --> 00:30:11,700 memory 1095 00:30:11,700 --> 00:30:12,220 read 1096 00:30:12,220 --> 00:30:12,780 and write. 1097 00:30:14,620 --> 00:30:15,560 To fix 1098 00:30:15,560 --> 00:30:15,940 such a 1099 00:30:15,940 --> 00:30:16,220 string, 1100 00:30:16,500 --> 00:30:17,160 we need 1101 00:30:17,160 --> 00:30:17,900 to create 1102 00:30:17,900 --> 00:30:18,600 a fixed 1103 00:30:18,600 --> 00:30:19,060 string map. 1104 00:30:19,300 --> 00:30:19,920 We 1105 00:30:19,920 --> 00:30:20,200 used 1106 00:30:20,200 --> 00:30:21,320 this map 1107 00:30:29,040 --> 00:30:29,140 large 1108 00:30:29,140 --> 00:30:29,440 number 1109 00:30:29,440 --> 00:30:30,080 of array 1110 00:30:30,080 --> 00:30:30,380 buffer 1111 00:30:30,380 --> 00:30:30,960 objects 1112 00:30:30,960 --> 00:30:32,100 to obtain 1113 00:30:32,100 --> 00:30:32,820 a stable 1114 00:30:32,820 --> 00:30:33,300 address 1115 00:30:33,300 --> 00:30:34,440 and then 1116 00:30:34,440 --> 00:30:35,120 forge the 1117 00:30:35,120 --> 00:30:35,520 necessary 1118 00:30:35,520 --> 00:30:36,080 members 1119 00:30:36,080 --> 00:30:37,200 of the 1120 00:30:37,200 --> 00:30:37,740 string map 1121 00:30:37,740 --> 00:30:38,300 at this 1122 00:30:38,300 --> 00:30:38,620 address. 1123 00:30:39,120 --> 00:30:39,760 Finally, 1124 00:30:39,960 --> 00:30:40,840 we place 1125 00:30:40,840 --> 00:30:41,340 the fixed 1126 00:30:41,340 --> 00:30:41,640 string 1127 00:30:41,640 --> 00:30:42,360 in a 1128 00:30:42,360 --> 00:30:42,640 JS 1129 00:30:42,640 --> 00:30:43,000 array 1130 00:30:43,000 --> 00:30:44,720 and allocate 1131 00:30:44,720 --> 00:30:45,460 a large 1132 00:30:45,460 --> 00:30:45,740 number 1133 00:30:45,740 --> 00:30:46,360 of JS 1134 00:30:46,360 --> 00:30:46,680 array 1135 00:30:46,680 --> 00:30:47,080 objects 1136 00:30:59,040 --> 00:30:59,740 on the 1137 00:30:59,740 --> 00:31:00,000 right. 1138 00:31:01,780 --> 00:31:03,120 Here is 1139 00:31:03,120 --> 00:31:03,680 a demonstration 1140 00:31:03,680 --> 00:31:04,760 video of 1141 00:31:04,760 --> 00:31:05,500 our successful 1142 00:31:06,040 --> 00:31:06,580 exploration 1143 00:31:06,580 --> 00:31:07,820 in Chrome 1144 00:31:07,820 --> 00:31:08,100 version 1145 00:31:08,100 --> 00:31:08,740 91. 1146 00:31:22,140 --> 00:31:22,980 So, 1147 00:31:23,220 --> 00:31:24,140 as for 1148 00:31:24,140 --> 00:31:25,360 Chromium-based 1149 00:31:25,360 --> 00:31:25,680 software, 1150 00:31:26,040 --> 00:31:26,920 we found 1151 00:31:26,920 --> 00:31:27,760 firstly, 1152 00:31:29,040 --> 00:31:29,300 a bug 1153 00:31:29,300 --> 00:31:29,760 or feature 1154 00:31:29,760 --> 00:31:30,520 can lead 1155 00:31:30,520 --> 00:31:31,620 to RCE attack. 1156 00:31:32,040 --> 00:31:32,820 Secondly, 1157 00:31:33,060 --> 00:31:33,800 there is 1158 00:31:33,800 --> 00:31:34,200 a leak 1159 00:31:34,200 --> 00:31:34,960 of attention 1160 00:31:34,960 --> 00:31:35,540 to the 1161 00:31:35,540 --> 00:31:35,920 attacked 1162 00:31:35,920 --> 00:31:36,500 path 1163 00:31:36,500 --> 00:31:37,900 of browser 1164 00:31:37,900 --> 00:31:38,520 vulnerabilities 1165 00:31:38,520 --> 00:31:39,300 now. 1166 00:31:39,540 --> 00:31:40,160 So, 1167 00:31:40,280 --> 00:31:40,860 the attack 1168 00:31:40,860 --> 00:31:41,220 surface 1169 00:31:41,220 --> 00:31:42,680 is relatively 1170 00:31:42,680 --> 00:31:44,320 rudimentary 1171 00:31:44,320 --> 00:31:45,520 and hackers 1172 00:31:45,520 --> 00:31:46,380 also can 1173 00:31:46,380 --> 00:31:46,700 bypass 1174 00:31:46,700 --> 00:31:47,240 mitigation 1175 00:31:47,240 --> 00:31:48,220 directly 1176 00:31:48,220 --> 00:31:48,880 using 1177 00:31:48,880 --> 00:31:49,400 powerful 1178 00:31:49,400 --> 00:31:50,180 Chromium 1179 00:31:50,180 --> 00:31:50,480 bugs. 1180 00:31:52,600 --> 00:31:53,460 This 1181 00:31:53,460 --> 00:31:54,360 section is 1182 00:31:54,360 --> 00:31:54,840 about 1183 00:31:55,220 --> 00:31:55,920 how to 1184 00:31:55,920 --> 00:31:56,400 achieve 1185 00:31:56,400 --> 00:31:57,140 RCE attack 1186 00:31:57,140 --> 00:31:57,780 without 1187 00:31:57,780 --> 00:31:58,460 sandbox 1188 00:31:58,460 --> 00:31:59,020 escape 1189 00:31:59,020 --> 00:31:59,500 bug. 1190 00:32:00,240 --> 00:32:01,500 The sandbox 1191 00:32:01,500 --> 00:32:02,380 is a 1192 00:32:02,380 --> 00:32:02,920 security 1193 00:32:02,920 --> 00:32:03,360 protection 1194 00:32:03,360 --> 00:32:04,780 mechanism 1195 00:32:04,780 --> 00:32:05,920 of 1196 00:32:05,920 --> 00:32:06,680 Chromium. 1197 00:32:06,860 --> 00:32:07,960 Even if 1198 00:32:07,960 --> 00:32:08,480 a hacker 1199 00:32:08,480 --> 00:32:08,980 gets 1200 00:32:08,980 --> 00:32:09,360 the 1201 00:32:09,360 --> 00:32:09,700 random 1202 00:32:09,700 --> 00:32:10,100 RCE, 1203 00:32:10,380 --> 00:32:11,020 he still 1204 00:32:11,020 --> 00:32:11,440 cannot 1205 00:32:11,440 --> 00:32:12,120 get the 1206 00:32:12,120 --> 00:32:12,400 full 1207 00:32:12,400 --> 00:32:13,100 execution 1208 00:32:13,100 --> 00:32:13,820 permission. 1209 00:32:14,340 --> 00:32:15,540 This includes 1210 00:32:15,540 --> 00:32:17,020 mandatory 1211 00:32:17,540 --> 00:32:18,820 access-controlled 1212 00:32:18,820 --> 00:32:19,380 environment, 1213 00:32:19,800 --> 00:32:20,740 isolated 1214 00:32:20,740 --> 00:32:21,520 process 1215 00:32:21,520 --> 00:32:22,360 when 1216 00:32:22,360 --> 00:32:23,080 HTML 1217 00:32:23,080 --> 00:32:24,360 rendering 1218 00:32:24,360 --> 00:32:25,420 and JavaScript 1219 00:32:25,420 --> 00:32:26,360 execution. 1220 00:32:26,820 --> 00:32:28,080 And finally, 1221 00:32:28,280 --> 00:32:28,880 the 1222 00:32:29,060 --> 00:32:29,760 limited 1223 00:32:29,760 --> 00:32:30,720 resource 1224 00:32:30,720 --> 00:32:31,240 access 1225 00:32:31,240 --> 00:32:32,160 and 1226 00:32:32,160 --> 00:32:32,860 limited 1227 00:32:33,180 --> 00:32:33,780 IPC 1228 00:32:33,780 --> 00:32:34,580 or Chromium 1229 00:32:34,580 --> 00:32:34,880 interaction 1230 00:32:34,880 --> 00:32:35,660 access. 1231 00:32:36,100 --> 00:32:36,920 The end 1232 00:32:36,920 --> 00:32:37,700 day of 1233 00:32:37,700 --> 00:32:38,060 sandbox 1234 00:32:38,060 --> 00:32:38,560 escape 1235 00:32:38,560 --> 00:32:39,420 is much 1236 00:32:39,420 --> 00:32:39,760 less 1237 00:32:39,760 --> 00:32:40,580 than 1238 00:32:40,580 --> 00:32:41,260 the end 1239 00:32:45,540 --> 00:32:45,800 day of 1240 00:32:45,800 --> 00:32:46,400 enable 1241 00:32:46,400 --> 00:32:46,900 software 1242 00:32:46,900 --> 00:32:47,960 without 1243 00:32:47,960 --> 00:32:48,440 a 1244 00:32:48,440 --> 00:32:48,940 Chromium 1245 00:32:48,940 --> 00:32:49,340 sandbox 1246 00:32:49,340 --> 00:32:50,000 escape 1247 00:32:50,000 --> 00:32:50,360 bug. 1248 00:32:52,540 --> 00:32:53,560 First, 1249 00:32:53,740 --> 00:32:53,960 let's 1250 00:32:53,960 --> 00:32:54,160 see 1251 00:32:54,160 --> 00:32:54,740 what's 1252 00:32:54,740 --> 00:32:54,840 the 1253 00:32:54,840 --> 00:32:55,320 difference 1254 00:32:55,320 --> 00:32:55,960 between 1255 00:32:55,960 --> 00:32:56,380 Chrome 1256 00:32:56,380 --> 00:32:56,840 build's 1257 00:32:56,840 --> 00:32:57,520 Chromium 1258 00:32:57,520 --> 00:32:57,940 based 1259 00:32:57,940 --> 00:32:58,340 software 1260 00:32:58,340 --> 00:32:59,320 and 1261 00:32:59,320 --> 00:32:59,920 Chrome 1262 00:32:59,920 --> 00:33:00,920 browser. 1263 00:33:01,920 --> 00:33:02,940 The 1264 00:33:02,940 --> 00:33:04,540 one 1265 00:33:04,540 --> 00:33:05,180 is 1266 00:33:05,180 --> 00:33:06,140 privileged 1267 00:33:06,140 --> 00:33:06,680 API. 1268 00:33:20,380 --> 00:33:21,220 It's 1269 00:33:21,220 --> 00:33:21,640 very 1270 00:33:21,640 --> 00:33:22,120 easy 1271 00:33:22,120 --> 00:33:22,300 to 1272 00:33:22,300 --> 00:33:22,560 access 1273 00:33:23,880 --> 00:33:24,720 in 1274 00:33:26,220 --> 00:33:26,980 It's 1275 00:33:26,980 --> 00:33:27,540 quite 1276 00:33:30,300 --> 00:33:31,140 easy 1277 00:33:31,140 --> 00:33:31,260 to 1278 00:33:37,080 --> 00:33:37,920 access 1279 00:33:37,920 --> 00:33:39,060 the 1280 00:33:39,060 --> 00:33:39,240 object 1281 00:33:40,540 --> 00:33:41,380 that 1282 00:33:41,380 --> 00:33:42,500 you 1283 00:33:42,500 --> 00:33:42,700 want 1284 00:33:42,700 --> 00:33:43,120 use. 1285 00:33:43,280 --> 00:33:44,080 It's 1286 00:33:44,080 --> 00:33:44,480 a 1287 00:33:44,480 --> 00:33:44,560 very 1288 00:33:44,560 --> 00:33:44,920 easy 1289 00:33:44,920 --> 00:33:44,940 way 1290 00:33:44,940 --> 00:33:44,960 to 1291 00:33:44,960 --> 00:33:44,980 access 1292 00:33:44,980 --> 00:33:53,260 a code, we can execute the implemented handler in the browser process through IPC call. 1293 00:33:54,520 --> 00:34:01,760 Based on this idea, there are usually two implementation logic for the privileged API. 1294 00:34:02,200 --> 00:34:08,940 The first one checks the URL loaded by the browser component when it is initialized. 1295 00:34:08,940 --> 00:34:15,560 If it is a specific domain, register the privileged API in the loaded context. 1296 00:34:16,140 --> 00:34:21,420 At runtime, only the privileged domain can obtain the JavaScript object. 1297 00:34:21,860 --> 00:34:31,000 So when we call in some function from this API, the browser process calls it without checking the source domain. 1298 00:34:31,800 --> 00:34:38,860 The second logic is to register the privileged API object no matter what domain it is at. 1299 00:34:38,940 --> 00:34:48,040 And then the developer can check the domain when the privileged API is called. 1300 00:34:48,800 --> 00:34:51,220 There are some problems with both methods. 1301 00:34:51,520 --> 00:34:58,220 For the first one, whatever non-privileged webview gets a privileged context. 1302 00:34:58,720 --> 00:35:05,720 For the second one, how to properly check the IPC access is from privileged domain. 1303 00:35:07,500 --> 00:35:08,920 The research shows that, 1304 00:35:08,940 --> 00:35:13,820 in August 2018, 1305 00:35:15,180 --> 00:35:19,100 Maestro shared research on context isolation, 1306 00:35:19,580 --> 00:35:25,280 which is used to isolate the context between the renderer process and preload. 1307 00:35:25,540 --> 00:35:28,380 If this configuration is disabled, 1308 00:35:28,740 --> 00:35:31,780 even with sandbox protection enabled, 1309 00:35:32,160 --> 00:35:37,060 the renderer process can also call privileged functions 1310 00:35:37,060 --> 00:35:39,680 exported from preload, 1311 00:35:39,860 --> 00:35:44,900 such as shell.open external function. 1312 00:35:45,180 --> 00:35:48,300 At Black Hat Asia in 2019, 1313 00:35:48,760 --> 00:35:51,580 Luca shared his research on preload. 1314 00:35:51,800 --> 00:35:53,940 He discovered that, 1315 00:35:54,080 --> 00:35:56,540 even with sandbox protection enabled, 1316 00:35:56,980 --> 00:36:06,620 preload.js may still access certain native node classes and some elastron modules. 1317 00:36:06,620 --> 00:36:13,460 Attackers can use prototype solution to execute arbitrary IPC calls. 1318 00:36:14,540 --> 00:36:18,700 At Black Hat USA in 2022, 1319 00:36:19,240 --> 00:36:24,540 a sandbox bypass method was demonstrated when the renderer process 1320 00:36:24,540 --> 00:36:30,280 could load the preload.js file in a child file frame 1321 00:36:30,280 --> 00:36:36,520 by overwriting the node integration in subframe member. 1322 00:36:39,940 --> 00:36:46,640 We can also overwrite the preload context isolation 1323 00:36:46,640 --> 00:36:51,140 and disable CISO in new renderer process. 1324 00:36:51,540 --> 00:36:58,340 Then we can send an unauthorized IPC call with prototype solution. 1325 00:36:59,840 --> 00:37:04,880 We also found some interesting and wide-ranging issues 1326 00:37:04,880 --> 00:37:06,500 with the second model. 1327 00:37:06,500 --> 00:37:09,580 But since the renderers are working on a fix, 1328 00:37:09,780 --> 00:37:12,960 we will share the details when it's fixed. 1329 00:37:14,060 --> 00:37:16,620 We will make some security recommendations 1330 00:37:16,620 --> 00:37:20,120 for Chromium-based software in two aspects. 1331 00:37:21,420 --> 00:37:27,980 Firstly, it is necessary to update the latest version of the Chromium. 1332 00:37:28,300 --> 00:37:32,240 Secondly, for software with high coupling, 1333 00:37:32,480 --> 00:37:35,720 it's better to use a stable development version. 1334 00:37:35,720 --> 00:37:40,580 And introduce security patches with software updates. 1335 00:37:41,540 --> 00:37:45,780 Thirdly, we should enable the Chromium sandbox. 1336 00:37:46,380 --> 00:37:53,140 And last, we need to disable unused software functional realities 1337 00:37:53,140 --> 00:37:55,500 or enable internal mitigations. 1338 00:37:59,380 --> 00:38:03,800 For developers, we can add backend validation 1339 00:38:03,800 --> 00:38:06,680 and front-end rendering validation. 1340 00:38:07,080 --> 00:38:10,860 Follow the principle of latest privilege. 1341 00:38:11,320 --> 00:38:15,920 Both privileged domain, range, and privileged API function. 1342 00:38:16,840 --> 00:38:20,620 Enable universal mitigation such as CSP 1343 00:38:20,620 --> 00:38:26,340 and be vigilant about input from unexpected sources. 1344 00:38:27,960 --> 00:38:33,420 Here is the conclusion and takeaways of this topic. 1345 00:38:33,420 --> 00:38:35,360 In this topic, 1346 00:38:35,600 --> 00:38:39,520 we verify that a large number of Chromium-based software 1347 00:38:39,520 --> 00:38:41,400 have RCE window period. 1348 00:38:41,880 --> 00:38:46,160 And then, we summarize some software attack surfaces 1349 00:38:46,160 --> 00:38:50,320 that cooperate with the RCE window period, 1350 00:38:50,700 --> 00:38:55,240 which makes the hackers can launch zero-day attack 1351 00:38:55,240 --> 00:38:58,900 with Chromium-n days and give real-world examples. 1352 00:38:59,420 --> 00:39:03,220 And we share a general way it's used after free 1353 00:39:03,420 --> 00:39:06,200 exploit method in 32-bit, 1354 00:39:06,400 --> 00:39:09,260 which may help make exploit faster. 1355 00:39:09,880 --> 00:39:13,880 At last, we provide some security recommendations 1356 00:39:14,420 --> 00:39:18,420 to help strengthen the security of Chromium-based software. 1357 00:39:18,980 --> 00:39:22,820 At last, thanks to all the partners 1358 00:39:23,000 --> 00:39:25,700 for their contribution to this topic. 1359 00:39:26,040 --> 00:39:27,500 Here is the list. 1360 00:39:33,420 --> 00:39:35,260 Okay, thanks for your listening. 1361 00:39:35,440 --> 00:39:38,360 Here is the references of this topic. 1362 00:39:38,660 --> 00:39:40,260 If you have any problem, 1363 00:39:40,700 --> 00:39:44,800 you can contact us with email or on Twitter.