1 00:00:00,000 --> 00:00:04,380 hello thank you for attending yeah first devcon everything is impressive size of the room is also 2 00:00:04,380 --> 00:00:09,520 impressive um so we are paul and thomas who are two women researchers from the sonar r d team 3 00:00:09,520 --> 00:00:16,860 what do you hi i'm paul and yeah i come from the ctf scene and in general i like to break 4 00:00:16,860 --> 00:00:23,700 javascript things so vs code is a very good place for that and on my side i'm more like a php guy 5 00:00:23,700 --> 00:00:27,700 it's been giving me a job in the offensive security side for like six years i always 6 00:00:27,700 --> 00:00:33,560 gonna keep on keep on giving for the next decade and also like some also like to do some exploration 7 00:00:33,560 --> 00:00:39,580 in the memory and safety world from time to time and our company sonar writes static analytics 8 00:00:39,580 --> 00:00:44,940 tools to help developers write king code and uh it's like a spell checker but for code in general 9 00:00:45,460 --> 00:00:52,220 and uh we use uh zero days that we find ourselves to fuel product innovation we found 150 zero days 10 00:00:52,220 --> 00:00:56,820 over the last two years and we were recognized by elimination for the pony awards uh the pot 11 00:00:56,820 --> 00:00:57,680 trigger top ten maybe 12 00:00:57,700 --> 00:01:02,700 the king techniques and we also play point one from time to time and because the journey of most 13 00:01:02,700 --> 00:01:06,560 developers starts in the code editor we're wondering about the security of these code editors 14 00:01:07,080 --> 00:01:12,380 and everybody have usually strong opinions on their favorite code editor like paul likes nano 15 00:01:12,380 --> 00:01:17,520 which is weird don't tell me but it's like eight percent of all developers pretend to use 16 00:01:17,520 --> 00:01:22,760 nano for some reasons uh but sometimes you need to get to get the job done and you start using 17 00:01:22,760 --> 00:01:27,420 bigger ids like your visual studio or the entity j suite or vs code which is the most 18 00:01:27,700 --> 00:01:33,040 popular one with like 75 percent of the market share so let's start to do something a bit 19 00:01:33,040 --> 00:01:38,920 interactive with vs code uh you've been cloning some git repo online or somebody just sent you 20 00:01:38,920 --> 00:01:42,820 some source code and you want to open it in vs code because i mean it's your job as a developer 21 00:01:42,820 --> 00:01:48,700 to read and edit code um so please raise your hand if you think that nothing wrong is going to 22 00:01:48,700 --> 00:01:55,860 happen so next slide the conclusion and stock is over nobody right uh okay i'll make me and resume 23 00:01:57,700 --> 00:02:02,520 up in this context okay so some people are not sure so i'm gonna show you quick demo 24 00:02:03,040 --> 00:02:08,920 uh to show you that it's real uh so we just received something oh sorry maybe i can zoom in a 25 00:02:08,920 --> 00:02:17,540 bit yeah okay um so you just received something or you just get cloned something on your desktop 26 00:02:18,640 --> 00:02:26,840 and it's just an open me please just like some html file with a git repo nothing sensitive so i 27 00:02:27,700 --> 00:02:33,680 open my folder i get this security prompt popping but it's calc before this prompt i didn't do 28 00:02:33,680 --> 00:02:39,620 anything so something's fishy and we're gonna get back on it uh later but it's definitely unsafe to 29 00:02:39,620 --> 00:02:44,640 do some things with vs code and uh this is what we want to show you today it's uh what's wrong 30 00:02:44,640 --> 00:02:50,360 there is no standard threat model for developer tools we don't know what's unsafe and before 31 00:02:50,360 --> 00:02:55,200 doing this research uh when we found this thing we're kind of surprised is it a normal thing to 32 00:02:55,200 --> 00:02:57,640 do like is it supposed to be unsafe to read somebody else's 33 00:02:57,700 --> 00:03:02,300 code because i mean it's my job and every day i just open random people's php code that i find 34 00:03:02,300 --> 00:03:09,280 online so if i do it does it tweak on the secret of my system can i open somebody else's code is 35 00:03:09,280 --> 00:03:14,880 it any risk does my ide run my code it's just happened with gb the compiler as it's used by 36 00:03:14,880 --> 00:03:18,500 malware analysts but in practice like in the background it would run the code you would 37 00:03:18,500 --> 00:03:23,360 decompile which is not something nobody wants i guess and also when you have fancy features 38 00:03:23,360 --> 00:03:27,460 like vs codes remote development do you know if it's safe microsoft doesn't say 39 00:03:27,700 --> 00:03:34,300 anything uh on this regard and also i think some background is uh that we have more and more 40 00:03:34,300 --> 00:03:38,960 threat actors campaigns against developers uh i would be a threat actors i would try to target 41 00:03:38,960 --> 00:03:45,120 developers it would be an easy target uh they do plenty of things all day with everybody else's 42 00:03:45,120 --> 00:03:51,080 code of dependencies and stuff and recently we've been seeing uh tractors using plex one day 43 00:03:51,460 --> 00:03:57,440 uh in the last place campaign so they compromised devops uh through their plex media 44 00:03:57,700 --> 00:04:02,900 server instance and then i think they use some keylogger to get secrets to access production 45 00:04:02,900 --> 00:04:08,640 and they compromise everybody's password vault that way uh they're also a google tag so the 46 00:04:08,640 --> 00:04:14,480 straight analyst group they reported uh a north korean campaign uh oh say say it's north korea 47 00:04:14,480 --> 00:04:19,700 and somebody would reach out to some permanent infosec figures on twitter and say oh yeah i have 48 00:04:19,700 --> 00:04:24,720 this kind of exploit i i can't build it can you help me to do it and you when you're nice and 49 00:04:24,720 --> 00:04:27,580 talented and you're like yeah i'm gonna help you and if you build a project 50 00:04:27,700 --> 00:04:32,300 it would compromise you and run some uh weird powershell things in the background 51 00:04:33,000 --> 00:04:37,380 so it's definitely a thing and with this presentation we want to show you around the 52 00:04:37,380 --> 00:04:41,560 different attack surfaces of these ids including vs code oh it's going to be about vs code anyway 53 00:04:42,080 --> 00:04:46,880 paul will start by showing you all the software's architectures you will see it's a huge beast so 54 00:04:46,880 --> 00:04:51,320 it needs some background understanding on how it works and it's developed and designed and then we 55 00:04:51,320 --> 00:04:57,140 can start by looking at the most common sources of risk that we've seen in vs code in the core and 56 00:04:57,860 --> 00:05:03,980 and it's based on on research so we will tell you when it's all on bugs and also some research done 57 00:05:03,980 --> 00:05:09,940 by external researchers and we'll credit them every time accordingly and then we'll look at the 58 00:05:10,500 --> 00:05:14,500 reporting process for microsoft we have a fun anecdote to share and most of the bug you will 59 00:05:14,500 --> 00:05:19,920 see requires some degree of interaction like you've seen i've just opened a folder in my desktop 60 00:05:19,920 --> 00:05:25,840 and i think it's expected from vs code so we still call everything rce because the attacker is remote 61 00:05:25,840 --> 00:05:27,480 but it would be more like 62 00:05:27,700 --> 00:05:32,220 something like arbitrary code execution that's done by somebody who's remote but that's been 63 00:05:32,220 --> 00:05:38,840 carried on locally so we call it rce ace it's roughly the same thing in this context so paul 64 00:05:40,180 --> 00:05:46,880 thank you um yeah so let's look at how vs code is built first of all it's based on 65 00:05:46,880 --> 00:05:50,340 electron which is basically node.js and chromium meshed together 66 00:05:51,000 --> 00:05:56,620 so it's written in typescript and with a little bit of html css and all the other web technologies 67 00:05:57,140 --> 00:05:57,620 sprinkled 68 00:05:57,620 --> 00:06:03,700 on top which means it can also easily work in the browser so there are two web-based versions of vs 69 00:06:03,700 --> 00:06:10,340 code probably even more on github.dev and vs.code.dev and they are basically the same experience 70 00:06:10,340 --> 00:06:16,640 some things are different but yeah that's the gist of it vs code is highly extensible everybody 71 00:06:16,640 --> 00:06:21,380 can build extensions for it and you can also publish them to the marketplace where everybody 72 00:06:21,380 --> 00:06:25,960 can install them from and search through them and one cool thing that came up during the development 73 00:06:25,960 --> 00:06:28,620 of Visual Studio Code was the language server protocol. 74 00:06:29,040 --> 00:06:31,780 It's basically a way how you can write support 75 00:06:31,780 --> 00:06:34,760 for a language once, and then all editors 76 00:06:34,760 --> 00:06:37,020 that support this protocol can reuse it 77 00:06:37,020 --> 00:06:39,740 instead of having to code it for every editor again. 78 00:06:41,340 --> 00:06:43,060 VS Code is mostly open source. 79 00:06:43,360 --> 00:06:46,300 It has about 800,000 lines of code in its GitHub repo, 80 00:06:46,580 --> 00:06:49,560 and when you download the version from Microsoft directly, 81 00:06:49,780 --> 00:06:52,480 it has some small proprietary parts, 82 00:06:52,680 --> 00:06:55,680 but you can also download the full OSS version 83 00:06:55,680 --> 00:06:56,160 if you want. 84 00:06:57,380 --> 00:07:00,380 Let's look at the components that VS Code is made of. 85 00:07:00,560 --> 00:07:04,360 So, first of all, it isolates and splits different things 86 00:07:04,360 --> 00:07:08,040 into different components, and it uses processes for that. 87 00:07:08,700 --> 00:07:10,320 And there are some privileged processes. 88 00:07:10,620 --> 00:07:11,460 You can see them in red. 89 00:07:12,380 --> 00:07:13,960 There's, first of all, the main process. 90 00:07:14,180 --> 00:07:15,800 This is the one that starts up first 91 00:07:15,800 --> 00:07:17,360 and orchestrates everything else. 92 00:07:17,860 --> 00:07:19,080 Then there's the share process. 93 00:07:19,480 --> 00:07:22,000 This one hosts the PTYs, the terminals 94 00:07:22,000 --> 00:07:23,260 that you can open in VS Code. 95 00:07:23,380 --> 00:07:25,360 For example, it hosts the file watcher, 96 00:07:25,360 --> 00:07:25,660 DMA, and the file watcher. 97 00:07:25,660 --> 00:07:29,640 And then there's the extension host process, 98 00:07:29,900 --> 00:07:31,420 and this one, as the name says, 99 00:07:32,260 --> 00:07:35,560 hosts whatever extensions want to run in the background, 100 00:07:35,680 --> 00:07:36,280 which is not UI. 101 00:07:36,880 --> 00:07:39,020 And then there are less privileged parts, 102 00:07:39,220 --> 00:07:40,280 which are the renderer process. 103 00:07:40,500 --> 00:07:41,820 So this is the Chromium part, 104 00:07:42,060 --> 00:07:44,440 and it's basically just like a normal website. 105 00:07:45,700 --> 00:07:47,960 It cannot really access directly the file system, 106 00:07:48,140 --> 00:07:49,440 execute commands, or whatever. 107 00:07:49,740 --> 00:07:51,200 It's just rendering the UI. 108 00:07:52,460 --> 00:07:53,700 And this is how it looks. 109 00:07:53,880 --> 00:07:55,640 I'm sure many of you have seen it. 110 00:07:55,660 --> 00:07:59,080 And the big outer red part is called the workbench. 111 00:07:59,260 --> 00:08:01,680 This is basically the core UI of VS Code itself. 112 00:08:02,140 --> 00:08:04,460 It's served from the VS Code file protocol, 113 00:08:04,800 --> 00:08:05,880 which is a special protocol. 114 00:08:06,100 --> 00:08:06,820 We will see that later. 115 00:08:07,520 --> 00:08:09,200 And then, for example, an extension. 116 00:08:09,520 --> 00:08:10,780 Here, the Markdown preview extension 117 00:08:10,780 --> 00:08:12,560 can also show some UI, 118 00:08:12,760 --> 00:08:14,100 and this will be in a web view, 119 00:08:14,240 --> 00:08:15,520 which is similar to an iframe, 120 00:08:15,580 --> 00:08:16,460 so it's kind of isolated. 121 00:08:16,820 --> 00:08:19,700 And it also comes from the VS Code web view protocol. 122 00:08:20,080 --> 00:08:23,020 So already there, you see that it's coming 123 00:08:23,020 --> 00:08:23,720 from different things. 124 00:08:23,800 --> 00:08:25,460 There are some isolation things, 125 00:08:25,660 --> 00:08:25,960 which is going on. 126 00:08:28,620 --> 00:08:31,740 But, yeah, if one of the parts, 127 00:08:31,900 --> 00:08:32,760 for example, the extension, 128 00:08:32,920 --> 00:08:35,480 wants to directly access the workbench, 129 00:08:35,700 --> 00:08:37,660 then this will not be allowed 130 00:08:37,660 --> 00:08:38,840 by the same origin policy, 131 00:08:39,160 --> 00:08:40,580 because they come from different origins. 132 00:08:41,180 --> 00:08:43,200 And, yeah, this is something that comes from the web 133 00:08:43,200 --> 00:08:44,960 and also applies here. 134 00:08:45,320 --> 00:08:47,660 But, of course, sometimes the different parts 135 00:08:47,660 --> 00:08:48,340 have to communicate, 136 00:08:48,700 --> 00:08:51,540 and for that there are different IPC interfaces. 137 00:08:52,000 --> 00:08:54,860 So between origins in the renderers, 138 00:08:55,760 --> 00:08:57,480 there's window.postmessage, 139 00:08:57,620 --> 00:09:00,620 which is a regular web message-passing interface. 140 00:09:01,580 --> 00:09:05,020 And then if a UI part, a renderer process, 141 00:09:05,120 --> 00:09:07,100 wants to talk to some of the utility processes, 142 00:09:07,480 --> 00:09:09,780 they can use message ports to talk directly there. 143 00:09:09,960 --> 00:09:12,600 Or if they want to talk to the main process, 144 00:09:12,920 --> 00:09:15,040 then there's the good old election way 145 00:09:15,040 --> 00:09:17,360 of using preload scripts and the context bridge. 146 00:09:19,300 --> 00:09:22,420 So, of course, to hunt bugs and to find them, 147 00:09:22,500 --> 00:09:24,680 you probably want to debug VS Code, 148 00:09:24,860 --> 00:09:25,640 because it's just a way to find bugs. 149 00:09:25,640 --> 00:09:26,520 It's just easier to step through 150 00:09:26,520 --> 00:09:29,740 instead of having to put printf everywhere and recompile. 151 00:09:30,160 --> 00:09:31,480 So for the UI part, 152 00:09:31,660 --> 00:09:34,020 you can just use the Chromium developer tools 153 00:09:34,020 --> 00:09:35,100 like you know them from Chrome 154 00:09:35,100 --> 00:09:36,940 or any other Chromium-based browsers. 155 00:09:37,420 --> 00:09:40,500 And with that, you can debug extension UI 156 00:09:40,500 --> 00:09:42,160 and also the workbench UI. 157 00:09:42,440 --> 00:09:45,840 If you want to debug the backend part of extensions, 158 00:09:46,280 --> 00:09:47,520 you have to start VS Code 159 00:09:47,520 --> 00:09:49,580 with the dash-dash inspect-extensions flag, 160 00:09:49,840 --> 00:09:52,860 and then you can just attach a Chrome DevTools instance 161 00:09:52,860 --> 00:09:54,360 and debug it normally. 162 00:09:55,640 --> 00:09:59,080 Or the easiest way is just you use VS Code to debug VS Code. 163 00:09:59,700 --> 00:10:02,960 It's easy because they have pre-made launch configurations, 164 00:10:03,180 --> 00:10:06,280 so you just clone the repo, open it in VS Code, 165 00:10:06,460 --> 00:10:08,560 and then you will see in the launch configs tab 166 00:10:08,980 --> 00:10:10,560 that you can start different processes 167 00:10:10,560 --> 00:10:12,440 or everything together under debugging. 168 00:10:13,560 --> 00:10:15,600 All right, now that we roughly know 169 00:10:15,600 --> 00:10:17,660 how VS Code looks in the inside, 170 00:10:18,020 --> 00:10:19,900 Thomas will start with the first attack surface, 171 00:10:20,080 --> 00:10:21,660 which is exposed network services. 172 00:10:23,160 --> 00:10:25,280 So I think it's a bit generic. 173 00:10:25,640 --> 00:10:27,580 It's something you would find in kind of any desktop application, 174 00:10:27,900 --> 00:10:30,340 but in the case of VS Code, it happens kind of a lot. 175 00:10:31,500 --> 00:10:34,120 You may have services that start listening on the network. 176 00:10:34,740 --> 00:10:38,580 You may start wanting to expose a development server to locals. 177 00:10:38,760 --> 00:10:40,740 You may want to expose your server to everybody. 178 00:10:40,960 --> 00:10:42,220 You may want to expose a debugger 179 00:10:42,220 --> 00:10:45,500 or just to communicate with other components on the system. 180 00:10:45,760 --> 00:10:48,520 And while you would, in theory, to be safe, 181 00:10:48,580 --> 00:10:50,180 you would rather use some OS IP mechanisms, 182 00:10:51,880 --> 00:10:54,080 it's still JavaScript code, TypeScript code, 183 00:10:54,220 --> 00:10:55,360 and I think people, 184 00:10:55,640 --> 00:10:56,600 who are developing VS Code extensions, 185 00:10:56,900 --> 00:10:59,780 are maybe like web developers or not-JS developers, 186 00:11:00,000 --> 00:11:03,720 but they're not likely to be system-level developers, 187 00:11:03,840 --> 00:11:05,960 so they never really use OS IP mechanisms. 188 00:11:06,940 --> 00:11:09,560 And in practice, even if you want to expose a debugger 189 00:11:09,560 --> 00:11:11,960 or local server, even a unique socket could be enough, 190 00:11:12,100 --> 00:11:13,720 and it would be safer to not expose anything. 191 00:11:14,360 --> 00:11:16,780 Because if you start exposing ports, even on local hosts, 192 00:11:16,980 --> 00:11:19,380 they may be a website when you browse. 193 00:11:19,640 --> 00:11:22,260 They may start doing requests to these ports, 194 00:11:22,400 --> 00:11:25,000 and even if it's listening only on local hosts, 195 00:11:25,000 --> 00:11:25,960 you could do sysop attacks, 196 00:11:26,240 --> 00:11:28,640 or you could use web sockets to connect to a service. 197 00:11:28,880 --> 00:11:31,560 So listening only on local hosts is not a good solution either. 198 00:11:32,440 --> 00:11:36,020 If you want some examples of CDs that were in plug-ins, 199 00:11:36,060 --> 00:11:38,020 there was one called Rainbow Fart, 200 00:11:38,180 --> 00:11:42,480 which is supposed to play sound when you type keywords on VS Code, 201 00:11:42,640 --> 00:11:46,540 which sounds silly, but still, they got 128,000 installs, 202 00:11:46,540 --> 00:11:47,980 so people are using this module, 203 00:11:48,140 --> 00:11:54,120 and Kirill Efimov from Snyk found that it would expose an HTTP port on port 7777, 204 00:11:54,160 --> 00:11:54,320 and it would expose an HTTP port on port 7777, 205 00:11:54,320 --> 00:11:54,420 and it would expose an HTTP port on port 7777, 206 00:11:55,240 --> 00:11:56,860 and if you go on this page, 207 00:11:56,960 --> 00:11:59,840 you would be able to upload a zip file to change the sounds 208 00:11:59,840 --> 00:12:01,700 it's playing when you type on VS Code. 209 00:12:02,120 --> 00:12:04,220 And there would be a zip-based pass traversal, 210 00:12:04,320 --> 00:12:06,640 so basically you would browse on some random website online, 211 00:12:06,900 --> 00:12:10,040 and it would do a sysop attack to force you to send a zip file 212 00:12:10,500 --> 00:12:12,100 exploiting the vulnerability on this page, 213 00:12:12,300 --> 00:12:15,360 and then you would be able to override any file on the local file system. 214 00:12:15,580 --> 00:12:18,080 So you would override the developer's .bashrc file, 215 00:12:18,260 --> 00:12:20,700 and you would be able to execute arbitrary command from here. 216 00:12:21,320 --> 00:12:24,440 There were also more serious examples in the core, directly on VS Code, 217 00:12:24,440 --> 00:12:29,260 if you remember, Paul told you you can use the dash dash inspect option 218 00:12:29,260 --> 00:12:33,400 to expose an OGS debugger to the outside to debug VS Code, 219 00:12:33,500 --> 00:12:36,260 and it was enabled by default on VS Code at that point in 2019, 220 00:12:36,540 --> 00:12:41,000 and it was reported in one key by Tavizo and PHRAAAA, 221 00:12:42,100 --> 00:12:44,760 kind of like at the same week or same month, 222 00:12:44,940 --> 00:12:48,780 and in this case, this debugger was starting a local host in a random port 223 00:12:48,780 --> 00:12:50,200 every time you would start VS Code. 224 00:12:50,820 --> 00:12:53,300 But it's a debugger, it's meant to change variables, 225 00:12:53,500 --> 00:12:54,420 it's meant to run code, 226 00:12:54,420 --> 00:12:57,540 so if you'd be able to reach out to this port, 227 00:12:57,680 --> 00:12:59,080 you would kind of gain RC easily. 228 00:12:59,860 --> 00:13:01,440 In practice, it's not so easy, 229 00:13:01,540 --> 00:13:04,360 because the way the node.js debugger works, 230 00:13:04,500 --> 00:13:06,100 you first have to do an HTTP request 231 00:13:06,100 --> 00:13:10,160 to find out kind of a magic value with a WebSocket URL, 232 00:13:10,520 --> 00:13:13,580 and then you use WebSockets to connect to this destination. 233 00:13:14,540 --> 00:13:17,280 So you cannot just make a request to a local service, 234 00:13:17,420 --> 00:13:19,400 to a local port, because it's not the same origin. 235 00:13:20,000 --> 00:13:23,900 So you would first use some DNS rebinding to access the service, 236 00:13:23,900 --> 00:13:25,040 get the WebSocket URL, 237 00:13:25,400 --> 00:13:28,380 and then since WebSockets are not subject to the same origin policy, 238 00:13:28,760 --> 00:13:30,160 you would be able to connect to this thing. 239 00:13:31,280 --> 00:13:33,720 I don't remember seeing any complete exploit for it, 240 00:13:33,780 --> 00:13:35,980 but I think it could have been exploited in that case. 241 00:13:36,440 --> 00:13:38,260 And now we can start to spice things up 242 00:13:38,260 --> 00:13:41,000 and dig into things that are more specific to VS Code in this case. 243 00:13:41,800 --> 00:13:44,120 Another very interesting feature of Electron 244 00:13:44,120 --> 00:13:45,560 is that it provides a native layer 245 00:13:46,180 --> 00:13:49,180 to work with the underlying operating system 246 00:13:49,180 --> 00:13:50,420 for like a better integration. 247 00:13:51,140 --> 00:13:52,500 So you also need it, 248 00:13:52,500 --> 00:13:54,420 because you need file access, network access, 249 00:13:54,680 --> 00:13:56,460 but you can also expose things to the outside. 250 00:13:57,340 --> 00:14:00,240 It's a pretty nice form of IPC that's not relying on the network. 251 00:14:00,860 --> 00:14:05,080 So VS Code registers is VS Code colon slash slash protocol handler, 252 00:14:05,240 --> 00:14:06,580 and if you have a VS Code insider, 253 00:14:06,820 --> 00:14:08,020 which is an active version of VS Code, 254 00:14:08,100 --> 00:14:10,400 it's VS Code dash insiders colon slash slash. 255 00:14:11,020 --> 00:14:13,040 And when you click on one of these links, 256 00:14:13,380 --> 00:14:17,220 the OS kind of gets the event and says, 257 00:14:17,300 --> 00:14:19,920 okay, do I have anybody who kind of registered for this one? 258 00:14:20,100 --> 00:14:21,760 In the case of VS Code, it's going to be VS Code, 259 00:14:22,500 --> 00:14:24,000 and then it kind of wakes up VS Code 260 00:14:24,000 --> 00:14:25,420 and say, oh, there's something for you. 261 00:14:26,280 --> 00:14:28,420 And so this is one of the bugs that we found 262 00:14:28,420 --> 00:14:29,560 in the Git built-in extension. 263 00:14:29,900 --> 00:14:30,880 So it's called an extension, 264 00:14:31,120 --> 00:14:32,840 but it's built-in, enabled by default, 265 00:14:33,000 --> 00:14:33,920 and you cannot remove it. 266 00:14:34,020 --> 00:14:34,920 It's part of VS Code, 267 00:14:35,040 --> 00:14:36,960 but it's still called an extension. 268 00:14:37,700 --> 00:14:40,280 And it exposes a feature that way 269 00:14:40,280 --> 00:14:43,240 to let you clone repositories when you click on a link. 270 00:14:43,440 --> 00:14:45,780 So when you use GitLab, for instance, 271 00:14:46,100 --> 00:14:46,960 when you want to clone something, 272 00:14:47,220 --> 00:14:49,540 it gives you the command line with git clone, 273 00:14:49,540 --> 00:14:53,400 and you can also have this open in your ID button 274 00:14:53,400 --> 00:14:56,960 that will automatically bring VS Code in front 275 00:14:56,960 --> 00:14:58,300 and clone the repo for you. 276 00:14:58,840 --> 00:15:00,700 So under the hood, the way it works, 277 00:15:02,080 --> 00:15:05,740 the Git extension implements a class called UIAndler, 278 00:15:06,300 --> 00:15:08,020 and it kind of handles the request 279 00:15:08,020 --> 00:15:09,720 that comes from the operating system. 280 00:15:10,040 --> 00:15:12,100 If it finishes with slash clone, 281 00:15:12,340 --> 00:15:15,300 it calls a method called clone 282 00:15:15,300 --> 00:15:17,880 with the full address that you clicked, 283 00:15:18,020 --> 00:15:19,520 and then it passes the request 284 00:15:19,540 --> 00:15:22,160 with the URL and calls an ID command 285 00:15:22,160 --> 00:15:23,580 called git code clone, 286 00:15:23,840 --> 00:15:26,480 which is something you can also invoke yourself 287 00:15:26,480 --> 00:15:28,880 when you press command shift and P. 288 00:15:29,100 --> 00:15:30,900 You can also type git.clone, 289 00:15:30,960 --> 00:15:32,140 and it's going to run the same thing. 290 00:15:32,560 --> 00:15:35,900 And then internally, git.clone calls something 291 00:15:35,900 --> 00:15:37,360 called clone repository, 292 00:15:37,940 --> 00:15:40,140 which is only a wrapper around the git command. 293 00:15:40,340 --> 00:15:42,780 There is no reason to reimplement git in TypeScript 294 00:15:42,780 --> 00:15:43,820 just for this feature. 295 00:15:44,020 --> 00:15:45,820 So they simply call git clone for you. 296 00:15:45,960 --> 00:15:47,440 And as you see in the web square, 297 00:15:47,440 --> 00:15:49,260 if there is no space, 298 00:15:49,600 --> 00:15:51,940 it puts the URL as is right here. 299 00:15:52,220 --> 00:15:54,840 So there is something interesting here 300 00:15:54,840 --> 00:15:56,880 because we kind of control the way 301 00:15:56,880 --> 00:15:58,340 an external command is being called, 302 00:15:58,480 --> 00:16:00,860 and there is no risk of command injection here 303 00:16:00,860 --> 00:16:02,380 because it's not being executed in the shell. 304 00:16:02,500 --> 00:16:03,460 It's directly calling git, 305 00:16:04,000 --> 00:16:07,340 but you can still add arbitrary arguments to git. 306 00:16:07,520 --> 00:16:11,020 So if you put git dash dash help, 307 00:16:11,100 --> 00:16:12,020 it's going to display the help. 308 00:16:12,120 --> 00:16:13,560 In this case, it's a git clone, 309 00:16:13,720 --> 00:16:16,860 so the green part is what's fixed, 310 00:16:16,860 --> 00:16:20,120 what's constant because of VS Code, 311 00:16:20,280 --> 00:16:22,020 and in red is what we control. 312 00:16:22,360 --> 00:16:25,800 And we found out that if you put the option dash u 313 00:16:25,800 --> 00:16:26,660 for upload back, 314 00:16:26,920 --> 00:16:29,220 it's going to tell git to, 315 00:16:29,320 --> 00:16:31,020 next time you have to clone something, 316 00:16:31,320 --> 00:16:33,300 use this command instead of trying to use 317 00:16:33,300 --> 00:16:34,040 your own installed commands. 318 00:16:34,300 --> 00:16:36,340 So basically it tricks git into running 319 00:16:36,340 --> 00:16:37,800 a command of your choice instead. 320 00:16:38,100 --> 00:16:39,540 There are some restrictions for exploitation 321 00:16:39,540 --> 00:16:40,700 which are not that interesting. 322 00:16:40,840 --> 00:16:41,740 It's kind of like CTFE. 323 00:16:42,380 --> 00:16:44,440 You need the clone to trigger this command 324 00:16:44,440 --> 00:16:46,540 because otherwise git thinks 325 00:16:46,860 --> 00:16:48,600 it's a local repo, it's not a remote one, 326 00:16:48,720 --> 00:16:50,020 and it's not calling the upload back command, 327 00:16:50,200 --> 00:16:52,740 and you need to avoid spaces to not be relencoded. 328 00:16:53,060 --> 00:16:55,660 So this is what the final payload looks like. 329 00:16:55,740 --> 00:16:57,200 We have this VS Code current slash slash thing, 330 00:16:57,400 --> 00:17:00,880 vscode.git, clone, we pass the URL, dash u, 331 00:17:01,060 --> 00:17:03,880 and then we do some tricks to not have spaces, 332 00:17:04,300 --> 00:17:07,140 and the resulting indication is this git clone dash u thing. 333 00:17:07,580 --> 00:17:09,380 So I'm going to show you what it looks like in practice. 334 00:17:09,880 --> 00:17:12,500 And let's say you go online on some git lab 335 00:17:13,300 --> 00:17:14,340 self-assisted instance. 336 00:17:14,400 --> 00:17:15,380 You want to use this feature. 337 00:17:15,380 --> 00:17:16,480 So you're going to clone. 338 00:17:16,780 --> 00:17:17,660 You click. 339 00:17:17,800 --> 00:17:19,360 I want to open it in my VS Code. 340 00:17:20,700 --> 00:17:21,520 It prompts you. 341 00:17:21,580 --> 00:17:22,060 Do you want to clone? 342 00:17:22,260 --> 00:17:24,540 There is no way for me to check what's in there, 343 00:17:24,660 --> 00:17:25,480 so I have to trust it. 344 00:17:25,580 --> 00:17:26,220 So I'm going to say yes. 345 00:17:27,120 --> 00:17:28,400 I put it on my desktop. 346 00:17:29,300 --> 00:17:29,860 All right. 347 00:17:30,100 --> 00:17:31,980 And once again, you have this calc. 348 00:17:32,060 --> 00:17:33,060 It just popped up. 349 00:17:34,120 --> 00:17:35,940 So yeah, kind of unsafe in the end. 350 00:17:39,960 --> 00:17:41,480 And there were very similar findings, 351 00:17:41,740 --> 00:17:45,000 I think, a year before by Smurie from Schilder. 352 00:17:46,080 --> 00:17:48,620 Also an argument injection when you would click on links 353 00:17:48,620 --> 00:17:51,000 for the remote development extension. 354 00:17:51,680 --> 00:17:53,560 I am not showing code because it's closed source, 355 00:17:53,640 --> 00:17:55,900 and we didn't, like, spend time to dig into it 356 00:17:55,900 --> 00:17:57,820 and make it readable. 357 00:17:58,140 --> 00:17:59,380 But it's basically the same thing. 358 00:17:59,560 --> 00:18:02,340 Like, the os part is directly being put in the command line, 359 00:18:02,440 --> 00:18:03,660 and you can inject arbitrary arguments. 360 00:18:04,160 --> 00:18:06,820 And you would exploit it with dash o proxy commands. 361 00:18:07,280 --> 00:18:08,580 And it's quick ad break. 362 00:18:09,080 --> 00:18:10,440 I love argument injection bugs. 363 00:18:10,660 --> 00:18:12,460 I think, Paul, you're getting used to it. 364 00:18:13,000 --> 00:18:15,220 And we found many, many argument injection bugs 365 00:18:15,380 --> 00:18:15,760 over the time. 366 00:18:15,880 --> 00:18:19,520 So we created a page that lists all the small dash u, dash o 367 00:18:19,520 --> 00:18:21,860 proxy commands, all these argument injection vectors 368 00:18:22,340 --> 00:18:24,520 that's going to help you to execute arbitrary commands 369 00:18:24,520 --> 00:18:26,200 when you find argument injection bugs. 370 00:18:26,560 --> 00:18:27,420 So it's free. 371 00:18:27,500 --> 00:18:28,020 It's open source. 372 00:18:28,220 --> 00:18:29,220 And it welcomes contributions. 373 00:18:29,540 --> 00:18:32,040 So if you go on this page and you find out 374 00:18:32,040 --> 00:18:35,480 that we missed good tricks, feel free to add yours. 375 00:18:36,580 --> 00:18:38,480 And now we can also dig into something 376 00:18:38,480 --> 00:18:40,100 that's even more specific to VS Code, 377 00:18:40,220 --> 00:18:41,320 and that's workspace settings. 378 00:18:41,920 --> 00:18:43,980 There is a support for pair workspace settings 379 00:18:43,980 --> 00:18:46,980 that comes along your source code repo. 380 00:18:47,240 --> 00:18:49,360 So if you want to share settings with other developers, 381 00:18:49,560 --> 00:18:53,460 like linter configurations, like things to do 382 00:18:53,460 --> 00:18:54,740 and you want to share with everybody else, 383 00:18:54,920 --> 00:18:59,440 you can create a file named .vscode slash settings.json. 384 00:18:59,760 --> 00:19:01,980 And it's a way to share the settings. 385 00:19:02,160 --> 00:19:05,020 And it's automatically loaded when you open the folder. 386 00:19:05,340 --> 00:19:07,380 So the question is, if you put your security research 387 00:19:07,380 --> 00:19:10,640 out on, maybe can I override sensitive settings? 388 00:19:10,840 --> 00:19:13,160 Like, are there maybe sensitive settings? 389 00:19:13,160 --> 00:19:16,300 And in 2017, so like a long time ago, 390 00:19:16,460 --> 00:19:19,220 Justin Stevan found out that there would be an option 391 00:19:19,220 --> 00:19:22,380 called git.path, also from the Git's built-in extension, 392 00:19:23,000 --> 00:19:25,280 that you could change to say, oh, no, Git, 393 00:19:25,300 --> 00:19:27,640 it's not in my slash user slash bin slash Git. 394 00:19:27,860 --> 00:19:28,880 It's somewhere else. 395 00:19:29,320 --> 00:19:31,800 So if you ship a folder, a project, 396 00:19:32,560 --> 00:19:35,400 and in settings you override this setting, 397 00:19:35,520 --> 00:19:37,300 the git.path thing, you could force it 398 00:19:37,300 --> 00:19:38,560 to invoke other commands instead. 399 00:19:38,840 --> 00:19:41,540 And as soon as somebody would open a folder, 400 00:19:41,640 --> 00:19:43,140 it would be loaded, and Git would run. 401 00:19:43,160 --> 00:19:44,900 And it would call this other command instead. 402 00:19:45,780 --> 00:19:47,380 There were also some interesting tricks 403 00:19:47,380 --> 00:19:49,560 for the expectation, because it would have to survive 404 00:19:49,560 --> 00:19:53,180 a first command dash dash version invocation 405 00:19:53,180 --> 00:19:54,540 from the VS Code install folder. 406 00:19:54,780 --> 00:19:56,960 And then it would be called from the project folder. 407 00:19:57,200 --> 00:20:00,560 So what it did, it was to set git.path to bash. 408 00:20:00,780 --> 00:20:01,920 So the first code works. 409 00:20:02,180 --> 00:20:04,920 And for the other one, it would plant a file 410 00:20:04,920 --> 00:20:06,580 called revpath in this folder. 411 00:20:06,720 --> 00:20:09,240 And it would be called instead, and it would run its payload. 412 00:20:10,120 --> 00:20:12,960 And there were also another example of vulnerabilities 413 00:20:13,160 --> 00:20:15,920 that would use local data directly found 414 00:20:15,920 --> 00:20:16,940 by Didi Walker in 2020. 415 00:20:17,800 --> 00:20:21,640 When you do not just development, 416 00:20:21,880 --> 00:20:24,760 you would use NPM to store all your dependencies. 417 00:20:25,220 --> 00:20:27,300 And to this end, you write everything 418 00:20:27,300 --> 00:20:28,900 in a file named package.json. 419 00:20:29,100 --> 00:20:32,600 And if you kind of hover a dependency on this file, 420 00:20:33,180 --> 00:20:38,240 the NPM plug-in kicks in and tries to fetch information 421 00:20:38,240 --> 00:20:40,520 and to show you information like the description 422 00:20:40,520 --> 00:20:42,620 of the package, how many installs, everything. 423 00:20:43,160 --> 00:20:46,300 And it would call this command and safely concatenate 424 00:20:46,300 --> 00:20:47,960 the name of the dependency in the command. 425 00:20:48,160 --> 00:20:49,720 And there would be a command injection in there. 426 00:20:50,420 --> 00:20:52,980 It was later bypassed by Justin Steven again 427 00:20:53,840 --> 00:20:55,860 because they tried to fix it. 428 00:20:55,960 --> 00:20:57,680 They started validating the name of dependencies. 429 00:20:58,120 --> 00:20:59,500 And it's a fail-open thing. 430 00:20:59,760 --> 00:21:02,760 So basically, if you don't match what they expect you to be, 431 00:21:02,840 --> 00:21:05,040 something unsafe, it would say, yeah, it's safe. 432 00:21:05,240 --> 00:21:07,100 It's like it's a block list approach 433 00:21:07,100 --> 00:21:08,300 instead of another list approach. 434 00:21:08,540 --> 00:21:12,160 And it was once again proven to be not the best way 435 00:21:12,160 --> 00:21:13,080 to fix the vulnerabilities. 436 00:21:14,760 --> 00:21:16,720 And now we can get to workspace trust, 437 00:21:16,820 --> 00:21:18,540 which was also part of the name of this talk, 438 00:21:18,660 --> 00:21:20,100 so I have to explain it to you. 439 00:21:20,860 --> 00:21:23,800 It was a feature introduced in 2021 in VS Code 440 00:21:23,800 --> 00:21:28,080 that its goal is to reduce impact of malicious folders. 441 00:21:28,440 --> 00:21:29,640 So everything you've seen before, 442 00:21:29,800 --> 00:21:31,300 where we would run arbitrary commands 443 00:21:31,300 --> 00:21:33,260 and where we would use local data, 444 00:21:33,420 --> 00:21:38,100 could be kind of blocked by this new trust-based system. 445 00:21:38,320 --> 00:21:39,800 And you would have a new security assumption. 446 00:21:40,080 --> 00:21:41,600 You would say all untrusted folders 447 00:21:42,160 --> 00:21:43,560 are safe to open in restricted mode, 448 00:21:43,780 --> 00:21:45,860 but as soon as you start trusting something, 449 00:21:46,640 --> 00:21:47,860 it's not a security bug anymore 450 00:21:47,860 --> 00:21:49,940 if somebody executes commands in this case. 451 00:21:50,320 --> 00:21:52,060 So trusting a folder is always unsafe, 452 00:21:52,400 --> 00:21:54,040 and untrusted folders are supposed to be safe. 453 00:21:54,400 --> 00:21:55,680 And this is what it looks like. 454 00:21:55,840 --> 00:21:57,000 So this is a prompt that says, 455 00:21:57,040 --> 00:21:58,720 do you trust the author of this file in this folder? 456 00:21:59,440 --> 00:22:01,300 And it pops every time you open a folder. 457 00:22:01,400 --> 00:22:03,000 So you may be influenced and say, 458 00:22:03,100 --> 00:22:04,600 oh, I want to click yes every single time, 459 00:22:04,660 --> 00:22:05,980 but it's maybe not the best idea. 460 00:22:06,600 --> 00:22:07,940 There are some documentation that say 461 00:22:07,940 --> 00:22:10,540 this is what you risk if you press yes, 462 00:22:11,040 --> 00:22:13,200 but you would not expect the no to be unsafe. 463 00:22:14,180 --> 00:22:15,740 And the way it works under the hood, 464 00:22:15,860 --> 00:22:18,240 all extensions, including built-in ones, 465 00:22:18,420 --> 00:22:19,660 they declare their own capabilities 466 00:22:19,660 --> 00:22:21,460 in their own package.json file, 467 00:22:21,580 --> 00:22:23,320 and the default value is false. 468 00:22:23,420 --> 00:22:25,520 That means this extension won't run 469 00:22:25,520 --> 00:22:27,200 in untrusted workspaces. 470 00:22:27,660 --> 00:22:30,160 So you kind of miss features from VS Code 471 00:22:30,160 --> 00:22:31,780 just because you clicked no, I don't trust. 472 00:22:32,060 --> 00:22:34,040 So you're not kind of like living the life 473 00:22:34,040 --> 00:22:35,620 with VS Code, with all the fancy extensions, 474 00:22:35,920 --> 00:22:37,460 and you have a very limited IDE, 475 00:22:37,720 --> 00:22:39,800 which is maybe not what you were looking for 476 00:22:39,800 --> 00:22:40,460 in the first place. 477 00:22:41,160 --> 00:22:43,000 So they also introduced something called limited 478 00:22:43,000 --> 00:22:45,360 that lets extensions say, okay, 479 00:22:45,460 --> 00:22:46,900 in this case, if it's untrusted, 480 00:22:47,080 --> 00:22:48,060 I'm not going to run this command. 481 00:22:48,660 --> 00:22:50,300 I'm going to remove a few of my features 482 00:22:50,300 --> 00:22:52,620 that could be unsafe, but everything else will run. 483 00:22:53,740 --> 00:22:55,800 And once again, the guilt of built-in extension, 484 00:22:55,960 --> 00:22:57,360 I think it's really a gift for us. 485 00:22:57,980 --> 00:22:59,780 It runs in untrusted workspaces. 486 00:23:00,060 --> 00:23:01,120 I'd say that it's supported, 487 00:23:01,280 --> 00:23:02,360 so that means it's going to run 488 00:23:02,780 --> 00:23:04,340 in all untrusted workspaces 489 00:23:04,340 --> 00:23:07,520 and untrusted workspaces also. 490 00:23:08,660 --> 00:23:09,780 And when we were trying 491 00:23:09,800 --> 00:23:11,600 to see if there were security issues 492 00:23:11,600 --> 00:23:13,460 with this extension, we found out 493 00:23:13,460 --> 00:23:14,720 that Git, so the command Git, 494 00:23:14,900 --> 00:23:16,380 supports several levels of configuration. 495 00:23:16,700 --> 00:23:18,400 There is a system-wide configuration 496 00:23:18,400 --> 00:23:19,560 in etc.git.config. 497 00:23:19,700 --> 00:23:22,000 There is a global one in your own folder 498 00:23:22,000 --> 00:23:23,920 in .git.config, and there is a local one 499 00:23:23,920 --> 00:23:26,640 in .git.config of the current folder. 500 00:23:28,800 --> 00:23:30,460 Indeed, cloning does not retrieve 501 00:23:30,460 --> 00:23:31,460 the local configuration 502 00:23:32,120 --> 00:23:33,660 nor the other kind of configuration. 503 00:23:34,160 --> 00:23:36,000 They have to be files you created yourself 504 00:23:36,000 --> 00:23:36,620 on your system, 505 00:23:36,800 --> 00:23:39,260 but you can put Git repos in archives. 506 00:23:39,800 --> 00:23:41,700 So it would come with its own local configuration 507 00:23:41,700 --> 00:23:42,600 that may be unsafe. 508 00:23:43,020 --> 00:23:45,820 And Justin Steven and us 509 00:23:45,820 --> 00:23:46,960 we collided on some research 510 00:23:46,960 --> 00:23:49,500 where we tried to see if we would be able 511 00:23:49,500 --> 00:23:51,580 to hide Git repositories 512 00:23:52,340 --> 00:23:54,320 in the folders of Git repositories. 513 00:23:54,520 --> 00:23:55,640 So we would be able to clone 514 00:23:55,640 --> 00:23:56,600 these files 515 00:23:57,240 --> 00:23:58,560 when you clone the main repository. 516 00:23:59,800 --> 00:24:01,040 And in a Git config, 517 00:24:01,320 --> 00:24:03,760 you can have interesting directives, 518 00:24:03,780 --> 00:24:05,420 like the one we have here, 519 00:24:05,560 --> 00:24:06,620 which is called .fsmonitor, 520 00:24:06,820 --> 00:24:09,060 which is a way to tell Git, 521 00:24:09,800 --> 00:24:12,020 run this command to see if there were some changes 522 00:24:12,020 --> 00:24:13,680 since the last time you run this command. 523 00:24:13,980 --> 00:24:15,020 The default one is really good, 524 00:24:15,140 --> 00:24:16,520 but if you have a huge monorepo, 525 00:24:16,720 --> 00:24:17,520 if you have a thousand files, 526 00:24:17,960 --> 00:24:20,020 it's going to take some time to find out the differences. 527 00:24:20,240 --> 00:24:22,100 So sometimes you may want something more specific 528 00:24:22,100 --> 00:24:23,460 for better performance, 529 00:24:23,680 --> 00:24:25,180 and not lag in the IDE 530 00:24:25,180 --> 00:24:27,140 or when you get in your developer shell. 531 00:24:27,680 --> 00:24:29,080 So it's not specific to VS Code, 532 00:24:29,240 --> 00:24:31,440 and we found out that basically 533 00:24:31,440 --> 00:24:33,980 planting malicious configuration in Git folders 534 00:24:33,980 --> 00:24:36,280 it's pretty easy to trick people 535 00:24:36,280 --> 00:24:37,280 into opening these folders, 536 00:24:39,800 --> 00:24:40,560 and they can use arbitrary commands. 537 00:24:40,960 --> 00:24:42,600 And in fact, the first demonstration 538 00:24:42,600 --> 00:24:43,880 we've shown in the intro 539 00:24:43,880 --> 00:24:45,840 was based on a malicious Git folder 540 00:24:45,840 --> 00:24:47,280 that could have been just a zip file 541 00:24:47,280 --> 00:24:48,160 or a sub-repo. 542 00:24:49,900 --> 00:24:52,040 So this was a command, which was a calc, 543 00:24:52,040 --> 00:24:53,520 and we have the workspace trust thing. 544 00:24:53,980 --> 00:24:55,500 Because the Git extension runs 545 00:24:55,500 --> 00:24:56,680 in trusted workspaces, 546 00:24:56,960 --> 00:24:59,940 it runs before the proper displays to the user. 547 00:25:00,060 --> 00:25:01,520 So you have no way to prevent everything. 548 00:25:01,780 --> 00:25:03,940 You cannot just review every single Git repo 549 00:25:03,940 --> 00:25:05,280 that you're cloning or that you're downloading 550 00:25:05,280 --> 00:25:05,880 from the internet. 551 00:25:09,800 --> 00:25:10,080 that we found. 552 00:25:10,580 --> 00:25:12,380 So we told you it worked in VS Code, 553 00:25:12,560 --> 00:25:14,320 but it also works in developer shells. 554 00:25:14,580 --> 00:25:17,220 So in this case I have ZSH 555 00:25:17,220 --> 00:25:19,540 with all my ZSH team 556 00:25:19,540 --> 00:25:22,140 that includes a Git extension 557 00:25:22,140 --> 00:25:23,980 to show in my shell 558 00:25:23,980 --> 00:25:25,940 on which branch I'm running 559 00:25:25,940 --> 00:25:28,540 and give me some contextualized information 560 00:25:28,540 --> 00:25:29,440 on my Git repo. 561 00:25:30,020 --> 00:25:32,660 So it runs every time I CD in a new directory. 562 00:25:32,900 --> 00:25:34,060 So if I go on the desktop 563 00:25:34,900 --> 00:25:36,300 and then I go on my 564 00:25:36,300 --> 00:25:38,640 malicious Git repo, it's going to pop again. 565 00:25:39,800 --> 00:25:40,840 So if I'm CD-ing into something 566 00:25:40,840 --> 00:25:42,500 that runs Git in a directory 567 00:25:42,500 --> 00:25:44,540 and having something that runs Git 568 00:25:44,540 --> 00:25:46,180 and might be off, it's unsafe. 569 00:25:46,640 --> 00:25:49,120 So in the end, all these developer tools 570 00:25:49,120 --> 00:25:51,640 they don't really kind of acknowledge 571 00:25:51,640 --> 00:25:52,440 the security risks 572 00:25:52,440 --> 00:25:54,140 and they say, oh yeah, it's up to you 573 00:25:54,140 --> 00:25:57,540 to not work with malicious Git repos 574 00:25:57,540 --> 00:25:59,720 but you can't just review 575 00:25:59,720 --> 00:26:01,140 everything by yourself every single time. 576 00:26:01,680 --> 00:26:03,180 So there are a lot of things out there 577 00:26:03,180 --> 00:26:04,900 that are still affected by this thing 578 00:26:04,900 --> 00:26:06,260 like see all my ZSH prompts 579 00:26:06,260 --> 00:26:09,620 and we've also reported it to many IDEs 580 00:26:09,800 --> 00:26:11,740 many shell integrations 581 00:26:11,740 --> 00:26:13,560 some of them tried to fix it 582 00:26:13,560 --> 00:26:15,440 but in the end it should be on Git to fix it 583 00:26:15,440 --> 00:26:17,280 and they said, no, it's an accepted risk 584 00:26:17,280 --> 00:26:19,200 you should not work with untrusted Git repos. 585 00:26:20,020 --> 00:26:21,620 So now Paul's going to show you a few things 586 00:26:21,620 --> 00:26:23,000 about XSSes in VS Code. 587 00:26:25,660 --> 00:26:27,740 Yes, so as I told you earlier 588 00:26:27,740 --> 00:26:30,160 VS Code has a built-in browser 589 00:26:30,160 --> 00:26:31,520 part of it is Chromium 590 00:26:31,520 --> 00:26:33,480 so of course there can be 591 00:26:33,480 --> 00:26:34,280 cross-site scripting 592 00:26:34,980 --> 00:26:37,340 and in an IDE like VS Code 593 00:26:37,340 --> 00:26:39,280 XSS bugs can be very nasty 594 00:26:39,800 --> 00:26:41,540 because some parts of the UI 595 00:26:41,540 --> 00:26:43,680 always have to be kind of privileged 596 00:26:43,680 --> 00:26:45,540 I showed you the red part 597 00:26:45,540 --> 00:26:46,240 the workbench 598 00:26:46,240 --> 00:26:48,400 you will have buttons like save file 599 00:26:48,400 --> 00:26:50,000 or run my build command 600 00:26:50,000 --> 00:26:52,420 and if you press that button in the UI 601 00:26:52,420 --> 00:26:53,720 that should happen 602 00:26:53,720 --> 00:26:56,940 so the UI has to have a way to make this happen 603 00:26:57,500 --> 00:26:59,380 and the other thing is that extensions 604 00:26:59,380 --> 00:27:01,920 can have their own UI part 605 00:27:01,920 --> 00:27:02,540 in web views 606 00:27:02,540 --> 00:27:04,840 as I showed you for the markdown preview extension 607 00:27:05,600 --> 00:27:07,280 and even if we would say 608 00:27:07,280 --> 00:27:09,260 all the code of VS Code itself 609 00:27:09,800 --> 00:27:10,900 is clean, no issues 610 00:27:10,900 --> 00:27:12,060 no security vulnerabilities 611 00:27:12,680 --> 00:27:14,340 all the extensions that you install 612 00:27:14,340 --> 00:27:15,440 from the marketplace 613 00:27:15,440 --> 00:27:17,020 could still have something 614 00:27:17,020 --> 00:27:19,480 and that's then the first foot in the door 615 00:27:19,480 --> 00:27:21,380 to start your XSS attack 616 00:27:22,460 --> 00:27:25,080 so let's look at the first example 617 00:27:25,740 --> 00:27:26,640 this is a cool one 618 00:27:26,640 --> 00:27:29,440 it was found by the Grand Pew 619 00:27:29,440 --> 00:27:31,040 and Sirius of ElectroVault 620 00:27:31,040 --> 00:27:32,300 they presented it here 621 00:27:32,300 --> 00:27:33,660 at DEF CON last year 622 00:27:33,660 --> 00:27:35,180 so we will go quickly over it 623 00:27:35,180 --> 00:27:37,680 basically they found a way to control 624 00:27:39,800 --> 00:27:41,060 an extensions web view 625 00:27:41,060 --> 00:27:43,300 in this case the markdown preview extension 626 00:27:43,300 --> 00:27:46,240 and then they used a meta HTML tag 627 00:27:46,240 --> 00:27:47,080 to redirect away 628 00:27:47,080 --> 00:27:49,740 so basically now their attacker page 629 00:27:49,740 --> 00:27:51,120 is running in this web view 630 00:27:51,120 --> 00:27:51,940 in this frame 631 00:27:51,940 --> 00:27:54,360 and from there they can start their attack 632 00:27:54,360 --> 00:27:57,700 so they already took control over the frame 633 00:27:57,700 --> 00:27:58,340 over the web view 634 00:27:58,340 --> 00:28:01,520 and then they used the post message 635 00:28:01,520 --> 00:28:02,640 message passing interface 636 00:28:02,640 --> 00:28:04,920 to talk to the outer part, to the workbench 637 00:28:05,680 --> 00:28:07,720 and there was an unsafe handler 638 00:28:07,720 --> 00:28:09,260 that allowed them to load 639 00:28:09,800 --> 00:28:12,320 any file in that privileged frame 640 00:28:13,000 --> 00:28:14,160 but there was a clue 641 00:28:14,160 --> 00:28:15,860 they can't just load 642 00:28:15,860 --> 00:28:16,960 their own file 643 00:28:16,960 --> 00:28:18,700 from the attacker server 644 00:28:18,700 --> 00:28:20,780 and run any code on the system 645 00:28:20,780 --> 00:28:23,420 they had to find a way to actually 646 00:28:23,420 --> 00:28:25,340 load the file via the correct 647 00:28:25,340 --> 00:28:27,080 origin, via the correct protocol 648 00:28:27,660 --> 00:28:29,520 and they found a bug in VS Code itself 649 00:28:29,520 --> 00:28:30,940 so they could do that 650 00:28:30,940 --> 00:28:33,940 and after that they could use the node integration 651 00:28:33,940 --> 00:28:35,800 which is an electron setting 652 00:28:35,800 --> 00:28:36,760 basically that says 653 00:28:36,760 --> 00:28:39,660 this origin can just use 654 00:28:39,800 --> 00:28:42,000 the node.js APIs to run commands 655 00:28:42,000 --> 00:28:42,480 and so on 656 00:28:44,040 --> 00:28:45,700 then there was a pretty 657 00:28:45,700 --> 00:28:47,540 similar finding, this time by 658 00:28:47,540 --> 00:28:49,460 Justin Steven, he found that in the 659 00:28:49,460 --> 00:28:51,660 Jupyter notebook extension you can also 660 00:28:51,660 --> 00:28:53,380 render certain things as markdown 661 00:28:53,380 --> 00:28:55,780 and then it's the same thing over again 662 00:28:55,780 --> 00:28:57,000 you can put some HTML 663 00:28:57,780 --> 00:28:59,540 and first of all he only found 664 00:28:59,540 --> 00:29:01,620 how to leak arbitrary files 665 00:29:01,620 --> 00:29:02,800 because there's this fun 666 00:29:02,800 --> 00:29:04,920 CDN origin 667 00:29:04,920 --> 00:29:06,160 that's a special one 668 00:29:06,160 --> 00:29:08,840 and yes the plus in there in the domain name 669 00:29:09,800 --> 00:29:09,980 is a mistake 670 00:29:09,980 --> 00:29:13,040 and you can basically put an absolute path 671 00:29:13,040 --> 00:29:15,540 and read any file by just 672 00:29:15,540 --> 00:29:16,200 loading it 673 00:29:16,200 --> 00:29:18,560 and then Luca Grattoni by 674 00:29:18,560 --> 00:29:21,340 used it to 675 00:29:21,340 --> 00:29:22,620 improve it to an RCE 676 00:29:22,620 --> 00:29:24,280 basically by using the same 677 00:29:24,280 --> 00:29:26,840 last stage as the other guys 678 00:29:27,680 --> 00:29:28,000 to 679 00:29:29,460 --> 00:29:31,460 compromise the privileged 680 00:29:31,460 --> 00:29:32,140 origin 681 00:29:33,340 --> 00:29:34,720 and then there was a 682 00:29:34,720 --> 00:29:36,200 pretty different finding 683 00:29:36,200 --> 00:29:37,180 this was by 684 00:29:39,800 --> 00:29:41,420 they also used the 685 00:29:41,420 --> 00:29:43,760 Jupyter Python notebook markdown 686 00:29:43,760 --> 00:29:45,800 trick to render something from there as markdown 687 00:29:45,800 --> 00:29:47,840 but they didn't have to go up 688 00:29:47,840 --> 00:29:49,800 this chain to first compromise the privileged 689 00:29:49,800 --> 00:29:51,700 origin and then use 690 00:29:51,700 --> 00:29:53,260 the node integration, they found 691 00:29:53,260 --> 00:29:55,220 a way to go around that 692 00:29:55,800 --> 00:29:57,480 which is they just created 693 00:29:57,480 --> 00:29:59,640 a link tag with a 694 00:29:59,640 --> 00:30:01,680 command link from the command protocol 695 00:30:02,280 --> 00:30:03,700 and this is a special 696 00:30:03,700 --> 00:30:05,660 one in VSCode so this allows 697 00:30:05,660 --> 00:30:07,780 you to execute internal VSCode 698 00:30:07,780 --> 00:30:09,180 commands so not an OS command 699 00:30:09,800 --> 00:30:10,860 but basically something like 700 00:30:10,860 --> 00:30:13,500 focus the taskbar 701 00:30:13,500 --> 00:30:15,380 or open a terminal 702 00:30:15,380 --> 00:30:17,300 and in this case they 703 00:30:17,300 --> 00:30:19,380 auto clicked this link with Javascript 704 00:30:19,380 --> 00:30:21,320 so the command would be executed 705 00:30:21,320 --> 00:30:23,540 and they used the command that opens 706 00:30:23,540 --> 00:30:25,600 a new terminal because with that you can specify 707 00:30:25,600 --> 00:30:27,560 which shell executable and 708 00:30:27,560 --> 00:30:28,640 which arguments to execute 709 00:30:28,640 --> 00:30:31,300 and that gives you direct arbitrary 710 00:30:31,300 --> 00:30:32,140 code execution 711 00:30:33,600 --> 00:30:35,180 and from this we noticed 712 00:30:35,680 --> 00:30:37,560 a lot of the UI of VSCode is 713 00:30:37,560 --> 00:30:39,000 actually markdown 714 00:30:39,800 --> 00:30:41,820 the tooltips, the status bar at the bottom 715 00:30:41,820 --> 00:30:43,660 the menus, a lot of things 716 00:30:43,660 --> 00:30:45,340 are just markdown strings being rendered 717 00:30:45,340 --> 00:30:47,180 because it's easier than 718 00:30:47,180 --> 00:30:48,600 writing HTML I guess 719 00:30:48,600 --> 00:30:51,500 and if there's user or 720 00:30:51,500 --> 00:30:53,760 attacker control data being interpolated 721 00:30:53,760 --> 00:30:55,740 into this markdown then markdown 722 00:30:55,740 --> 00:30:57,580 injection can happen and if that 723 00:30:57,580 --> 00:30:59,720 happens and in the place 724 00:30:59,720 --> 00:31:01,440 of the code the markdown 725 00:31:01,440 --> 00:31:02,980 string is set to being trusted 726 00:31:03,760 --> 00:31:05,800 then you can use these command 727 00:31:05,800 --> 00:31:07,420 links in markdown as well 728 00:31:07,420 --> 00:31:08,700 so if you have markdown injection 729 00:31:09,800 --> 00:31:10,860 you can just put in a link 730 00:31:10,860 --> 00:31:13,620 to again use this command 731 00:31:13,620 --> 00:31:15,640 to open a terminal with your own 732 00:31:15,640 --> 00:31:16,880 command basically 733 00:31:17,560 --> 00:31:19,360 but it always requires user interaction 734 00:31:19,360 --> 00:31:21,480 because the user still has to click on the link 735 00:31:21,480 --> 00:31:23,320 it can't be auto clicked unless you have 736 00:31:23,320 --> 00:31:25,000 Javascript execution in the first place 737 00:31:26,340 --> 00:31:27,980 so with that in mind 738 00:31:27,980 --> 00:31:29,520 we looked at some third party extensions 739 00:31:29,520 --> 00:31:31,040 for example GitLens 740 00:31:31,620 --> 00:31:33,540 this is an extension with 25 million 741 00:31:33,540 --> 00:31:35,200 installed, it's pretty common 742 00:31:35,200 --> 00:31:37,840 and pretty popular and there we found 743 00:31:37,840 --> 00:31:39,420 that while they rendered 744 00:31:39,800 --> 00:31:41,760 some hover tooltips for some commits 745 00:31:41,760 --> 00:31:43,860 we could inject markdown 746 00:31:43,860 --> 00:31:45,580 and in this case the 747 00:31:45,580 --> 00:31:47,400 data came from a commit message 748 00:31:47,400 --> 00:31:49,960 and it was then unsafely interpolated 749 00:31:49,960 --> 00:31:50,840 into a markdown string 750 00:31:51,670 --> 00:31:53,740 where we could then add a link 751 00:31:53,740 --> 00:31:55,760 and in this case we didn't use 752 00:31:55,760 --> 00:31:57,440 the other one because we also 753 00:31:57,440 --> 00:31:59,380 wanted it to work in untrusted workspace 754 00:31:59,380 --> 00:32:01,620 to again bypass this workspace 755 00:32:01,620 --> 00:32:03,900 trust prompt so we used 756 00:32:03,900 --> 00:32:05,100 the install extension command 757 00:32:05,710 --> 00:32:07,780 and because the marketplace 758 00:32:07,780 --> 00:32:09,580 is open I can just publish 759 00:32:09,800 --> 00:32:10,460 any extension there 760 00:32:10,460 --> 00:32:13,300 you could publish a malicious extension 761 00:32:13,300 --> 00:32:15,520 and then use this command to 762 00:32:15,520 --> 00:32:17,660 install it at the victims vs code instance 763 00:32:17,660 --> 00:32:19,680 and this was fixed 764 00:32:19,680 --> 00:32:21,780 pretty quickly in version 14 765 00:32:21,780 --> 00:32:22,960 CV is still pending 766 00:32:22,960 --> 00:32:24,740 but it's a first good example 767 00:32:24,740 --> 00:32:26,760 and this is basically how it looks like 768 00:32:26,760 --> 00:32:29,480 so you open some repo 769 00:32:29,480 --> 00:32:31,800 and you can see the blue bar on top 770 00:32:31,800 --> 00:32:33,340 so it's still in the untrusted mode 771 00:32:33,340 --> 00:32:35,180 but if you hover a line 772 00:32:35,180 --> 00:32:37,440 and then click on this very innocent 773 00:32:37,440 --> 00:32:38,780 looking message 774 00:32:39,800 --> 00:32:41,300 then a calc pops showing that 775 00:32:41,300 --> 00:32:42,620 we could have executed any command 776 00:32:43,620 --> 00:32:45,740 and we found a similar thing 777 00:32:45,740 --> 00:32:47,600 in the github pull requests 778 00:32:47,600 --> 00:32:48,680 and issues extension 779 00:32:48,680 --> 00:32:50,840 which has 13 million installs 780 00:32:50,840 --> 00:32:51,740 so also pretty popular 781 00:32:51,740 --> 00:32:53,860 it's by github themselves 782 00:32:53,860 --> 00:32:56,560 and again in a hover tooltip 783 00:32:56,560 --> 00:32:58,880 we found a markdown injection 784 00:32:59,640 --> 00:33:00,720 and in this case 785 00:33:00,720 --> 00:33:02,840 it didn't come from the local 786 00:33:03,570 --> 00:33:05,700 repository or the local workspace folder 787 00:33:05,700 --> 00:33:08,100 but it can be exploited remotely 788 00:33:08,100 --> 00:33:09,040 which means 789 00:33:09,800 --> 00:33:11,740 let's say a maintainer is working on that project 790 00:33:11,740 --> 00:33:13,560 they use this extension to look at issues 791 00:33:13,560 --> 00:33:15,740 and PRs and then I as an attacker 792 00:33:15,740 --> 00:33:17,480 create a malicious PR 793 00:33:17,480 --> 00:33:19,760 which has the exploit 794 00:33:19,760 --> 00:33:20,620 payload in the body 795 00:33:20,620 --> 00:33:23,400 and if they then use the extension to look at it 796 00:33:23,400 --> 00:33:24,940 again we have the markdown injection 797 00:33:24,940 --> 00:33:26,880 and if they click the link it's GG 798 00:33:26,880 --> 00:33:29,060 so this one was also fixed pretty soon 799 00:33:29,060 --> 00:33:30,460 CV is also pending 800 00:33:30,940 --> 00:33:32,400 and this is what it looks like 801 00:33:32,400 --> 00:33:34,800 so first we create this again 802 00:33:34,800 --> 00:33:37,580 very important looking issue 803 00:33:37,580 --> 00:33:38,500 on github 804 00:33:40,180 --> 00:33:42,380 so if they use the extension 805 00:33:42,380 --> 00:33:43,180 to look at this 806 00:33:43,650 --> 00:33:46,040 again there's a very innocent link 807 00:33:46,040 --> 00:33:47,360 and if they click on it 808 00:33:47,360 --> 00:33:48,720 a calculator opens 809 00:33:48,720 --> 00:33:51,580 so yeah this was basically the last 810 00:33:51,580 --> 00:33:52,580 of our attack surfaces 811 00:33:52,580 --> 00:33:55,280 as we've seen there's a lot of different things 812 00:33:55,280 --> 00:33:55,960 that can go wrong 813 00:33:55,960 --> 00:33:58,220 so let's see how things went 814 00:33:58,220 --> 00:33:59,860 when we were reporting the bugs 815 00:33:59,860 --> 00:34:01,120 that we found to microsoft 816 00:34:02,260 --> 00:34:05,040 so we used the official MSRC 817 00:34:05,660 --> 00:34:06,720 platform for that 818 00:34:07,580 --> 00:34:09,040 it's pretty cool 819 00:34:09,800 --> 00:34:11,780 compared to bug bounty platforms 820 00:34:11,780 --> 00:34:13,120 because it allows you to 821 00:34:13,120 --> 00:34:15,600 speak about the bugs after they were fixed 822 00:34:15,600 --> 00:34:17,420 which we like to do 823 00:34:17,420 --> 00:34:19,300 for some people it has 824 00:34:19,300 --> 00:34:21,440 a little bit better reputation because of delays 825 00:34:21,440 --> 00:34:23,200 but for us personally 826 00:34:23,200 --> 00:34:24,240 we had a good experience 827 00:34:24,240 --> 00:34:25,680 not many delays 828 00:34:26,600 --> 00:34:29,780 and it's a nice thing because everything is centralized there 829 00:34:29,780 --> 00:34:30,840 even the attribution 830 00:34:30,840 --> 00:34:32,080 and you can always see 831 00:34:32,080 --> 00:34:34,900 it's in development, it's being released soon 832 00:34:34,900 --> 00:34:37,260 so you don't have to wait without a response 833 00:34:37,260 --> 00:34:38,760 from the vendor for months 834 00:34:40,400 --> 00:34:42,220 so let's look at the bounties we got 835 00:34:42,220 --> 00:34:43,500 so for the first one 836 00:34:43,500 --> 00:34:45,700 which was the git local level configuration bug 837 00:34:45,700 --> 00:34:47,340 we got a 30k bounty 838 00:34:47,340 --> 00:34:48,400 which was pretty cool 839 00:34:48,400 --> 00:34:50,000 we donated it to charity 840 00:34:50,000 --> 00:34:52,620 and we even wondered a little bit 841 00:34:52,620 --> 00:34:53,440 why it was so much 842 00:34:53,440 --> 00:34:55,180 because we didn't know 843 00:34:55,180 --> 00:34:58,040 and it fell into the Azure bug bounty 844 00:34:58,040 --> 00:35:00,380 and we even asked them why it's so much 845 00:35:00,380 --> 00:35:02,320 do they have a hosted vs code version somewhere 846 00:35:02,320 --> 00:35:03,980 but we never got a response 847 00:35:04,800 --> 00:35:07,120 so the year after we found something again 848 00:35:07,120 --> 00:35:09,620 which was this time the protocol handler argument 849 00:35:09,800 --> 00:35:10,020 injection 850 00:35:10,020 --> 00:35:11,780 and we thought okay, easy 851 00:35:11,780 --> 00:35:14,320 we get another 30k which we can give to charity 852 00:35:14,320 --> 00:35:15,000 pretty cool 853 00:35:15,000 --> 00:35:16,740 but the response was 854 00:35:16,740 --> 00:35:17,600 oh wait a minute 855 00:35:17,600 --> 00:35:20,600 last time we awarded you the bug bounty in error 856 00:35:21,820 --> 00:35:24,340 and actually all extensions 857 00:35:24,340 --> 00:35:26,220 including the built in ones 858 00:35:26,220 --> 00:35:27,460 that are shipped with vs code 859 00:35:27,460 --> 00:35:28,380 are out of scope 860 00:35:28,380 --> 00:35:30,520 sorry, this time you're not getting any bounty 861 00:35:33,160 --> 00:35:34,540 we kind of disagree 862 00:35:34,540 --> 00:35:37,080 we think extensions that are built in 863 00:35:37,080 --> 00:35:37,940 and shipped with it 864 00:35:39,800 --> 00:35:40,420 are out of scope for bug bounty 865 00:35:40,420 --> 00:35:42,660 but at least they still fix it 866 00:35:42,660 --> 00:35:45,480 and this even brought us 867 00:35:45,480 --> 00:35:46,860 onto the MSRC leaderboard 868 00:35:46,860 --> 00:35:48,100 in Q2 last year 869 00:35:48,100 --> 00:35:50,580 and the things that I showed in GitLens 870 00:35:50,580 --> 00:35:52,180 and the GitHub extension 871 00:35:52,180 --> 00:35:54,600 brought us on the leaderboard this year 872 00:35:54,600 --> 00:35:55,320 which was pretty cool 873 00:35:55,320 --> 00:35:58,840 because we could go to the Microsoft researcher invite only party 874 00:35:58,840 --> 00:35:59,360 like yesterday 875 00:36:00,960 --> 00:36:03,320 alright, so now let's wrap things up 876 00:36:03,820 --> 00:36:04,740 we've seen a lot 877 00:36:05,480 --> 00:36:07,220 so the first things that we learned 878 00:36:07,220 --> 00:36:09,020 is that CVEs 879 00:36:09,800 --> 00:36:10,380 at buggy components 880 00:36:11,420 --> 00:36:12,600 a lot of the 881 00:36:13,400 --> 00:36:15,520 fixed vulnerabilities were bypassed 882 00:36:15,520 --> 00:36:17,380 by Justin Steven because he just looked at the patch 883 00:36:17,380 --> 00:36:18,700 and saw that it's not complete 884 00:36:19,740 --> 00:36:20,860 and that's probably 885 00:36:21,360 --> 00:36:23,160 will probably be the same case 886 00:36:23,160 --> 00:36:24,720 in the future so if you want to 887 00:36:24,720 --> 00:36:27,400 find some easy bugs just look at what they fix 888 00:36:27,400 --> 00:36:28,700 and see if the patch is complete 889 00:36:29,700 --> 00:36:31,580 the next thing we want you to remember 890 00:36:31,580 --> 00:36:33,080 is if you click trust 891 00:36:33,080 --> 00:36:33,960 you lose 892 00:36:35,180 --> 00:36:37,640 for example the git local configuration 893 00:36:37,640 --> 00:36:39,280 exploit still works 894 00:36:39,800 --> 00:36:41,600 if you trust the workspace 895 00:36:41,600 --> 00:36:43,640 because the way git works 896 00:36:43,640 --> 00:36:45,460 and it's basically not really possible 897 00:36:45,460 --> 00:36:46,620 for VS Code to fix it 898 00:36:46,620 --> 00:36:48,780 and they also say if you trust 899 00:36:48,780 --> 00:36:50,060 it's your problem now 900 00:36:50,060 --> 00:36:51,480 we want you 901 00:36:52,420 --> 00:36:54,700 so please don't click on trust 902 00:36:54,700 --> 00:36:57,240 just to get this dialogue 903 00:36:57,240 --> 00:36:58,740 that makes you away 904 00:36:59,660 --> 00:37:00,740 think about it 905 00:37:00,740 --> 00:37:02,860 and if you don't trust it 906 00:37:02,860 --> 00:37:04,380 press I don't trust it 907 00:37:05,700 --> 00:37:07,080 and then we found that 908 00:37:07,080 --> 00:37:08,820 attacking desktop applications is fun 909 00:37:09,800 --> 00:37:10,060 it's a lot different 910 00:37:10,060 --> 00:37:12,620 compared to attacking server applications 911 00:37:12,620 --> 00:37:14,160 that you can reach over the internet 912 00:37:14,160 --> 00:37:17,060 because it has a whole new set of assumptions 913 00:37:17,060 --> 00:37:18,320 and attack surfaces 914 00:37:19,520 --> 00:37:21,300 and we've also seen that 915 00:37:21,300 --> 00:37:23,080 bug bounty scope doesn't always reflect 916 00:37:23,080 --> 00:37:23,860 the real threat model 917 00:37:24,600 --> 00:37:26,900 again we think that built-in modules 918 00:37:26,900 --> 00:37:29,040 should not be excluded from the bug bounty scope 919 00:37:29,680 --> 00:37:31,320 but we can change that 920 00:37:32,000 --> 00:37:32,960 and finally 921 00:37:34,440 --> 00:37:35,180 it's still 922 00:37:35,680 --> 00:37:37,300 unclear for many developer tools 923 00:37:37,300 --> 00:37:38,920 what's the security 924 00:37:39,800 --> 00:37:40,060 of the model 925 00:37:40,600 --> 00:37:42,360 they're not built with security in mind 926 00:37:42,360 --> 00:37:43,420 it's not super clear 927 00:37:43,420 --> 00:37:45,140 what's the responsibility of the user 928 00:37:45,140 --> 00:37:47,020 and what's the responsibility of the tool 929 00:37:47,020 --> 00:37:49,180 to make sure everything is safe 930 00:37:49,180 --> 00:37:51,120 no random commands are executed 931 00:37:51,620 --> 00:37:54,060 and if you don't know that it's your job as a user 932 00:37:54,060 --> 00:37:56,160 then you can't really protect yourself 933 00:37:57,140 --> 00:37:58,800 we personally like the principle 934 00:37:58,800 --> 00:37:59,500 of least surprise 935 00:37:59,500 --> 00:38:01,840 so we think the tool should not do 936 00:38:01,840 --> 00:38:03,080 some magic under the hood 937 00:38:03,080 --> 00:38:04,220 that you don't know will happen 938 00:38:05,200 --> 00:38:06,880 so it should warn you 939 00:38:09,800 --> 00:38:11,200 it's a very welcome addition 940 00:38:11,200 --> 00:38:11,940 and a good start 941 00:38:11,940 --> 00:38:13,680 and we hope other developer tools 942 00:38:13,680 --> 00:38:15,100 will include it as well 943 00:38:16,080 --> 00:38:16,760 thank you