1 00:00:00,000 --> 00:00:03,180 Okay, let's start. First of all, thanks for coming today. 2 00:00:03,440 --> 00:00:06,100 It's appreciated. And let's start. 3 00:00:06,940 --> 00:00:08,880 We're going to talk about abusing FIFO extensions. 4 00:00:09,580 --> 00:00:12,460 In the episode, we wrote abusing FIFO's add-ons, 5 00:00:12,500 --> 00:00:15,800 but it's going to be entirely focused on the extensions. 6 00:00:17,760 --> 00:00:19,860 Before I would like to start, I would like to ask you, 7 00:00:19,920 --> 00:00:22,320 how many people here are using FIFO's extensions? 8 00:00:22,580 --> 00:00:24,080 Can you please raise your hand? 9 00:00:25,580 --> 00:00:28,020 That's pretty much a lot of people. 10 00:00:30,400 --> 00:00:33,700 I use extensions as well, and also Nick. 11 00:00:34,660 --> 00:00:37,640 They are cool, but they are not so secure, 12 00:00:37,860 --> 00:00:39,020 and we'll show you why. 13 00:00:40,780 --> 00:00:42,620 My name is Roberto Sugilivrani. 14 00:00:42,740 --> 00:00:45,760 I work for securityassessment.com in New Zealand, 15 00:00:46,440 --> 00:00:47,620 senior security consultant. 16 00:00:48,140 --> 00:00:49,580 I'm the almost New Zealand leader, 17 00:00:50,660 --> 00:00:52,860 and my website, malarish.net, 18 00:00:52,960 --> 00:00:55,140 you can find some articles on my research. 19 00:00:55,600 --> 00:00:57,380 And beside me, that's Nick. 20 00:00:57,780 --> 00:00:58,740 Hi, I'm Nick Freeman. 21 00:00:59,220 --> 00:00:59,980 Also, as a consultant, 22 00:00:59,980 --> 00:01:01,720 I'm a security consultant at securityassessment.com. 23 00:01:01,820 --> 00:01:03,340 My personal site's up there as well, 24 00:01:03,460 --> 00:01:05,100 and email addresses if you want to contact us 25 00:01:05,100 --> 00:01:05,740 after the presentation. 26 00:01:07,720 --> 00:01:09,900 So, just a brief overview of the agenda for today. 27 00:01:10,280 --> 00:01:11,700 We're going to give you a quick introduction 28 00:01:11,700 --> 00:01:13,380 to what FIFO extensions are, 29 00:01:13,560 --> 00:01:16,760 and what makes up the application stack 30 00:01:16,760 --> 00:01:18,920 for the Mozilla platform. 31 00:01:19,680 --> 00:01:21,540 Then cover some security threats and risks 32 00:01:21,540 --> 00:01:22,460 associated with extensions. 33 00:01:23,020 --> 00:01:25,420 Then we're going to show you all of the bugs that we found. 34 00:01:25,620 --> 00:01:26,700 We've got a disclosure summary, 35 00:01:26,860 --> 00:01:28,760 and then some demos and exploits. 36 00:01:28,840 --> 00:01:29,860 Some previously unreleased, 37 00:01:29,860 --> 00:01:30,600 vulnerabilities as well. 38 00:01:32,720 --> 00:01:33,240 Cool. 39 00:01:35,660 --> 00:01:36,800 Okay, thanks, Nick. 40 00:01:37,340 --> 00:01:39,800 Short introduction, just to give you 41 00:01:39,800 --> 00:01:44,440 an insight on FIFO extension technologies. 42 00:01:46,200 --> 00:01:48,640 Well, if we consider extensions just software 43 00:01:48,640 --> 00:01:49,380 at the end of the day, 44 00:01:49,440 --> 00:01:51,180 and if you think about internet explorers 45 00:01:51,180 --> 00:01:52,420 like ActiveX controls, 46 00:01:53,140 --> 00:01:55,940 I see, actually, so many ends before, 47 00:01:56,080 --> 00:01:58,020 and I think the reason why you have 48 00:01:58,020 --> 00:01:59,840 FIFO extension installed is that's because, 49 00:01:59,840 --> 00:02:01,100 because you need extra functionality. 50 00:02:01,400 --> 00:02:03,720 You need something which is not provided by default 51 00:02:03,720 --> 00:02:04,760 in your FIFOX browser, 52 00:02:05,040 --> 00:02:07,920 and that's the reason why extension actually exists. 53 00:02:09,140 --> 00:02:13,180 As I said before, according to FIFO's Mozilla terminology, 54 00:02:13,460 --> 00:02:16,740 they use the word add-on, but with the word add-on, 55 00:02:16,800 --> 00:02:18,160 they're actually indicating different things, 56 00:02:18,240 --> 00:02:20,060 like extensions, or language packs, 57 00:02:20,300 --> 00:02:22,400 or themes, search engine plug-ins. 58 00:02:22,840 --> 00:02:24,280 For the rest of this presentation, 59 00:02:24,420 --> 00:02:25,820 we're going to stick to extensions, 60 00:02:26,140 --> 00:02:27,200 just to avoid any confusion. 61 00:02:30,020 --> 00:02:32,880 The scheme you can see there, it's a very nice diagram, 62 00:02:33,400 --> 00:02:35,780 showing all different components which are used in extension, 63 00:02:36,020 --> 00:02:38,300 and most of the Mozilla applications. 64 00:02:39,200 --> 00:02:42,000 But what I would like to give you an overview, 65 00:02:42,220 --> 00:02:44,520 it's more the technology which are really related 66 00:02:44,520 --> 00:02:46,660 to extensions, so you can better understand 67 00:02:46,660 --> 00:02:48,640 when we're going to show you some vulnerabilities 68 00:02:48,640 --> 00:02:50,560 and the demos at the end of the talk. 69 00:02:52,120 --> 00:02:53,140 Starting from the Zool, 70 00:02:53,240 --> 00:02:55,000 which is the XML user interface language, 71 00:02:55,180 --> 00:02:58,860 the one that you see red, that's basically used 72 00:02:58,860 --> 00:03:01,160 to provide the graphic layout of the extensions. 73 00:03:01,760 --> 00:03:05,300 Just to give you a sample, that's the FireFTP. 74 00:03:05,620 --> 00:03:07,620 I don't know if any of you use that. 75 00:03:08,380 --> 00:03:10,760 That's one simple page, that's a Zool page. 76 00:03:11,020 --> 00:03:12,400 I don't know if you can see the URL, 77 00:03:12,600 --> 00:03:13,700 but that's a Zool page. 78 00:03:13,980 --> 00:03:15,900 And that's basically defined the graphic layout, 79 00:03:16,180 --> 00:03:19,020 scroll bars, any buttons you might have. 80 00:03:21,260 --> 00:03:24,340 And the other very important component is XBL, 81 00:03:24,960 --> 00:03:26,620 XML binding user language. 82 00:03:27,460 --> 00:03:28,840 That's also used to provide the graphic layout of the extensions. 83 00:03:28,860 --> 00:03:30,620 Very important, because it defines the logic 84 00:03:30,620 --> 00:03:32,340 and the behavior of Zool widgets. 85 00:03:32,800 --> 00:03:34,140 So if we come back here, 86 00:03:34,380 --> 00:03:36,060 anything you do in that window, 87 00:03:36,240 --> 00:03:38,400 like clicking one folder or moving a scroll bar, 88 00:03:38,500 --> 00:03:40,020 that might be defined through XBL. 89 00:03:41,820 --> 00:03:43,520 And then we come to XPCON component. 90 00:03:43,720 --> 00:03:45,720 That's very important, just stick that 91 00:03:45,720 --> 00:03:46,720 for the rest of the presentation. 92 00:03:47,500 --> 00:03:50,100 XPCON component are the core functionality 93 00:03:50,100 --> 00:03:51,360 of your browser, Firefox. 94 00:03:52,340 --> 00:03:54,820 There are thousands of components and interfaces 95 00:03:54,820 --> 00:03:56,320 which are shipped with the Firefox, 96 00:03:56,540 --> 00:03:58,100 and these can be used by extensions. 97 00:03:58,860 --> 00:04:01,660 So again, if you look back here, 98 00:04:01,780 --> 00:04:05,200 FireFTP, it's showing your C folder in the window. 99 00:04:05,420 --> 00:04:06,440 When it's doing that, 100 00:04:06,620 --> 00:04:09,400 FireFTP is actually using an XPCON component interface 101 00:04:09,400 --> 00:04:12,220 to actually show the listing of your C folder. 102 00:04:12,680 --> 00:04:15,100 And that's one example using XPCON components. 103 00:04:15,520 --> 00:04:19,360 So it allows you to interact with your operating system, 104 00:04:19,640 --> 00:04:22,040 allows you to talk with your network libraries, 105 00:04:22,340 --> 00:04:23,700 or access the file system. 106 00:04:25,000 --> 00:04:27,560 And of course, you need a middle layer 107 00:04:27,560 --> 00:04:29,120 to interact with the XPCON components, 108 00:04:29,400 --> 00:04:30,680 and that's called XPCONNECT. 109 00:04:31,500 --> 00:04:32,720 XPCONNECT is a middle layer, 110 00:04:32,900 --> 00:04:35,160 and as you can see on the bottom, there's JavaScript. 111 00:04:35,700 --> 00:04:38,000 JavaScript can actually talk to XPCON components 112 00:04:38,000 --> 00:04:39,040 through this layer. 113 00:04:39,820 --> 00:04:42,100 And we'll see some examples later in our demo. 114 00:04:43,700 --> 00:04:45,740 And last but not least, it's Chrome. 115 00:04:46,900 --> 00:04:48,360 Don't confuse with Google Chrome. 116 00:04:48,500 --> 00:04:50,060 It's something totally different. 117 00:04:50,780 --> 00:04:53,680 Chrome in Firefox is a privileged browser zone 118 00:04:53,680 --> 00:04:55,580 where the extension code runs, 119 00:04:56,080 --> 00:04:57,540 and it's fully trusted by your browser. 120 00:04:57,560 --> 00:04:57,700 That's why it's called Firefox. 121 00:04:59,540 --> 00:05:02,220 We will use this Chrome many times in this presentation. 122 00:05:02,700 --> 00:05:04,680 Just keep in mind for now. 123 00:05:07,340 --> 00:05:08,180 Security model. 124 00:05:08,460 --> 00:05:10,600 Well, that's a very important slide. 125 00:05:11,260 --> 00:05:13,180 Security model in terms of extension 126 00:05:13,180 --> 00:05:14,200 is not really there. 127 00:05:14,720 --> 00:05:16,740 So starting from the concept 128 00:05:16,740 --> 00:05:17,940 that when you install one extension, 129 00:05:18,360 --> 00:05:20,900 the extension can actually modify another extension 130 00:05:20,900 --> 00:05:21,820 which is already installed. 131 00:05:22,640 --> 00:05:25,160 And that means there are no boundaries between extensions. 132 00:05:26,200 --> 00:05:28,420 Firefox has been designed for functionality, 133 00:05:28,460 --> 00:05:30,020 to give flexibility to you 134 00:05:30,020 --> 00:05:32,540 for installing multiple different extensions. 135 00:05:32,940 --> 00:05:34,340 But it wasn't being designed 136 00:05:34,340 --> 00:05:35,940 to actually secure your extensions. 137 00:05:37,360 --> 00:05:39,320 The other thing to keep in mind is that 138 00:05:40,520 --> 00:05:42,200 XPCON components, as I said before, 139 00:05:42,960 --> 00:05:44,540 they come shipped with Firefox, 140 00:05:44,680 --> 00:05:46,860 but they also can be introduced with the extensions 141 00:05:46,860 --> 00:05:48,140 to provide new functionality. 142 00:05:48,500 --> 00:05:49,760 And they can be written in JavaScript 143 00:05:49,760 --> 00:05:51,780 or can be written in C++. 144 00:05:52,080 --> 00:05:54,440 If they're written in C++, that means they're compiled. 145 00:05:55,160 --> 00:05:56,960 And they can be moved on to memory corruption bugs. 146 00:05:58,620 --> 00:06:00,500 The other thing is that when you install an extension 147 00:06:00,500 --> 00:06:03,020 and it's going to talk to your file system, for example, 148 00:06:03,200 --> 00:06:04,480 you don't get any notification. 149 00:06:04,580 --> 00:06:05,560 You don't know what's happening. 150 00:06:06,280 --> 00:06:08,760 The extension might talk with your Windows registry 151 00:06:08,760 --> 00:06:13,040 or might modify some files in your etc directory. 152 00:06:14,640 --> 00:06:15,880 You don't know what's happening. 153 00:06:16,080 --> 00:06:19,520 That's because there is no access control policies 154 00:06:19,520 --> 00:06:21,620 between your extension and your operating system. 155 00:06:21,620 --> 00:06:26,560 And yeah, that's why we consider non-existent. 156 00:06:26,580 --> 00:06:28,960 There is no security model for extensions in Firefox. 157 00:06:30,820 --> 00:06:32,980 Okay, just to give you some numbers and stats. 158 00:06:33,800 --> 00:06:36,720 That's something which is happening right now. 159 00:06:37,060 --> 00:06:40,320 And Firefox is getting 50% of the browser market share 160 00:06:40,320 --> 00:06:43,560 in some countries, like in Africa and in Asia. 161 00:06:43,660 --> 00:06:45,420 But globally, it's still 20%. 162 00:06:45,420 --> 00:06:47,220 But the trend, as you can see there, 163 00:06:47,440 --> 00:06:48,880 it's actually increasing. 164 00:06:49,540 --> 00:06:51,240 And it's losing a bit. 165 00:06:51,620 --> 00:06:54,320 And if we think in terms of extensions, 166 00:06:54,940 --> 00:06:56,960 the one that you can download from the add-on, 167 00:06:56,980 --> 00:06:58,100 Mozilla.org, EMU, 168 00:06:59,200 --> 00:07:00,540 that's increasing, the trend. 169 00:07:01,260 --> 00:07:04,020 In November 2008, it was one billion downloads. 170 00:07:05,340 --> 00:07:07,060 I don't know how much it's now, Nick. 171 00:07:07,260 --> 00:07:09,460 I think it's up to about 1.5 billion now. 172 00:07:09,640 --> 00:07:11,360 They actually keep it on the side all the time now. 173 00:07:11,660 --> 00:07:15,680 But this doesn't include any of the extra add-ons 174 00:07:15,680 --> 00:07:17,540 you can get from software packages or anything 175 00:07:17,540 --> 00:07:20,200 like we're going to discuss in this slide here. 176 00:07:20,360 --> 00:07:21,500 So you can get them from, 177 00:07:22,420 --> 00:07:24,080 things like Skype or AVG 178 00:07:24,570 --> 00:07:26,400 or social networks and stuff as well. 179 00:07:27,440 --> 00:07:28,900 Yes, like Nick was saying, 180 00:07:29,040 --> 00:07:30,960 EMU is not the only place where you can get extensions. 181 00:07:31,340 --> 00:07:33,420 Like when you install Ubuntu, for example, 182 00:07:33,440 --> 00:07:34,760 you have an Ubuntu extension 183 00:07:34,760 --> 00:07:37,720 which is installed by default in your Firefox. 184 00:07:38,080 --> 00:07:39,200 The same with AVG. 185 00:07:39,340 --> 00:07:41,660 Or if you use any social bookmarks, 186 00:07:41,820 --> 00:07:43,780 then you might have a Facebook extension 187 00:07:43,780 --> 00:07:45,080 or something like that. 188 00:07:48,040 --> 00:07:51,380 So how do we see that from our point of view? 189 00:07:51,380 --> 00:07:51,800 End users. 190 00:07:52,640 --> 00:07:54,460 Well, I think most of the people here 191 00:07:54,460 --> 00:07:55,220 install extensions. 192 00:07:55,780 --> 00:07:59,360 And that's most probably because you trust the add-ons site. 193 00:07:59,860 --> 00:08:02,300 And probably you trust the extensions 194 00:08:02,300 --> 00:08:03,040 which are recommended. 195 00:08:04,560 --> 00:08:06,020 You might trust the extensions 196 00:08:06,020 --> 00:08:07,120 also because they're open source. 197 00:08:07,320 --> 00:08:09,700 Because you think people are reviewing the extensions. 198 00:08:10,280 --> 00:08:11,780 And there are no bugs inside. 199 00:08:12,100 --> 00:08:12,800 Everything's fine. 200 00:08:13,200 --> 00:08:15,260 And yeah, that's the reason why you install. 201 00:08:15,480 --> 00:08:17,380 But there's also some misconception there. 202 00:08:17,540 --> 00:08:19,400 So people think that extensions are secure. 203 00:08:19,400 --> 00:08:21,300 Especially if they think about NoScript 204 00:08:21,300 --> 00:08:24,380 or RdBlock+, which are security extensions. 205 00:08:24,900 --> 00:08:27,720 But if we see from this point of view, 206 00:08:28,180 --> 00:08:30,120 these extensions do not provide any security 207 00:08:30,120 --> 00:08:32,400 if you install any vulnerable extensions. 208 00:08:33,360 --> 00:08:34,440 To be more clear, 209 00:08:35,680 --> 00:08:38,500 NoScript has got some whitelisting URIs 210 00:08:38,500 --> 00:08:41,200 starting from Chrome, the one which I mentioned before. 211 00:08:41,400 --> 00:08:43,280 If there is any injection in Chrome, 212 00:08:43,500 --> 00:08:45,220 that will not be protected by NoScript. 213 00:08:45,460 --> 00:08:47,920 But we will see that later more in detail. 214 00:08:49,000 --> 00:08:51,720 And the other thing is with Softpedia. 215 00:08:51,820 --> 00:08:53,360 There are portals like Softpedia 216 00:08:53,920 --> 00:08:55,700 which they say, oh yeah, it's 100% free. 217 00:08:55,920 --> 00:08:57,820 There are no spywares, no viruses. 218 00:08:58,460 --> 00:08:59,260 Download it. 219 00:08:59,360 --> 00:09:01,520 So they invite you to download the extensions. 220 00:09:01,940 --> 00:09:03,800 But there is no security check done. 221 00:09:06,580 --> 00:09:07,820 And the other thing is 222 00:09:08,520 --> 00:09:10,560 other two figures are involved here. 223 00:09:10,800 --> 00:09:12,840 Developers and reviewers. 224 00:09:13,280 --> 00:09:14,260 So extensions developers, 225 00:09:15,040 --> 00:09:17,560 during our research, we found a lot of bugs. 226 00:09:17,920 --> 00:09:20,220 And we noticed that some developed well. 227 00:09:20,860 --> 00:09:22,280 A large number of developers, 228 00:09:22,460 --> 00:09:23,560 they are not professional, 229 00:09:23,740 --> 00:09:25,380 they are not involved with any company 230 00:09:25,380 --> 00:09:26,740 doing these kind of extensions. 231 00:09:27,120 --> 00:09:29,860 It's more coming from passion or hobby. 232 00:09:30,220 --> 00:09:32,500 And so in terms of maintenance 233 00:09:32,500 --> 00:09:35,600 or if you send a security report, 234 00:09:35,880 --> 00:09:37,600 they are not really ready for that 235 00:09:37,600 --> 00:09:39,720 or they do not provide any professional support. 236 00:09:40,440 --> 00:09:42,740 And that's something which was scaring a little bit. 237 00:09:43,240 --> 00:09:44,480 The other one is reviewers. 238 00:09:44,640 --> 00:09:46,520 So there are reviewers like volunteers. 239 00:09:46,520 --> 00:09:49,680 Anyone here can write an extension 240 00:09:49,680 --> 00:09:51,360 submitted to Mozilla Emo 241 00:09:51,360 --> 00:09:54,040 and that is going to be reviewed by volunteers. 242 00:09:54,440 --> 00:09:56,000 The problem is that they don't have 243 00:09:56,520 --> 00:09:58,780 comprehensive security checklists to go through. 244 00:09:59,180 --> 00:10:00,420 They only have a few guidelines 245 00:10:00,420 --> 00:10:03,780 which will help them to identify any virus 246 00:10:03,780 --> 00:10:05,660 or any malicious content extension. 247 00:10:05,920 --> 00:10:06,800 But nothing which is 248 00:10:07,520 --> 00:10:09,240 in terms of vulnerability or bugs. 249 00:10:11,980 --> 00:10:13,620 And then we do have some, of course, 250 00:10:13,680 --> 00:10:15,120 we do have some concerns on Emo 251 00:10:15,120 --> 00:10:16,760 and the way this process works. 252 00:10:18,560 --> 00:10:19,900 You submit an extension 253 00:10:19,900 --> 00:10:21,540 and then it goes through this process. 254 00:10:21,820 --> 00:10:23,960 The problem is that when the extension is new, 255 00:10:24,080 --> 00:10:25,300 then it's going to be reviewed. 256 00:10:25,540 --> 00:10:27,420 But when the extension is not new anymore 257 00:10:27,420 --> 00:10:28,240 and it's trusted, 258 00:10:28,580 --> 00:10:30,420 it doesn't go through the review process 259 00:10:30,420 --> 00:10:33,500 as you can see from the bottom, 260 00:10:34,060 --> 00:10:35,860 following the bottom arrows there. 261 00:10:37,540 --> 00:10:40,980 And that's a problem in terms of reviewing things. 262 00:10:43,300 --> 00:10:44,720 You want to add something here? 263 00:10:44,720 --> 00:10:45,340 Nick? 264 00:10:46,960 --> 00:10:49,520 Also, there's the sandbox up the top there. 265 00:10:51,060 --> 00:10:52,420 Those extensions that are in there 266 00:10:52,420 --> 00:10:53,660 are the ones that show up as experimental 267 00:10:53,660 --> 00:10:55,160 on addons.mozilla.org. 268 00:10:55,280 --> 00:10:56,980 So you can still actually download them 269 00:10:56,980 --> 00:10:58,600 and these things haven't been reviewed at all. 270 00:10:58,820 --> 00:11:00,560 Someone could have all sorts of nasty crap inside there 271 00:11:00,560 --> 00:11:01,520 and you'll just download it straight away. 272 00:11:03,880 --> 00:11:05,680 You used to have to create an account 273 00:11:05,680 --> 00:11:07,420 and sign up for it to do that. 274 00:11:07,480 --> 00:11:09,900 But now you can just tick a checkbox and go away. 275 00:11:11,080 --> 00:11:12,220 Also, some other issues. 276 00:11:13,220 --> 00:11:14,700 A few extensions don't use 277 00:11:14,720 --> 00:11:16,380 AMO for their updating. 278 00:11:16,580 --> 00:11:18,700 So they can include an update.rdf 279 00:11:19,240 --> 00:11:22,380 which basically tells it where to check for updates 280 00:11:22,380 --> 00:11:24,240 and how often, things like that. 281 00:11:24,820 --> 00:11:28,420 And those will point to the install file 282 00:11:28,420 --> 00:11:31,120 on the developer's website or somewhere else. 283 00:11:31,220 --> 00:11:32,800 So these things aren't being reviewed by AMO whatsoever. 284 00:11:33,240 --> 00:11:37,820 So things that are recommended and available in AMO 285 00:11:37,820 --> 00:11:39,640 can distribute the updates their own way 286 00:11:39,640 --> 00:11:42,280 and bypass the review process entirely. 287 00:11:47,200 --> 00:11:48,860 Yeah, that's a good point. 288 00:11:49,000 --> 00:11:51,920 So basically, there have been some cases in the past 289 00:11:51,920 --> 00:11:54,800 between using extension malware at the same time 290 00:11:54,800 --> 00:11:55,980 with viruses or Trojans. 291 00:11:56,430 --> 00:11:57,660 We have three cases there, 292 00:11:58,450 --> 00:12:01,300 starting from 4spy in 2006. 293 00:12:02,200 --> 00:12:05,040 Basically, the XM Trojan was installing 294 00:12:05,040 --> 00:12:06,740 a malicious extension to Firefox. 295 00:12:07,000 --> 00:12:09,440 And the malicious extension was actually a way 296 00:12:09,440 --> 00:12:11,920 to steal all your login credentials 297 00:12:11,920 --> 00:12:14,380 or bank account details. 298 00:12:14,720 --> 00:12:18,380 And send it to some other site. 299 00:12:18,560 --> 00:12:20,720 And the same with Firestarter Fox in 2008. 300 00:12:21,140 --> 00:12:23,360 That basically was hijacking your browser 301 00:12:23,360 --> 00:12:25,420 and sending all your search results 302 00:12:25,420 --> 00:12:28,560 to another website, which was a Russian website. 303 00:12:28,980 --> 00:12:31,400 And slightly different was recently, 304 00:12:31,540 --> 00:12:33,340 more recently, with the Vietnamese language pack. 305 00:12:33,900 --> 00:12:36,080 The guy which actually was responsible 306 00:12:36,080 --> 00:12:37,880 for uploading the language pack 307 00:12:37,880 --> 00:12:39,380 was owned by... 308 00:12:39,380 --> 00:12:40,380 I think... 309 00:12:40,380 --> 00:12:41,080 Xoro Trojan. 310 00:12:41,220 --> 00:12:41,860 Xoro Trojan. 311 00:12:42,040 --> 00:12:43,780 And basically, he was replacing 312 00:12:44,760 --> 00:12:46,820 all the pictures in the language packs 313 00:12:46,820 --> 00:12:47,880 with some advertisements. 314 00:12:48,160 --> 00:12:51,220 And that has been published into the Mozilla site 315 00:12:51,220 --> 00:12:52,580 and has been downloaded by people. 316 00:12:52,860 --> 00:12:55,880 So that's one way you can actually see the connection 317 00:12:55,880 --> 00:12:56,960 between malware and extension. 318 00:12:57,340 --> 00:12:59,160 And as Nick was saying in the last point, 319 00:12:59,880 --> 00:13:01,560 if there is a trusted application... 320 00:13:01,560 --> 00:13:03,720 Let's say you have an extension 321 00:13:04,260 --> 00:13:05,780 which is used by millions of people. 322 00:13:06,140 --> 00:13:07,740 It's trusted, okay? 323 00:13:07,820 --> 00:13:09,120 It doesn't go through the review process. 324 00:13:09,480 --> 00:13:11,760 But if the author gets owned or compromised 325 00:13:11,760 --> 00:13:13,220 or someone bribed the authors, 326 00:13:13,220 --> 00:13:16,880 then everyone can actually be owned 327 00:13:16,880 --> 00:13:18,180 by the update 328 00:13:18,180 --> 00:13:20,340 because it's not going to be reviewed. 329 00:13:22,660 --> 00:13:25,380 Okay, and now Nick to cover this section. 330 00:13:26,560 --> 00:13:28,040 Okay, so there's a lot of different ways 331 00:13:28,040 --> 00:13:29,260 to find bugs in Firefox extensions. 332 00:13:29,700 --> 00:13:32,660 Our approach was to basically start looking at... 333 00:13:33,180 --> 00:13:34,320 Use all the extension. 334 00:13:34,500 --> 00:13:35,020 Click on everything. 335 00:13:35,400 --> 00:13:37,400 Go to different websites that use this functionality. 336 00:13:37,860 --> 00:13:39,420 Basically, figure out what makes it tick. 337 00:13:40,160 --> 00:13:41,360 Look at the logic explodes 338 00:13:41,360 --> 00:13:43,140 and the input and output vectors. 339 00:13:43,220 --> 00:13:45,460 So what is being input into the extension? 340 00:13:45,700 --> 00:13:47,500 What websites can it read in from? 341 00:13:47,720 --> 00:13:48,620 Things like that. 342 00:13:49,420 --> 00:13:51,740 Look at any XP components that it might introduce. 343 00:13:52,800 --> 00:13:55,580 These might be code in C++, 344 00:13:55,720 --> 00:13:57,320 in which case it could possibly be vulnerable 345 00:13:57,800 --> 00:13:58,800 to memory encryption vulnerabilities. 346 00:13:59,880 --> 00:14:01,400 And otherwise they can do 347 00:14:01,400 --> 00:14:02,800 some pretty dirty things themselves. 348 00:14:03,280 --> 00:14:06,300 And also look out for any third-party components or APIs. 349 00:14:06,620 --> 00:14:09,220 So there's a few sites like bookmarks 350 00:14:10,180 --> 00:14:11,860 and, like, stored passwords 351 00:14:11,860 --> 00:14:13,200 where you can basically check 352 00:14:13,220 --> 00:14:14,620 to ship off your information somewhere else. 353 00:14:14,840 --> 00:14:16,520 But it doesn't always do this really well. 354 00:14:16,700 --> 00:14:19,360 Sometimes we've seen SQL injectable passwords. 355 00:14:20,200 --> 00:14:20,820 Password fields. 356 00:14:21,120 --> 00:14:22,560 We've seen things going over HTTP 357 00:14:22,560 --> 00:14:24,660 or they'll basically be foreign coded or something. 358 00:14:24,980 --> 00:14:26,740 Like, it's all pretty bad. 359 00:14:27,260 --> 00:14:28,220 So keep an eye out 360 00:14:28,220 --> 00:14:31,060 for what's being sent out from your computer 361 00:14:31,060 --> 00:14:32,300 when you're looking at the extension. 362 00:14:33,420 --> 00:14:35,580 So our focus was basically looking on 363 00:14:35,580 --> 00:14:37,380 extension data flow and injection points 364 00:14:37,380 --> 00:14:38,820 and what we can do to 365 00:14:38,820 --> 00:14:40,820 basically cross-site script into the extension. 366 00:14:41,700 --> 00:14:43,020 So cross-site scripting 367 00:14:43,220 --> 00:14:45,100 into the Chrome privilege zone 368 00:14:45,100 --> 00:14:47,000 is real bad, TM. 369 00:14:48,400 --> 00:14:49,720 Because it's in a privilege zone, 370 00:14:49,860 --> 00:14:51,500 it can connect, it can contact 371 00:14:51,500 --> 00:14:52,620 the XPCOM components, 372 00:14:52,920 --> 00:14:55,260 which means that you can read from the file system. 373 00:14:55,340 --> 00:14:56,280 You can write to the file system. 374 00:14:56,460 --> 00:14:57,780 You can run processes. 375 00:14:58,020 --> 00:14:59,780 And there's no same origin policy there. 376 00:15:00,080 --> 00:15:01,580 So you can read from the file system 377 00:15:01,580 --> 00:15:02,740 and ship it off to an external website, 378 00:15:02,960 --> 00:15:04,400 which we'll show you a little bit later on. 379 00:15:05,200 --> 00:15:07,540 And because this is all in the Chrome security zone, 380 00:15:08,640 --> 00:15:09,820 it can't be blocked by no script 381 00:15:09,820 --> 00:15:10,580 because it's in the same place. 382 00:15:13,220 --> 00:15:14,660 You can see Chrome is white listed. 383 00:15:17,720 --> 00:15:19,460 And cross-site scripting 384 00:15:19,460 --> 00:15:21,240 often showing like empty alert boxes 385 00:15:21,240 --> 00:15:22,880 or with one or hello world. 386 00:15:22,940 --> 00:15:24,380 This one's showing a set for password. 387 00:15:25,520 --> 00:15:26,980 So just showing 388 00:15:26,980 --> 00:15:28,500 what the same origin policy can, 389 00:15:29,040 --> 00:15:30,560 the lack of the same origin policy is 390 00:15:31,040 --> 00:15:31,600 going to do. 391 00:15:32,400 --> 00:15:35,000 When you're testing for cross-site scripting in an extension, 392 00:15:35,240 --> 00:15:36,580 we recommend running Firefox 393 00:15:37,020 --> 00:15:38,440 with the minus console option 394 00:15:38,440 --> 00:15:40,500 and basically dumping out 395 00:15:40,500 --> 00:15:42,740 the result of your testing. 396 00:15:43,220 --> 00:15:44,900 So you can see in the two red boxes there, 397 00:15:46,120 --> 00:15:47,180 it's a window object, 398 00:15:47,400 --> 00:15:48,380 but it's in the Chrome URI. 399 00:15:48,540 --> 00:15:49,660 It can also just be a Chrome window. 400 00:15:50,680 --> 00:15:52,620 So don't rely on just one way 401 00:15:52,620 --> 00:15:54,460 to fight on one of those 402 00:15:54,460 --> 00:15:56,620 to see if you're in the Chrome zone or not. 403 00:15:59,900 --> 00:16:00,840 Here's a list of the 404 00:16:00,840 --> 00:16:02,460 XCS payloads that we ended up using. 405 00:16:02,920 --> 00:16:05,380 So there's actually a method 406 00:16:05,380 --> 00:16:06,700 there provided by Mozilla 407 00:16:06,700 --> 00:16:08,680 to sanely look after your 408 00:16:09,220 --> 00:16:10,160 input filtering, basically. 409 00:16:10,960 --> 00:16:12,320 We haven't seen it used once. 410 00:16:13,300 --> 00:16:15,220 People like rolling their own blacklist filters. 411 00:16:16,080 --> 00:16:16,660 So, ah, 412 00:16:16,800 --> 00:16:18,100 script tags are bad. 413 00:16:18,300 --> 00:16:19,920 Or angle brackets are real bad. 414 00:16:20,100 --> 00:16:21,020 We don't want any of that crap in there. 415 00:16:21,240 --> 00:16:24,100 So they'll block those, but then you can use an iframe 416 00:16:24,100 --> 00:16:25,820 or you can use an image with an onload tag 417 00:16:25,820 --> 00:16:28,040 or, well, all sorts of other crazy things. 418 00:16:29,140 --> 00:16:30,940 So, yeah, most developers 419 00:16:30,940 --> 00:16:32,460 just adopt the blacklist thing. 420 00:16:32,520 --> 00:16:34,220 And we can see when people have tried to fix 421 00:16:34,220 --> 00:16:35,500 some of the things we've disclosed to them, 422 00:16:36,120 --> 00:16:38,540 you just see extra script, iframe, 423 00:16:38,580 --> 00:16:40,540 image tags inside, like, 424 00:16:40,620 --> 00:16:42,640 an extra four lines of code. They don't do it right. 425 00:16:44,380 --> 00:16:45,240 Here's a bunch of 426 00:16:45,240 --> 00:16:46,220 tools that we use for 427 00:16:46,800 --> 00:16:48,300 our testing. So, 428 00:16:49,000 --> 00:16:50,940 Moz REPL is real good. 429 00:16:51,600 --> 00:16:52,940 It basically creates JavaScript 430 00:16:52,940 --> 00:16:54,940 cells so you can turn it into your browser and execute 431 00:16:55,380 --> 00:16:56,400 JavaScript in the Chrome zone. 432 00:16:56,660 --> 00:16:58,320 It also lets you export the DOM. 433 00:16:58,580 --> 00:17:00,900 So you can, if you, like, build a Python script, 434 00:17:01,000 --> 00:17:03,080 you can export the DOM before and after 435 00:17:03,080 --> 00:17:04,660 enabling an extension and see what functions 436 00:17:04,660 --> 00:17:06,160 it brings into your browser. 437 00:17:07,980 --> 00:17:08,700 And also, 438 00:17:08,760 --> 00:17:10,900 another web proxy, just to see what's 439 00:17:10,900 --> 00:17:12,860 what the extension is sending out. 440 00:17:13,220 --> 00:17:15,000 When you're using it. 441 00:17:16,660 --> 00:17:17,140 Cool. 442 00:17:18,960 --> 00:17:20,100 Okay. Thanks, Nick. 443 00:17:20,540 --> 00:17:23,200 So we just saw multiple ways 444 00:17:23,200 --> 00:17:24,600 to find bugs and cross-escaping 445 00:17:25,080 --> 00:17:27,080 extensions. And now let's have a look 446 00:17:27,080 --> 00:17:28,500 what we have found during our research. 447 00:17:30,300 --> 00:17:30,920 Yeah, we 448 00:17:30,920 --> 00:17:33,160 can disclose everything because we follow 449 00:17:33,160 --> 00:17:34,860 responsible disclosure and we're just waiting 450 00:17:34,860 --> 00:17:36,740 some extension to fix their bugs. 451 00:17:37,060 --> 00:17:38,420 But we're going to show you six 452 00:17:39,080 --> 00:17:41,060 extensions, vulnerable. Three of them 453 00:17:41,060 --> 00:17:42,700 which haven't been disclosed before. 454 00:17:43,220 --> 00:17:44,780 And as you can see there with the new 455 00:17:44,780 --> 00:17:46,540 label there. And 456 00:17:48,000 --> 00:17:48,480 basically, 457 00:17:48,640 --> 00:17:51,160 if we sum all the downloads for all 458 00:17:51,160 --> 00:17:53,080 the extensions we got, that's more than 459 00:17:53,080 --> 00:17:55,140 30 millions. We wrote 50 millions 460 00:17:55,140 --> 00:17:56,960 on the book 461 00:17:56,960 --> 00:17:58,260 you have on the schedule book. 462 00:17:58,580 --> 00:18:01,220 That was a couple of months ago, I guess. 463 00:18:01,620 --> 00:18:03,120 So that's increased 464 00:18:03,120 --> 00:18:04,340 in the meantime. And 465 00:18:05,500 --> 00:18:07,040 yeah, let's start with 466 00:18:07,040 --> 00:18:08,220 Skype, which is 467 00:18:09,200 --> 00:18:09,920 one extension. 468 00:18:10,640 --> 00:18:12,960 When you install Skype, you get five extensions. 469 00:18:13,220 --> 00:18:14,920 Well, you have the choice to install it. 470 00:18:15,320 --> 00:18:16,940 And that was a funny bug 471 00:18:16,940 --> 00:18:18,580 because it's a logical flow bug. 472 00:18:18,980 --> 00:18:21,060 And in particular there's 473 00:18:21,060 --> 00:18:22,960 a function there which is called Skype 474 00:18:22,960 --> 00:18:24,080 tool call function. 475 00:18:24,720 --> 00:18:26,700 And that is responsible for making 476 00:18:26,990 --> 00:18:28,820 basically the call. And 477 00:18:28,820 --> 00:18:31,080 I don't know if you're familiar with Skype, but if you have 478 00:18:31,080 --> 00:18:32,940 a phone number in an HTML 479 00:18:32,940 --> 00:18:35,040 page, you would see a little green 480 00:18:35,040 --> 00:18:37,140 button appearing. And then you can 481 00:18:37,140 --> 00:18:39,100 click and then Skype would be launched by 482 00:18:39,100 --> 00:18:41,020 your Firefox. And that's 483 00:18:41,600 --> 00:18:43,020 where is the bug. Basically 484 00:18:43,220 --> 00:18:45,100 the function which is responsible for calling 485 00:18:45,100 --> 00:18:47,120 Skype, it's available. So 486 00:18:47,120 --> 00:18:49,100 you can go to any page and 487 00:18:49,100 --> 00:18:51,280 JavaScript can launch that function. 488 00:18:51,400 --> 00:18:52,560 Well, actually can trigger the function 489 00:18:53,080 --> 00:18:55,040 and Skype would be actually launched. 490 00:18:57,160 --> 00:18:58,440 Yeah, the white thing 491 00:18:59,400 --> 00:19:00,800 that's the payload to 492 00:19:00,800 --> 00:19:02,560 do this trick. So you force 493 00:19:03,060 --> 00:19:05,080 the user to go to that page. There is a telephone 494 00:19:05,080 --> 00:19:07,040 number. And then the extension will be 495 00:19:07,040 --> 00:19:09,180 loaded. And then there is a document location 496 00:19:09,180 --> 00:19:10,800 which is doing a JavaScript URI 497 00:19:10,800 --> 00:19:13,200 to Skype tool call. And then you 498 00:19:13,220 --> 00:19:15,080 can put any phone numbers there. So 499 00:19:15,080 --> 00:19:17,040 basically you force the user to call 500 00:19:17,040 --> 00:19:19,180 the phone numbers you want. And 501 00:19:19,180 --> 00:19:20,660 you can put as many phone numbers you 502 00:19:21,220 --> 00:19:23,060 actually desire. I'll 503 00:19:23,060 --> 00:19:24,760 show you a quick demo on video 504 00:19:24,760 --> 00:19:25,620 which I've done 505 00:19:27,480 --> 00:19:28,680 here. Just a moment. 506 00:19:29,620 --> 00:19:29,800 Yep. 507 00:19:46,120 --> 00:19:46,560 . 508 00:19:49,940 --> 00:19:50,380 . 509 00:19:54,720 --> 00:19:55,160 . 510 00:19:55,160 --> 00:19:58,120 Here it is. 511 00:19:59,040 --> 00:20:01,060 So that's my, that's my malicious 512 00:20:01,060 --> 00:20:02,640 page. That's telephone number. 513 00:20:03,360 --> 00:20:05,080 As long the user go to that page 514 00:20:05,080 --> 00:20:05,780 without clicking, 515 00:20:07,040 --> 00:20:09,020 Skype is going to be launched. It's going to make, 516 00:20:09,120 --> 00:20:10,940 automatically it's going to make all these phone calls. 517 00:20:11,420 --> 00:20:13,040 So imagine that we like, if you 518 00:20:13,220 --> 00:20:15,240 call paid numbers 519 00:20:15,240 --> 00:20:17,180 where you have to pay. So you will 520 00:20:17,180 --> 00:20:18,540 lose credits or 521 00:20:19,100 --> 00:20:21,140 you will lose money basically because Skype 522 00:20:21,140 --> 00:20:23,060 is going to do automatically that. And 523 00:20:23,580 --> 00:20:25,260 the thing is that it doesn't 524 00:20:25,260 --> 00:20:27,120 close. So till you close the browser 525 00:20:27,120 --> 00:20:29,160 the Skype won't disappear. It will try to 526 00:20:29,160 --> 00:20:30,760 reopen and call till 527 00:20:30,760 --> 00:20:32,200 basically does the call. 528 00:20:32,940 --> 00:20:34,940 So that's why we didn't do a real demo 529 00:20:34,940 --> 00:20:37,160 because it will take some time 530 00:20:37,160 --> 00:20:37,940 to close it down. 531 00:20:40,340 --> 00:20:40,820 Okay. 532 00:20:40,900 --> 00:20:41,920 Next one. 533 00:20:43,740 --> 00:20:44,180 . 534 00:20:46,120 --> 00:20:46,560 . 535 00:20:46,560 --> 00:20:47,020 . 536 00:20:50,740 --> 00:20:51,180 . 537 00:20:51,180 --> 00:20:52,980 Yep. Okay. Next extension 538 00:20:52,980 --> 00:20:54,960 is Cool Previews. I don't know if you 539 00:20:54,960 --> 00:20:56,800 heard about this one. It's almost 540 00:20:56,800 --> 00:20:59,080 seven millions download now. It's recommended 541 00:20:59,080 --> 00:21:01,120 by . And yeah, it's, 542 00:21:01,120 --> 00:21:03,020 it's a nice extension. So you have 543 00:21:03,020 --> 00:21:05,140 a web page, any link, you go 544 00:21:05,140 --> 00:21:07,040 with the mouse over the link. It's going to 545 00:21:07,040 --> 00:21:08,940 show you a little pop-up window. It's going to preview 546 00:21:08,940 --> 00:21:11,040 the content of that link. And 547 00:21:11,040 --> 00:21:13,120 the problem is when you, basically you 548 00:21:13,220 --> 00:21:14,640 can, you can have a favorites list 549 00:21:15,120 --> 00:21:17,160 of sites you can control through 550 00:21:17,160 --> 00:21:19,180 this extension. And that's why it's 551 00:21:19,180 --> 00:21:21,120 the vulnerability. It's the add to stack 552 00:21:21,120 --> 00:21:22,900 function. And 553 00:21:22,900 --> 00:21:25,000 I just forgot that for each 554 00:21:25,000 --> 00:21:27,160 extension we're going to show you today, it's going to be a different 555 00:21:27,160 --> 00:21:27,440 exploit. 556 00:21:29,400 --> 00:21:31,160 In this case, I'm going to show you a remote 557 00:21:31,160 --> 00:21:33,160 code execution through Cool Previews. 558 00:21:33,580 --> 00:21:35,200 And I just 559 00:21:35,200 --> 00:21:36,320 need to put a demo here. 560 00:21:40,840 --> 00:21:41,320 Yeah. 561 00:21:44,120 --> 00:21:44,840 Just a moment. 562 00:21:45,760 --> 00:21:46,240 Yeah. 563 00:21:57,380 --> 00:21:59,100 Yeah, so I got 564 00:21:59,100 --> 00:22:01,200 the demo working now. Just before 565 00:22:01,200 --> 00:22:02,920 showing the demo, I want to show you the exploit. 566 00:22:03,140 --> 00:22:05,040 So, as I said before, you can 567 00:22:05,040 --> 00:22:06,740 use JavaScript to call 568 00:22:06,740 --> 00:22:09,200 XP components. In this 569 00:22:09,200 --> 00:22:10,440 case, I'm using the 570 00:22:11,080 --> 00:22:12,780 NS local file 571 00:22:13,220 --> 00:22:14,820 NS process to call 572 00:22:14,820 --> 00:22:17,140 win.com. And win.com will 573 00:22:17,140 --> 00:22:19,040 call cmdx. And then we'll actually 574 00:22:19,040 --> 00:22:20,480 pop up cmd shell. 575 00:22:20,780 --> 00:22:22,940 And that's an example of using 576 00:22:22,940 --> 00:22:24,920 JavaScript to interface with the 577 00:22:24,920 --> 00:22:27,060 xpcon component. And execute 578 00:22:27,060 --> 00:22:28,920 and do code 579 00:22:28,920 --> 00:22:29,380 execution. 580 00:22:35,460 --> 00:22:36,140 Yeah. 581 00:22:38,440 --> 00:22:39,580 I can't see. 582 00:22:41,360 --> 00:22:42,340 Where is it? 583 00:22:43,600 --> 00:22:44,080 Yeah. 584 00:22:47,460 --> 00:22:48,680 We need to make that. 585 00:22:49,440 --> 00:22:49,920 Yep. 586 00:22:54,880 --> 00:22:55,540 Go up. 587 00:22:56,320 --> 00:22:57,020 Yeah, sorry. 588 00:22:57,080 --> 00:22:57,900 We're struggling with the 589 00:22:58,640 --> 00:22:59,820 Yeah, that's good. 590 00:22:59,920 --> 00:23:00,420 There we go. 591 00:23:02,880 --> 00:23:03,360 Okay. 592 00:23:03,420 --> 00:23:03,800 Thanks, Nick. 593 00:23:06,740 --> 00:23:07,720 So, that's 594 00:23:07,720 --> 00:23:08,900 a vulnerable page. 595 00:23:10,040 --> 00:23:11,140 Targeting cool previews. 596 00:23:12,480 --> 00:23:13,400 So, when you add 597 00:23:15,300 --> 00:23:15,700 that 598 00:23:15,700 --> 00:23:17,420 site to your add to stack 599 00:23:18,480 --> 00:23:19,140 list of 600 00:23:19,140 --> 00:23:21,440 site, that's where it's a bug. 601 00:23:21,840 --> 00:23:23,340 And you can have the 602 00:23:23,340 --> 00:23:25,360 cross escape into a data URI. You pass 603 00:23:25,360 --> 00:23:27,300 a data URI in the link. And that 604 00:23:27,300 --> 00:23:29,400 will be executed within the Chrome window 605 00:23:29,400 --> 00:23:31,560 of cool previews. And that's 606 00:23:31,560 --> 00:23:32,880 why you can actually have code execution. 607 00:23:34,040 --> 00:23:34,860 So, I just click 608 00:23:35,420 --> 00:23:37,140 here. That's just for the demo. 609 00:23:37,280 --> 00:23:39,500 Showing where it's the file 610 00:23:39,580 --> 00:23:40,440 path, win.com. 611 00:23:41,640 --> 00:23:43,100 And that's popping shell 612 00:23:43,100 --> 00:23:44,500 through just that. 613 00:23:49,260 --> 00:23:49,600 Okay. 614 00:23:55,540 --> 00:23:56,360 Where's the 615 00:23:57,720 --> 00:23:58,400 presentation? 616 00:24:00,600 --> 00:24:01,280 Okay. 617 00:24:01,880 --> 00:24:02,620 That's done. 618 00:24:05,860 --> 00:24:06,540 Okay. 619 00:24:07,260 --> 00:24:07,600 Cool. 620 00:24:09,580 --> 00:24:11,420 Okay. The next one is update scanner. 621 00:24:11,760 --> 00:24:13,480 That's new. We didn't 622 00:24:13,480 --> 00:24:14,520 disclose this yet. 623 00:24:15,020 --> 00:24:17,140 And still a cool extension. 624 00:24:17,340 --> 00:24:19,060 It allows you to put a list of sites. 625 00:24:19,320 --> 00:24:21,400 Whenever there's a change on one of these 626 00:24:21,400 --> 00:24:23,300 sites, then update scanner 627 00:24:23,300 --> 00:24:25,140 will tell you that something has changed 628 00:24:25,140 --> 00:24:26,240 and will notify you. 629 00:24:26,820 --> 00:24:29,280 The problem is that the 630 00:24:29,280 --> 00:24:31,240 change page is going to be shown in Chrome 631 00:24:31,240 --> 00:24:33,440 window. So, if you're able 632 00:24:33,440 --> 00:24:34,940 to put any injection there, 633 00:24:35,140 --> 00:24:37,320 that will be rendering Chrome in the 634 00:24:37,320 --> 00:24:38,220 update scanner window. 635 00:24:39,580 --> 00:24:40,600 There is some protection there. 636 00:24:40,760 --> 00:24:43,260 So, the developer was trying to do something 637 00:24:44,000 --> 00:24:45,300 blocking script tags. 638 00:24:45,520 --> 00:24:47,500 So, if you have any script tags which is part of 639 00:24:47,500 --> 00:24:48,920 the change, of the payload change, 640 00:24:49,140 --> 00:24:50,820 that won't be executed. 641 00:24:51,220 --> 00:24:53,340 But still, if you put like a picture 642 00:24:53,340 --> 00:24:54,720 there and you 643 00:24:55,380 --> 00:24:57,180 assign a cross-escaping through an event handle 644 00:24:57,180 --> 00:24:59,000 like onError, that will be executed. 645 00:24:59,260 --> 00:25:00,360 And again, you can have 646 00:25:01,340 --> 00:25:03,040 any JavaScript executed in Chrome 647 00:25:03,040 --> 00:25:03,980 as privileged code. 648 00:25:06,700 --> 00:25:07,180 And 649 00:25:07,180 --> 00:25:09,100 today I want to show you how 650 00:25:09,580 --> 00:25:10,580 to compromise no script 651 00:25:10,580 --> 00:25:13,160 through just any vulnerability in this extension. 652 00:25:14,780 --> 00:25:15,380 That's 653 00:25:15,380 --> 00:25:16,560 just one example. 654 00:25:16,900 --> 00:25:19,000 There's few lines required to do that. 655 00:25:19,840 --> 00:25:21,200 The script will call 656 00:25:21,200 --> 00:25:23,380 the getService, which is basically 657 00:25:23,380 --> 00:25:24,060 calling your 658 00:25:25,220 --> 00:25:27,100 browser. It's about config. 659 00:25:27,260 --> 00:25:29,360 It's the configuration of your Firefox browser. 660 00:25:29,860 --> 00:25:30,840 And it's going to change. 661 00:25:31,160 --> 00:25:33,520 It's going to take the branch which is 662 00:25:33,520 --> 00:25:35,480 related to no script and it's going to 663 00:25:35,480 --> 00:25:37,420 have my site into 664 00:25:37,420 --> 00:25:38,720 the white list of no script. 665 00:25:39,580 --> 00:25:41,040 So that's an example where an extension 666 00:25:41,040 --> 00:25:42,860 can actually modify another extension. 667 00:25:43,140 --> 00:25:45,220 Or a vulnerability of an extension can be exploited 668 00:25:45,220 --> 00:25:46,720 to modify another extension. 669 00:25:50,020 --> 00:25:50,620 Okay. 670 00:25:55,920 --> 00:25:57,280 Let me clean 671 00:25:57,280 --> 00:25:58,380 cache here. 672 00:26:00,180 --> 00:26:00,780 Cool. 673 00:26:12,420 --> 00:26:14,260 So that's the update scanner window. 674 00:26:14,560 --> 00:26:16,880 We have the site there. 675 00:26:16,940 --> 00:26:18,880 This is the page which is 676 00:26:18,880 --> 00:26:20,120 has been detected now. 677 00:26:20,440 --> 00:26:22,300 So now I'm going to go to the server side, 678 00:26:22,500 --> 00:26:23,740 do a change of this page, 679 00:26:23,940 --> 00:26:25,440 then rescan the website, 680 00:26:25,960 --> 00:26:28,520 and have my injection as well with the new change. 681 00:26:43,660 --> 00:26:45,580 Just running this quick script. 682 00:26:45,760 --> 00:26:47,160 It's basically doing a cp, 683 00:26:47,400 --> 00:26:49,580 copy, and do a change 684 00:26:49,580 --> 00:26:50,240 on that page. 685 00:26:50,660 --> 00:26:52,700 And then I will come back to update scanner 686 00:26:52,700 --> 00:26:53,620 and then do the scan. 687 00:26:59,720 --> 00:27:01,300 Hopefully it should detect the change. 688 00:27:01,980 --> 00:27:02,880 Okay. Yes. 689 00:27:04,760 --> 00:27:05,500 So that's 690 00:27:05,500 --> 00:27:07,080 the change. But something else 691 00:27:07,620 --> 00:27:08,860 has been changed here. 692 00:27:09,580 --> 00:27:11,320 And as you can see, no script here 693 00:27:11,320 --> 00:27:12,460 has been changed. 694 00:27:12,640 --> 00:27:14,420 Before it was forbidden. 695 00:27:15,080 --> 00:27:15,600 And 696 00:27:17,840 --> 00:27:19,420 this page was forbidden 697 00:27:19,420 --> 00:27:20,800 before and now you can have 698 00:27:20,800 --> 00:27:23,180 JavaScript execution. And just to give you 699 00:27:23,180 --> 00:27:24,920 another proof, if you go here. 700 00:27:27,740 --> 00:27:29,180 Yeah, that's the site 701 00:27:29,180 --> 00:27:30,320 which has been added to 702 00:27:31,260 --> 00:27:32,300 the injection. 703 00:27:35,060 --> 00:27:35,580 Okay. 704 00:27:44,280 --> 00:27:45,860 Okay, cool. Now I'll leave Nick 705 00:27:45,860 --> 00:27:47,300 to this one because he found it. 706 00:27:48,760 --> 00:27:49,200 Okay. 707 00:27:54,020 --> 00:27:55,720 All right. So FireFTP. 708 00:27:56,120 --> 00:27:57,400 About 10 million downloads. 709 00:27:57,480 --> 00:27:59,100 Again, recommended by the Mozilla community. 710 00:28:00,400 --> 00:28:01,220 In this case, 711 00:28:01,340 --> 00:28:03,200 any HTML JavaScript in the welcome message 712 00:28:03,200 --> 00:28:04,880 for the FTP server would be executed 713 00:28:05,460 --> 00:28:07,500 in the little log area at the bottom of the extension. 714 00:28:07,840 --> 00:28:09,140 And that was in the Chrome zone. 715 00:28:09,580 --> 00:28:11,320 So if you had some cross-site scripting in 716 00:28:11,320 --> 00:28:12,380 your welcome message, 717 00:28:13,100 --> 00:28:15,420 you get owned. So the exploit, there's no 718 00:28:15,420 --> 00:28:17,320 filtering or protection here for this one. So script 719 00:28:17,320 --> 00:28:19,100 tags, iframes, anything. 720 00:28:19,440 --> 00:28:21,480 Go for gold. The exploit here 721 00:28:21,480 --> 00:28:22,620 is local file disclosure. 722 00:28:24,380 --> 00:28:25,520 So, to do this 723 00:28:25,520 --> 00:28:27,240 one, basically reading the 724 00:28:27,240 --> 00:28:29,420 file into an iframe 725 00:28:30,460 --> 00:28:31,340 and then 726 00:28:32,060 --> 00:28:33,040 sending it off to, 727 00:28:33,220 --> 00:28:35,340 using document location to send it off as a 728 00:28:35,340 --> 00:28:37,020 HTTP parameter to my website. 729 00:28:37,700 --> 00:28:39,520 And thing to note down there in the bottom 730 00:28:39,580 --> 00:28:40,860 is a set timeout. 731 00:28:40,960 --> 00:28:42,500 You need to give a little bit of time to 732 00:28:42,500 --> 00:28:44,440 let the data be read into the iframe. 733 00:28:44,520 --> 00:28:45,820 Otherwise, it won't send anything. 734 00:28:46,080 --> 00:28:47,840 We spent a few hours trying to figure that one out. 735 00:28:49,360 --> 00:28:49,760 Okay. 736 00:28:50,200 --> 00:28:51,520 Get some demo action. 737 00:29:00,380 --> 00:29:00,780 Okay. 738 00:29:06,100 --> 00:29:07,100 Just gonna tail 739 00:29:07,100 --> 00:29:08,620 my Apache logs. 740 00:29:13,760 --> 00:29:14,160 So. 741 00:29:15,460 --> 00:29:15,860 So. 742 00:29:16,440 --> 00:29:16,840 . 743 00:29:24,420 --> 00:29:25,680 So I've predefined the site 744 00:29:25,680 --> 00:29:27,140 there and I'm just going to connect to it. 745 00:29:28,140 --> 00:29:29,160 And here's a welcome message. 746 00:29:30,580 --> 00:29:31,500 And it's gonna have a 747 00:29:31,500 --> 00:29:33,540 load box showing the contents of the file so in this case 748 00:29:33,540 --> 00:29:35,080 it's not a central password because we're using 749 00:29:35,080 --> 00:29:37,540 boot.ini. So alright, it's 750 00:29:37,540 --> 00:29:39,540 there. And if we hop along 751 00:29:39,580 --> 00:29:48,800 going to the Linux machine, aha, yeah, so now the boot.ini is on someone else's server. 752 00:29:49,080 --> 00:29:52,840 And it works real well for directory reading as well, so you can browse the entire person's 753 00:29:52,840 --> 00:29:53,440 hard drive through this. 754 00:30:04,200 --> 00:30:12,960 OK, next up is Feed Sidebar, another recommended one by AMO, about 680,000 downloads, in this 755 00:30:12,960 --> 00:30:18,260 case any JavaScript or HTML in the description tags of an RSS feed will be rendered in the 756 00:30:18,260 --> 00:30:18,760 Chrome context. 757 00:30:20,180 --> 00:30:22,800 The guy who wrote this decided that script tags were a real bad idea. 758 00:30:22,920 --> 00:30:23,420 So I'm going to show you how that works. 759 00:30:23,440 --> 00:30:29,480 So those were stripped out, so we used an iframe, and Base64 encoded the payload. 760 00:30:32,160 --> 00:30:33,680 In this case we're going to steal passwords. 761 00:30:34,160 --> 00:30:39,460 So we're going to use the NSILoginManager XPCOM component, and the getAllLogins function, 762 00:30:39,660 --> 00:30:43,180 and then basically pull out the host name, the username, and the password, and send 763 00:30:43,180 --> 00:30:45,640 those as HTTP parameters to my website again. 764 00:30:57,080 --> 00:30:58,480 Oh yeah, this one keeps on running. 765 00:31:05,900 --> 00:31:11,660 OK, so here's Feed Sidebar, reload my feed, going to click on the item, and here's a little 766 00:31:11,660 --> 00:31:12,100 pre... 767 00:31:12,100 --> 00:31:13,340 Ah, no scripts disabled. 768 00:31:13,500 --> 00:31:13,840 I forgot. 769 00:31:15,920 --> 00:31:19,620 The reason that shows up five times is because it's sending to my site five times. 770 00:31:20,480 --> 00:31:24,180 It does work with no script enabled for the site as well. 771 00:31:25,660 --> 00:31:35,420 If we hop along to the other one, you can see here we've got a Google password, a Facebook 772 00:31:35,420 --> 00:31:40,980 password, the username and the password, eBay, and actually the FTP server as well, 773 00:31:41,020 --> 00:31:41,560 which we just used. 774 00:31:41,920 --> 00:31:43,900 So yeah, sending your passwords away somewhere else. 775 00:31:44,680 --> 00:31:45,160 . 776 00:31:58,160 --> 00:32:00,220 And last but not least, we've got ScribeFire. 777 00:32:01,300 --> 00:32:05,880 This is a blogging extension, about two and a half million downloads, again recommended. 778 00:32:06,060 --> 00:32:08,940 So all the ones that we're showing you today are recommended by Mozilla. 779 00:32:10,840 --> 00:32:15,140 In this case, any JavaScript and DOM event handlers, so like onLoad or onAeroTags and 780 00:32:15,160 --> 00:32:16,900 images, would be passed in the Chrome zone. 781 00:32:17,360 --> 00:32:21,280 So we just used an image with some nasty JavaScripts in there. 782 00:32:22,300 --> 00:32:27,820 And in this case, we're going to send a reverse VNC shell using an XML HTTP request to download 783 00:32:27,820 --> 00:32:28,180 the binary. 784 00:32:28,920 --> 00:32:33,600 So important thing to note is in that first box is to use override MIME type to set it 785 00:32:33,600 --> 00:32:38,440 to X user defined, because otherwise it downloads in UGF7 and your binary doesn't work. 786 00:32:39,800 --> 00:32:41,080 So yeah, use UDFA. 787 00:32:41,360 --> 00:32:44,400 And you can see where you want to download the file to. 788 00:32:45,160 --> 00:32:46,360 Using 777 permissions. 789 00:32:47,040 --> 00:32:50,980 What isn't included up there is the remote code execution thing, but Roberto showed you 790 00:32:50,980 --> 00:32:51,900 that a few slides ago. 791 00:32:52,120 --> 00:32:53,580 So I'm sure we can put it together. 792 00:32:54,760 --> 00:32:55,760 Okay, demo time. 793 00:33:03,060 --> 00:33:05,720 Okay, so I'm just going to launch the payload handler there. 794 00:33:05,860 --> 00:33:09,600 It's just using the Metasploit reverse VNC handler. 795 00:33:15,360 --> 00:33:16,720 You can go away. 796 00:33:18,280 --> 00:33:19,600 Make sure this thing's embedded. 797 00:33:22,260 --> 00:33:22,920 Scribe fire. 798 00:33:24,040 --> 00:33:24,740 All right. 799 00:33:27,300 --> 00:33:29,520 So I'm going to load up scribe fire. 800 00:33:30,020 --> 00:33:36,280 And essentially, dragging and dropping it into here is going to execute an onload tag. 801 00:33:37,340 --> 00:33:39,020 Yeah, I'll show you the code for it in a second. 802 00:33:39,600 --> 00:33:40,020 So drop it there. 803 00:33:40,140 --> 00:33:41,180 Oh, there's an hourglass. 804 00:33:41,280 --> 00:33:41,760 Something's happening. 805 00:33:42,280 --> 00:33:45,000 If you look here, it's downloaded these Winzip.exes. 806 00:33:45,680 --> 00:33:53,360 And if you hop along to the other one, to the Linux box, we've got a VNC shell. 807 00:34:03,080 --> 00:34:05,780 And if you just have a, I'll just show you the... 808 00:34:08,800 --> 00:34:09,520 So you can see. 809 00:34:09,580 --> 00:34:10,500 It's just an onload there. 810 00:34:10,600 --> 00:34:14,960 It just has all of this JavaScript, which calls XPCOM components and does all the good 811 00:34:14,960 --> 00:34:15,180 work. 812 00:34:16,620 --> 00:34:17,100 Yeah. 813 00:34:24,040 --> 00:34:25,420 Okay, and that's it for our demos today. 814 00:34:26,700 --> 00:34:30,320 So security disclosure is a pretty new process to extension developers and vendors. 815 00:34:30,680 --> 00:34:32,280 It's not really understood by them. 816 00:34:32,640 --> 00:34:34,700 It's all fairly new. 817 00:34:35,440 --> 00:34:39,380 Aren't really many, very many posts about on full disclosure or anything like that. 818 00:34:39,580 --> 00:34:45,940 And we have talked to Mozilla and they've said that there is a place to actually securely 819 00:34:45,940 --> 00:34:48,140 lodge bugs and extensions. 820 00:34:48,460 --> 00:34:51,700 Because previously we couldn't find where you put the secure flag. 821 00:34:52,040 --> 00:34:56,600 And some places don't publish contact details for themselves. 822 00:34:56,740 --> 00:34:59,200 So if you find a bug in it, you don't have a way to contact them. 823 00:34:59,500 --> 00:35:03,260 You have to go through like the online help desk thing and ask them to contact you privately 824 00:35:03,260 --> 00:35:03,540 or whatever. 825 00:35:04,080 --> 00:35:04,920 Pain in the ass. 826 00:35:07,120 --> 00:35:08,200 So we've got a few recommendations. 827 00:35:08,200 --> 00:35:13,380 For developers of extensions, follow the OWASP developers guide and look at code of similar 828 00:35:13,380 --> 00:35:15,340 extensions for avoiding common bugs. 829 00:35:17,040 --> 00:35:20,840 But read it and don't use it blindly. 830 00:35:22,240 --> 00:35:26,900 For dirty hacksaws and security professionals, use the OWASP testing guide and our presentation 831 00:35:26,900 --> 00:35:27,440 when you're testing. 832 00:35:28,540 --> 00:35:30,340 And look for any publications we release. 833 00:35:30,400 --> 00:35:34,680 We're working on a strong methodology for this which will be published in a while. 834 00:35:35,700 --> 00:35:37,620 And for end users, don't trust extensions. 835 00:35:38,680 --> 00:35:39,800 No scripts are right. 836 00:35:40,020 --> 00:35:41,300 But we can compromise it. 837 00:35:42,600 --> 00:35:47,300 If you're going to use an extension, look for the changelog security issues or the bugs 838 00:35:47,300 --> 00:35:47,660 in the history. 839 00:35:47,900 --> 00:35:51,360 If it has like six security issues in the last year or something, you probably don't 840 00:35:51,360 --> 00:35:51,920 want to install it. 841 00:35:53,420 --> 00:35:56,740 And if you're updating add-ons, again, check all of the changelogs. 842 00:35:57,380 --> 00:36:01,860 And consider using safe mode, which basically disables all extensions or links. 843 00:36:02,860 --> 00:36:04,400 And that's about it for us, I think. 844 00:36:05,400 --> 00:36:06,000 Thanks, guys. 845 00:36:07,840 --> 00:36:08,340 See you next time. 846 00:36:08,340 --> 00:36:08,360 Bye-bye. 847 00:36:08,380 --> 00:36:08,520 .