1 00:00:00,000 --> 00:00:05,920 Thank you all for coming. I am David Thiel. This is Alex Stamos and Justine Osborne. 2 00:00:06,260 --> 00:00:14,760 We're consultants with iSEC Partners and are here to talk a little bit about some new web application frameworks 3 00:00:15,360 --> 00:00:20,920 that move web applications a lot more onto the desktop and give them a lot more power than you're used to. 4 00:00:22,660 --> 00:00:28,340 So there are a bunch of different vendors and frameworks that we have to get through in a limited amount of time, 5 00:00:28,340 --> 00:00:30,740 so I'm going to go pretty quick through the introduction here. 6 00:00:31,300 --> 00:00:41,520 But ARIA is a term that was invented to describe applications that behave a little bit more like desktop apps 7 00:00:41,520 --> 00:00:43,160 than a regular web application. 8 00:00:44,600 --> 00:00:49,780 They are all fairly different, but there are some things that they have in common. 9 00:00:50,700 --> 00:00:56,140 They tend to make heavy use of AJAX-type calls, so asynchronous updates to pages. 10 00:00:56,420 --> 00:00:58,320 They introduce a lot of new local storage. 11 00:00:58,340 --> 00:01:03,760 They introduce a lot of new storage mechanisms, including DOM storage, and we'll talk about later some SQL databases. 12 00:01:05,760 --> 00:01:14,580 They tend to lean towards having an offline mode, so that you can sync up your web mail or something like that 13 00:01:14,580 --> 00:01:20,900 and go onto a plane and still continue to use a web application or one of these apps to continue to work 14 00:01:20,900 --> 00:01:22,240 just like it were a desktop app. 15 00:01:23,240 --> 00:01:25,600 Some of them break out of the browser entirely. 16 00:01:26,320 --> 00:01:28,260 Some of them utilize existing browsers. 17 00:01:29,660 --> 00:01:33,440 And others are basically like installing a new little mini web browser on your machine. 18 00:01:35,040 --> 00:01:40,020 They also have increased privilege in general over what a normal web application has. 19 00:01:40,440 --> 00:01:42,060 They're able to store data locally. 20 00:01:42,860 --> 00:01:44,760 They can open their own sockets. 21 00:01:44,800 --> 00:01:46,040 They can read and write to files. 22 00:01:48,060 --> 00:01:51,780 It's essentially a way to turn web apps into full-fledged desktop apps. 23 00:01:53,900 --> 00:01:57,640 So, basically, everybody started with desktop applications. 24 00:01:58,340 --> 00:02:02,480 They moved all of their applications into web browsers and decided it wasn't a very good idea. 25 00:02:02,940 --> 00:02:07,140 And I guess, so now we move them back onto the desktop, and this is progress. 26 00:02:07,780 --> 00:02:17,500 So, the reasons why you would want to use one of these applications, it's becoming more sexy than regular web 2.0 stuff. 27 00:02:18,700 --> 00:02:22,400 It also, it does give you a little bit of a benefit in terms of responsiveness. 28 00:02:22,580 --> 00:02:26,820 You can have large local data stores locally and cache them and use those. 29 00:02:28,540 --> 00:02:30,060 We talked about desktop integration. 30 00:02:30,720 --> 00:02:38,620 You can also write these entirely in HTML, JavaScript, Flash, things that web application developers are all familiar with. 31 00:02:38,920 --> 00:02:43,660 You don't really have to write a lot of new code, and it's all pretty easy. 32 00:02:45,020 --> 00:02:53,200 So, it, you know, on the good side of things, it means that people that, you know, only have experience writing web applications and web content can write full desktop apps. 33 00:02:53,340 --> 00:02:55,560 And if they have good ideas, then we can get cooler applications. 34 00:02:56,860 --> 00:02:58,320 But it's, you know, it's a good thing. 35 00:02:58,340 --> 00:03:04,480 You know, potentially not that great of a thing because there's a fairly low barrier to entry. 36 00:03:05,320 --> 00:03:12,420 And there are, you know, the amount of privilege that these applications have is increased a fair bit over your traditional web browser app. 37 00:03:12,800 --> 00:03:14,880 So, these are the ones we're going to look at. 38 00:03:14,960 --> 00:03:24,620 There are the, you know, these five major vendors that are all competing for, you know, the next big API and way to handle these type of applications. 39 00:03:25,560 --> 00:03:28,140 And Alex will start off with Adobe Air. 40 00:03:30,380 --> 00:03:31,060 Thanks, Dave. 41 00:03:32,060 --> 00:03:39,500 So, Adobe Air, we have these nice little graphics, which it turns out would take 12 seconds in PowerPoint and took David about two days in LaTeX. 42 00:03:41,580 --> 00:03:46,580 Just as a quick comparison of the full, how full-fledged the feature set is for each of these different frameworks. 43 00:03:46,940 --> 00:03:51,340 As you can see, everything's checked here because Adobe Air can do just about anything. 44 00:03:52,760 --> 00:03:58,320 Adobe Air is, while it's called a rich internet application framework, sometimes by default. 45 00:03:58,320 --> 00:04:07,540 But Adobe and often in the press, it really is more of a, it actually totally is a full-featured desktop runtime, right? 46 00:04:07,700 --> 00:04:18,520 If you consider it kind of like .NET or Java or any kind of other cross-platform runtime that has the full-fledged run of the desktop to do anything the heck it wants. 47 00:04:18,940 --> 00:04:22,000 It's cross-browser and cross-platform. 48 00:04:22,340 --> 00:04:26,600 Right now, they've released it for OS X and Windows. 49 00:04:26,600 --> 00:04:29,460 But Pellis, do you want to wave to everybody? 50 00:04:29,880 --> 00:04:37,120 Pellis or Lee from Adobe will take your request for your favorite open-source operating system and, you know, prioritize it. 51 00:04:37,200 --> 00:04:39,660 They'll get right on the NetBSD development real soon. 52 00:04:40,160 --> 00:04:43,220 You can make these applications in multiple different environments. 53 00:04:43,300 --> 00:04:49,480 You can use Adobe Flex or Adobe Flash, which are commercial products that a lot of graphic designers and web designers are already familiar with. 54 00:04:49,620 --> 00:04:56,060 But you can also make these applications with free tools, just writing text, HTML, and JavaScript and using a compiler. 55 00:04:56,140 --> 00:04:56,580 That's great. 56 00:04:56,600 --> 00:04:57,560 So, this is a great tool that you can get for free from Adobe. 57 00:04:57,800 --> 00:05:05,120 In that case, the basic system here, the basic unit here is the Flash Swift that runs within the Flash virtual machine. 58 00:05:05,460 --> 00:05:15,000 So, in the HTML and JavaScript case, that gets compiled within a Swift that is provided by Adobe, a container Swift that then you don't have to write yourself. 59 00:05:15,320 --> 00:05:22,320 But then they expose lots of cool functionality through JavaScript so that you can do more things that you can normally do in HTML and JavaScript. 60 00:05:22,780 --> 00:05:26,580 This is much more intended to be more powerful than a general re-application. 61 00:05:27,260 --> 00:05:28,120 There's no sandbox. 62 00:05:28,520 --> 00:05:30,120 Apps run with the full power of the user. 63 00:05:30,380 --> 00:05:36,120 So, because this is a desktop application, shouldn't we just write it off as if it's malicious, that's fine. 64 00:05:36,220 --> 00:05:37,100 If it's not, that's fine. 65 00:05:37,180 --> 00:05:37,960 It's all up to the user. 66 00:05:38,400 --> 00:05:39,280 Not really, right? 67 00:05:39,340 --> 00:05:42,500 It's not just like a normal, say, Win32 program on a desktop. 68 00:05:43,820 --> 00:05:46,540 The power of AIR is the I in RIA. 69 00:05:46,660 --> 00:05:47,940 It's the internet connectivity part. 70 00:05:49,080 --> 00:05:54,120 It is very, RIA, AIR apps are very easy to launch. 71 00:05:54,280 --> 00:05:55,860 It's an optional thing for the developer. 72 00:05:56,580 --> 00:06:00,340 But they're easy to make it so that AIR applications can be launched by web browsers, by sites. 73 00:06:00,860 --> 00:06:02,960 And I think that's the way they're normally going to be used. 74 00:06:03,140 --> 00:06:06,500 So that if you go to, say, eBay, eBay has their own AIR application. 75 00:06:07,020 --> 00:06:09,140 One day, eBay is probably going to turn it on. 76 00:06:09,220 --> 00:06:14,960 So if you go to eBay and you have the app turned on, they launch the RIA application so you can get the richer interface than the web interface. 77 00:06:15,500 --> 00:06:16,960 So they can be invoked by browsers. 78 00:06:17,360 --> 00:06:20,240 They have a lot of native mechanisms for loading external content. 79 00:06:20,480 --> 00:06:26,560 If you're writing a Win32 program in C++, you have to do a lot of work to download, say, a Flash Swift file in place. 80 00:06:26,580 --> 00:06:27,420 You have to play a movie, right? 81 00:06:27,560 --> 00:06:31,500 That's one line of code or two lines of code in ActionScript and Adobe AIR. 82 00:06:31,620 --> 00:06:37,680 So it's very easy for developers to bring down content from untrusted places and run it locally within this desktop application. 83 00:06:38,420 --> 00:06:40,900 And it's highly likely that's going to happen, right? 84 00:06:41,220 --> 00:06:45,740 It would be really stupid to go just write a full desktop app that has no internet connectivity with AIR. 85 00:06:45,780 --> 00:06:48,860 It's not the thing that you write the next competitor to office in. 86 00:06:49,000 --> 00:06:53,160 It's a thing that you write that has tight internet integration and lots of media capability. 87 00:06:54,020 --> 00:07:00,280 So really, it's probably better to think of Adobe AIR like ActiveX or fulltrust.net applications. 88 00:07:01,160 --> 00:07:03,280 The code runs as full privileges. 89 00:07:03,520 --> 00:07:08,200 And there is some code prevention and sandboxing techniques there. 90 00:07:09,160 --> 00:07:12,580 But like ActiveX, once it's installed, it can do anything the heck it wants. 91 00:07:13,700 --> 00:07:17,380 Fortunately, Adobe seems to have learned a couple things from ActiveX, and we'll talk about that. 92 00:07:17,480 --> 00:07:19,800 So AIR applications are identified by two things. 93 00:07:19,980 --> 00:07:21,580 There's an app ID and a publisher ID. 94 00:07:21,580 --> 00:07:28,360 The publisher ID is a big, long, entropic-looking string that is calculated by the person's information that they add into a certificate, 95 00:07:28,540 --> 00:07:32,000 and then the public key of a certificate that is generated for each developer. 96 00:07:32,740 --> 00:07:36,540 The app ID is just a string that is decided by that developer. 97 00:07:37,620 --> 00:07:39,460 AIR applications can't be launched directly. 98 00:07:39,820 --> 00:07:44,020 You can't just use an object tag or call them from JavaScript like an ActiveX control. 99 00:07:44,480 --> 00:07:47,600 You have to launch them from inside of a flash file itself. 100 00:07:47,980 --> 00:07:51,240 So to launch an AIR application, you load up a flash file. 101 00:07:51,340 --> 00:07:51,560 Just like an app. 102 00:07:51,580 --> 00:07:53,260 Just a normal, jailed Swift. 103 00:07:53,540 --> 00:07:59,920 And then within that flash file, they pull down AIR.swift, which is Adobe's recommended way of doing it, 104 00:08:00,020 --> 00:08:04,020 which is a flash file that now adds more functionality to your local Flash 9 instance. 105 00:08:04,860 --> 00:08:06,540 Unfortunately, there's no secure way of doing this. 106 00:08:06,600 --> 00:08:09,440 You can't do HTTPS here because this turns out to be ACOM-ized. 107 00:08:10,200 --> 00:08:14,220 If you want to do it securely, you should copy AIR.swift to your local site 108 00:08:14,220 --> 00:08:17,000 and then change this URL to do HTTPS to your local site. 109 00:08:18,260 --> 00:08:20,900 Once those classes are now defined, 110 00:08:20,900 --> 00:08:23,880 within your execution environment, your Flash execution environment, 111 00:08:24,040 --> 00:08:26,800 you can then check to see if an application is installed and get its version. 112 00:08:27,280 --> 00:08:30,040 This means once you have AIR apps installed, 113 00:08:30,320 --> 00:08:32,780 any site you go to can find out what AIR apps you have installed, 114 00:08:33,320 --> 00:08:35,000 which is fine for some AIR apps. 115 00:08:35,340 --> 00:08:38,920 If you have the My Little Pony MM org written in Adobe AIR, 116 00:08:39,020 --> 00:08:40,900 perhaps that's the kind of thing that you don't want to expose. 117 00:08:41,140 --> 00:08:46,260 There's no way that you can prevent malicious Flash applets 118 00:08:46,260 --> 00:08:49,000 from finding out what AIR apps you have installed and exactly what version. 119 00:08:49,380 --> 00:08:50,880 And once we know, hey, it's installed, 120 00:08:50,880 --> 00:08:53,640 it's pretty simple to just launch it, 121 00:08:54,420 --> 00:08:56,140 calling a new function called launch application, 122 00:08:56,580 --> 00:08:58,740 giving it the app ID, the pub ID, and then arguments. 123 00:08:58,840 --> 00:09:02,640 That's an array of arguments of objects that get passed to it. 124 00:09:03,060 --> 00:09:06,980 So this can be passed from a non-trusted Flash Swift 125 00:09:06,980 --> 00:09:08,920 into a trusted Adobe AIR application. 126 00:09:09,520 --> 00:09:12,560 By default, the code that runs in an AIR application runs with full writes. 127 00:09:12,840 --> 00:09:15,460 They've added a bunch of classes to JavaScript or ActionScript, 128 00:09:15,560 --> 00:09:17,260 depending on what you're using to write your AIR application in, 129 00:09:17,340 --> 00:09:19,640 to do a bunch of dangerous stuff like talk to files locally 130 00:09:19,640 --> 00:09:21,400 and install in program files, 131 00:09:21,560 --> 00:09:24,140 and you can write stuff over Windows system 32 and such. 132 00:09:25,860 --> 00:09:28,360 With the existing capabilities in AIR 1.1, 133 00:09:28,520 --> 00:09:31,380 it is possible to make a local system run native code 134 00:09:31,380 --> 00:09:32,640 into backdoor and operating system. 135 00:09:33,300 --> 00:09:35,640 There are rumors on blogs that talk about it 136 00:09:35,640 --> 00:09:38,680 that Adobe will eventually add more things like shell execute and stuff. 137 00:09:38,860 --> 00:09:40,940 There's no actual security downside there. 138 00:09:41,100 --> 00:09:42,420 You already have full control. 139 00:09:42,660 --> 00:09:44,580 It'll just make it maybe a little bit easier for people. 140 00:09:45,000 --> 00:09:48,060 You don't actually have a code access security model like .NET or Java 141 00:09:48,060 --> 00:09:49,620 where you have method permitting, 142 00:09:49,640 --> 00:09:53,120 method or class-by-class control over what an application can call. 143 00:09:53,580 --> 00:09:56,580 Instead, they've created five predefined sandboxes. 144 00:09:56,660 --> 00:10:00,440 The application sandbox is the default sandbox that your application boots up in. 145 00:10:00,560 --> 00:10:01,680 You can do anything you want. 146 00:10:02,960 --> 00:10:03,980 There's the remote sandbox, 147 00:10:04,280 --> 00:10:06,040 which is if you pull stuff down from the Internet, 148 00:10:06,200 --> 00:10:07,220 like a Swift from the Internet, 149 00:10:07,320 --> 00:10:10,320 or you open up an iframe to an HTML page on the Internet, 150 00:10:10,500 --> 00:10:12,640 then that's going to, by default, run in the remote sandbox. 151 00:10:12,980 --> 00:10:15,340 And there's three others that if we had multiple hours, 152 00:10:15,380 --> 00:10:17,160 we could talk about, but you guys probably don't care about. 153 00:10:17,280 --> 00:10:18,380 Kind of intermediate ones. 154 00:10:20,080 --> 00:10:22,840 When you load that external data, 155 00:10:23,020 --> 00:10:25,280 it automatically goes into the remote sandbox. 156 00:10:25,520 --> 00:10:27,520 An important part of their security model 157 00:10:27,520 --> 00:10:29,780 is that stuff that runs in the application sandbox, 158 00:10:30,060 --> 00:10:32,740 the local code that's doing all the dangerous stuff, 159 00:10:32,900 --> 00:10:36,020 should not be able to do just-in-time execution. 160 00:10:36,260 --> 00:10:38,920 It shouldn't be able to pull code down and then install it. 161 00:10:39,000 --> 00:10:41,360 Flash used to have the ability that you could take a byte string 162 00:10:41,360 --> 00:10:43,860 and create a Flash class out of it and call it. 163 00:10:43,980 --> 00:10:44,740 You can't do that. 164 00:10:44,840 --> 00:10:47,400 You can't run the JavaScript eval command, for example. 165 00:10:47,660 --> 00:10:49,140 You can't have a script tag 166 00:10:49,140 --> 00:10:50,480 that does a cross-domain source. 167 00:10:50,960 --> 00:10:53,480 So they've worked really hard to find all the things 168 00:10:53,480 --> 00:10:55,520 that will allow you to get commands from the Internet 169 00:10:55,520 --> 00:10:57,560 and not allow them in the application sandbox. 170 00:10:57,880 --> 00:11:00,140 On the other side, there's the remote sandbox. 171 00:11:00,920 --> 00:11:03,060 The remote sandbox can't do dangerous stuff, 172 00:11:03,220 --> 00:11:04,720 but it can do things like evals 173 00:11:04,720 --> 00:11:07,720 and pull down SWIFTs from remote that run locally 174 00:11:07,720 --> 00:11:09,020 and pull down JavaScript remotely 175 00:11:09,020 --> 00:11:11,760 and can do cross-domain XMLHP requests, 176 00:11:11,820 --> 00:11:12,500 depending on some things. 177 00:11:13,300 --> 00:11:15,520 This is probably a sufficient place 178 00:11:15,520 --> 00:11:17,220 for most developers to write their code. 179 00:11:17,220 --> 00:11:18,920 Unfortunately, though, they're going to be running 180 00:11:18,920 --> 00:11:21,060 the application sandbox by default. 181 00:11:22,120 --> 00:11:24,680 So these are some reasonable security protections 182 00:11:24,680 --> 00:11:26,880 that Adobe has probably worked very hard to put in. 183 00:11:27,740 --> 00:11:29,860 Obviously, because they're reasonable security protections, 184 00:11:30,060 --> 00:11:31,860 web developers are going to work really hard 185 00:11:31,860 --> 00:11:32,620 to circumvent them, 186 00:11:33,220 --> 00:11:35,480 which is the history of how this kind of stuff works. 187 00:11:35,760 --> 00:11:38,080 So one thing they could do is look for mistakes Adobe made 188 00:11:38,080 --> 00:11:40,740 in the classification of methods that are dangerous or not dangerous. 189 00:11:41,740 --> 00:11:44,680 That's, you know, not easy. 190 00:11:44,820 --> 00:11:45,820 We've looked a little bit. 191 00:11:45,820 --> 00:11:47,500 It seems like they've done a reasonable job 192 00:11:47,500 --> 00:11:50,420 of classifying the stuff that can't run the application sandbox, 193 00:11:50,600 --> 00:11:51,300 that's dynamic code, 194 00:11:51,440 --> 00:11:54,220 and classifying the dangerous stuff that can't run the remote sandbox. 195 00:11:54,580 --> 00:11:56,680 But better yet, they provide a mechanism 196 00:11:56,680 --> 00:11:59,920 that allows you to move information back and forth 197 00:11:59,920 --> 00:12:00,840 between these sandboxes. 198 00:12:00,840 --> 00:12:01,840 It's called the sandbox bridge. 199 00:12:03,300 --> 00:12:05,380 Basically, the way it works is, 200 00:12:05,880 --> 00:12:08,480 say I have an application that runs in the application sandbox. 201 00:12:08,600 --> 00:12:09,800 It can do anything the heck it wants. 202 00:12:10,500 --> 00:12:12,500 And it wants to load up an iframe. 203 00:12:12,840 --> 00:12:15,460 And in that iframe is going to be untrusted code from the Internet. 204 00:12:15,820 --> 00:12:18,840 But it has to expose some kind of functionality to that untrusted code. 205 00:12:19,160 --> 00:12:22,040 You create an object, like here we call the high-right stuff object. 206 00:12:22,360 --> 00:12:24,340 We give it a method called write to file. 207 00:12:24,500 --> 00:12:26,100 And we put a bunch of dangerous stuff in there. 208 00:12:26,200 --> 00:12:27,440 And it takes a couple of arguments. 209 00:12:27,920 --> 00:12:31,760 And then we attach that object to what's called the parent sandbox bridge, 210 00:12:31,960 --> 00:12:34,900 which already exists. 211 00:12:35,380 --> 00:12:37,920 And then once we've attached it to the parent sandbox bridge, 212 00:12:38,200 --> 00:12:40,220 we call and we say here's an iframe, 213 00:12:40,300 --> 00:12:41,240 pull down some dangerous stuff. 214 00:12:41,460 --> 00:12:43,680 And then the code in the iframe, say JavaScript, 215 00:12:44,040 --> 00:12:45,800 can say, okay, parent sandbox bridge, 216 00:12:45,820 --> 00:12:47,120 thank you for giving me that function, 217 00:12:47,280 --> 00:12:48,720 that dangerous function, I'm going to use it. 218 00:12:48,940 --> 00:12:52,180 It's kind of like setting a set UID bit on a method. 219 00:12:52,560 --> 00:12:55,220 If this is a variable, it's passed by copying. 220 00:12:55,380 --> 00:12:56,380 It's not passed by reference. 221 00:12:56,640 --> 00:12:58,980 But obviously it has to be some kind of passing by reference 222 00:12:58,980 --> 00:13:00,640 if it's a function like this, 223 00:13:00,700 --> 00:13:03,400 because it does run with the permissions of the parent. 224 00:13:04,100 --> 00:13:06,900 So in this example, this was a very bad move, right? 225 00:13:07,140 --> 00:13:10,040 In this case, the developer created a function 226 00:13:10,040 --> 00:13:13,700 that can take an arbitrary file name and arbitrary content 227 00:13:13,700 --> 00:13:15,380 and then write it to the hard drive. 228 00:13:15,820 --> 00:13:20,520 It exposed it to the untrusted code running in an iframe. 229 00:13:20,760 --> 00:13:21,980 And so in this case, they have, 230 00:13:22,140 --> 00:13:23,660 with only a couple of lines of code, 231 00:13:23,780 --> 00:13:25,500 the web developer or the air developer, 232 00:13:25,680 --> 00:13:26,920 they're not web developers anymore, right? 233 00:13:26,980 --> 00:13:28,460 Now they're empowered to be desktop developers. 234 00:13:28,680 --> 00:13:31,220 So the desktop developer that doesn't know how to use anything 235 00:13:31,220 --> 00:13:35,440 but HTML and JavaScript has gone and ruined 236 00:13:35,440 --> 00:13:36,840 the entire Adobe sandbox model. 237 00:13:37,980 --> 00:13:40,120 Adobe has to provide some kind of way for doing the communication, 238 00:13:40,360 --> 00:13:42,040 but it looks like it is going to be pretty easy 239 00:13:42,040 --> 00:13:43,300 for people to shoot themselves in the foot. 240 00:13:43,880 --> 00:13:45,180 Air requires Flash 9. 241 00:13:46,800 --> 00:13:49,440 Air itself is an add-on to Flash 242 00:13:49,440 --> 00:13:51,300 that the first time you load an Air app, 243 00:13:52,060 --> 00:13:56,500 Adobe provides a sample code called, I think, badge.swift 244 00:13:56,500 --> 00:14:00,280 that will automatically have the Air methods loaded up, 245 00:14:00,360 --> 00:14:01,780 and it gives you this little pop-up. 246 00:14:01,860 --> 00:14:03,000 Do you want to install Adobe Air? 247 00:14:03,720 --> 00:14:05,200 No real security warnings or anything. 248 00:14:05,300 --> 00:14:07,000 This actually isn't, like, too dangerous a thing. 249 00:14:07,160 --> 00:14:09,400 It comes down as a signed binary and installs. 250 00:14:09,960 --> 00:14:12,920 Once the Air runtime is installed in Flash, 251 00:14:13,400 --> 00:14:14,860 Air applications can be installed. 252 00:14:14,860 --> 00:14:16,820 They can be bundled as .air files, 253 00:14:17,100 --> 00:14:19,780 which are binaries that contain a bunch of swifts 254 00:14:19,780 --> 00:14:22,140 and an XML file and stuff like that, zip files. 255 00:14:22,820 --> 00:14:24,960 They can also be installed from a web page. 256 00:14:25,460 --> 00:14:26,400 If you have a swift, 257 00:14:26,640 --> 00:14:28,820 it can call the install application function. 258 00:14:29,120 --> 00:14:31,240 That pops a little thing that says, 259 00:14:31,260 --> 00:14:32,580 do you want to open this file or save it? 260 00:14:33,080 --> 00:14:34,680 After that, you get a prompt like this. 261 00:14:35,860 --> 00:14:37,880 Every single Air application has to be signed 262 00:14:38,420 --> 00:14:40,700 by either a trusted root cert, 263 00:14:40,780 --> 00:14:42,440 and they've got three CAs, I believe, 264 00:14:42,500 --> 00:14:43,640 that can issue those certs, 265 00:14:43,640 --> 00:14:45,680 or they have to be signed by a self-signed cert. 266 00:14:46,680 --> 00:14:49,400 This is what you get if it comes from a trusted cert. 267 00:14:50,440 --> 00:14:52,940 If you paid more than $120, 268 00:14:53,200 --> 00:14:54,180 there would be projectors here 269 00:14:54,180 --> 00:14:56,180 that could actually show you this text, 270 00:14:57,260 --> 00:14:58,320 but I'll read it for you. 271 00:14:58,460 --> 00:14:59,360 It says publisher, 272 00:15:00,620 --> 00:15:02,720 which is a publisher name that's pulled from the certificate. 273 00:15:03,240 --> 00:15:04,420 It says application. 274 00:15:05,060 --> 00:15:07,440 This is an application name that is controlled by the bad guy, 275 00:15:07,560 --> 00:15:10,560 so you can put, not necessarily the bad guy, 276 00:15:10,660 --> 00:15:12,040 the Adobe Air developer. 277 00:15:12,040 --> 00:15:14,220 The Air developer can put anything they want in there. 278 00:15:14,440 --> 00:15:16,740 It says system access unrestricted. 279 00:15:17,160 --> 00:15:19,200 This little green icon says verified, 280 00:15:19,560 --> 00:15:22,840 and then the little red icon says system access unrestricted. 281 00:15:22,880 --> 00:15:25,080 The application may access your file system in the internet, 282 00:15:25,240 --> 00:15:26,960 which may put your computer at risk. 283 00:15:27,700 --> 00:15:28,900 While technically accurate, 284 00:15:29,060 --> 00:15:31,800 this is perhaps not a strong enough warning to tell people, 285 00:15:31,960 --> 00:15:33,560 hey, by the way, if this is malicious, 286 00:15:33,720 --> 00:15:35,180 it can do whatever the heck it wants to your desktop. 287 00:15:36,120 --> 00:15:37,520 If it is unsigned, 288 00:15:37,600 --> 00:15:39,480 and also the default selection is install, 289 00:15:39,560 --> 00:15:40,480 so if you hit space or enter, 290 00:15:41,160 --> 00:15:42,440 you're going to automatically install it. 291 00:15:43,060 --> 00:15:44,360 If you do a self-signed certificate, 292 00:15:44,660 --> 00:15:46,140 they don't show the publisher. 293 00:15:46,220 --> 00:15:46,720 They say unknown, 294 00:15:47,000 --> 00:15:49,540 but they do still publish up the application name. 295 00:15:49,860 --> 00:15:50,760 In this case, 296 00:15:50,780 --> 00:15:52,740 it's a string of Chinese characters I can't read, 297 00:15:52,920 --> 00:15:55,700 and this is an application I downloaded from Adobe.com, 298 00:15:56,280 --> 00:15:57,800 published apparently by a Chinese person 299 00:15:57,800 --> 00:15:59,100 with a self-signed certificate, 300 00:15:59,660 --> 00:16:02,900 and they say that the publisher identity can't be determined, 301 00:16:03,040 --> 00:16:04,440 and it still has unrestricted access. 302 00:16:04,980 --> 00:16:05,840 As of right now, 303 00:16:06,060 --> 00:16:08,460 there's no way to turn off the bottom that says unrestricted access, 304 00:16:08,780 --> 00:16:10,140 because there's no version of Air 305 00:16:10,140 --> 00:16:11,540 that doesn't run with full access. 306 00:16:11,960 --> 00:16:14,280 So that always says read unrestricted. 307 00:16:15,540 --> 00:16:18,740 This kind of looks like pre-Internet Explorer 7 ActiveX controls. 308 00:16:19,500 --> 00:16:20,740 Just like Microsoft, 309 00:16:21,020 --> 00:16:23,060 Adobe has decided we're going to give people 310 00:16:23,060 --> 00:16:25,680 the information necessary to make an intelligent decision. 311 00:16:26,200 --> 00:16:26,860 But unfortunately, 312 00:16:27,180 --> 00:16:30,400 the level of skill needed to make that intelligent decision 313 00:16:30,400 --> 00:16:33,420 includes understanding the public-private key cryptography 314 00:16:33,420 --> 00:16:36,020 of how the Flash virtual machine works 315 00:16:36,020 --> 00:16:37,700 and whether or not Adobe Air is a desktop runtime. 316 00:16:37,980 --> 00:16:39,000 So for all you guys now, 317 00:16:39,000 --> 00:16:40,420 you can make that decision intelligently. 318 00:16:41,040 --> 00:16:44,880 If we give this talk something like 120 million times, 319 00:16:45,100 --> 00:16:47,440 then we should cover the Internet using Populous, 320 00:16:47,600 --> 00:16:49,700 and everybody will be able to make that correctly. 321 00:16:50,080 --> 00:16:51,020 But for the most part, 322 00:16:51,120 --> 00:16:52,200 just like with ActiveX, 323 00:16:52,380 --> 00:16:55,060 giving people the correct information might not be enough. 324 00:16:56,920 --> 00:16:58,160 ActiveX gave that right information, 325 00:16:58,320 --> 00:16:59,560 and their legacy became malware, 326 00:17:00,420 --> 00:17:02,120 that people would click yes to anything 327 00:17:02,120 --> 00:17:03,700 because they couldn't make that intelligent decision. 328 00:17:05,640 --> 00:17:08,840 And this kind of scary thing is that these days, 329 00:17:08,840 --> 00:17:11,220 the Flash virtual machine is much more popular 330 00:17:11,220 --> 00:17:12,880 than Internet Explorer actually has ever been. 331 00:17:13,040 --> 00:17:15,820 They have a more dominant position in the Internet market 332 00:17:15,820 --> 00:17:17,060 than Internet Explorer ever had, 333 00:17:17,200 --> 00:17:20,460 and so it might be a much better way to seed malware. 334 00:17:21,120 --> 00:17:23,380 So our suggestion is changing the default action 335 00:17:23,380 --> 00:17:24,880 on the signed certificate, 336 00:17:25,660 --> 00:17:27,520 adding a countdown timer, 337 00:17:27,580 --> 00:17:29,640 at least in the self-signed section, 338 00:17:29,760 --> 00:17:31,180 so that people have to read the warning. 339 00:17:32,120 --> 00:17:34,100 There is a registry key to turn off 340 00:17:34,100 --> 00:17:35,560 self-signed certificate support. 341 00:17:36,820 --> 00:17:38,820 Right now, it's allowed by default, 342 00:17:38,820 --> 00:17:40,700 there are reasonable reasons 343 00:17:40,700 --> 00:17:42,580 why you'd want to support self-signed certificates, 344 00:17:42,960 --> 00:17:44,480 but I don't think it's a reasonable thing 345 00:17:44,480 --> 00:17:46,580 to have turned on by default for most consumers, 346 00:17:46,840 --> 00:17:48,040 so flipping it. 347 00:17:48,480 --> 00:17:51,760 And then I don't think Adobe should be 348 00:17:51,760 --> 00:17:55,540 advertising self-signed error binaries 349 00:17:55,540 --> 00:17:57,460 from their own site, from Adobe.com. 350 00:17:57,880 --> 00:17:59,460 It's probably better for Adobe 351 00:17:59,460 --> 00:18:02,500 to enforce people getting real certificates, 352 00:18:02,720 --> 00:18:05,580 and perhaps doing a couple of sanity checks 353 00:18:05,580 --> 00:18:07,020 on the error apps before they come through. 354 00:18:08,160 --> 00:18:11,840 Right now, you can upload any error app to Adobe.com. 355 00:18:11,840 --> 00:18:13,140 It's going to be exposed to a lot of people. 356 00:18:13,300 --> 00:18:14,820 It might be a very good way to seed malware 357 00:18:14,820 --> 00:18:18,420 with Adobe looking to give a grant of imprimpture 358 00:18:18,420 --> 00:18:19,680 that this is a reasonable thing. 359 00:18:20,840 --> 00:18:22,780 We also think that there's probably some room 360 00:18:22,780 --> 00:18:24,380 between totally jailed error 361 00:18:24,380 --> 00:18:26,480 and completely free loose... 362 00:18:26,480 --> 00:18:27,860 I'm sorry, totally jailed Flash 363 00:18:27,860 --> 00:18:29,240 and completely free loose error. 364 00:18:29,740 --> 00:18:30,780 Most of the applications 365 00:18:30,780 --> 00:18:32,160 that are probably going to want to use error 366 00:18:32,160 --> 00:18:34,780 don't need to install a rootkit, right? 367 00:18:34,860 --> 00:18:36,480 That's not a function that, you know, 368 00:18:37,020 --> 00:18:38,780 a online store really needs. 369 00:18:38,880 --> 00:18:39,980 Well, maybe they think they need it, 370 00:18:40,080 --> 00:18:42,620 but I don't think that for their business model as of now, 371 00:18:43,000 --> 00:18:44,220 they're going to need that kind of functionality. 372 00:18:44,520 --> 00:18:46,420 So perhaps in error two or error three, 373 00:18:46,520 --> 00:18:48,960 we will see a middle ground solution here 374 00:18:48,960 --> 00:18:50,260 where you can install an error application 375 00:18:50,260 --> 00:18:52,240 that can't do anything willy-nilly. 376 00:18:52,880 --> 00:18:53,240 Okay. 377 00:18:53,740 --> 00:18:55,120 So we'll have questions at the end 378 00:18:55,120 --> 00:18:55,960 because we're going to run out of time, 379 00:18:56,020 --> 00:18:57,360 but for now, we'll turn it over to Justine 380 00:18:57,360 --> 00:18:58,200 to talk about Silverlight. 381 00:19:01,860 --> 00:19:02,220 Hi. 382 00:19:02,800 --> 00:19:06,040 So I'm just going to give a brief overview of Silverlight. 383 00:19:07,220 --> 00:19:09,640 So Silverlight is a browser plugin 384 00:19:09,640 --> 00:19:11,740 comparable in functionality to Flash. 385 00:19:12,340 --> 00:19:12,940 Oh. 386 00:19:14,880 --> 00:19:17,460 It claims to be cross-platform, 387 00:19:18,620 --> 00:19:20,620 but currently Linux support 388 00:19:20,620 --> 00:19:23,360 is left as an exercise to the community. 389 00:19:24,960 --> 00:19:27,520 It supports a subset of the .NET framework, 390 00:19:27,780 --> 00:19:29,480 and there's two versions. 391 00:19:29,700 --> 00:19:33,840 Silverlight 1 has been finally released, 392 00:19:33,900 --> 00:19:35,660 and Silverlight 2 is in the beta version. 393 00:19:36,820 --> 00:19:39,840 So both Silverlight 1 and Silverlight 2 394 00:19:39,840 --> 00:19:45,560 use XAML to render DUI. 395 00:19:45,660 --> 00:19:49,080 So XAML stands for the Extensible Application Market Language. 396 00:19:50,080 --> 00:19:54,860 And Silverlight 1 uses JavaScript for dynamic content. 397 00:19:55,160 --> 00:19:57,560 Silverlight 2 introduces the core CLR, 398 00:19:57,640 --> 00:20:00,420 which is a slimmed-down version of the .NET CLR 399 00:20:00,420 --> 00:20:04,300 for dynamic content. 400 00:20:04,300 --> 00:20:07,600 So here's an example of some XAML markup. 401 00:20:08,940 --> 00:20:17,880 So this is a language similar to HTML. 402 00:20:18,020 --> 00:20:21,460 You can create little widgets like a slider. 403 00:20:22,120 --> 00:20:25,280 It's very simple and easy for designers, 404 00:20:25,440 --> 00:20:27,000 intuitive for designers to pick up. 405 00:20:27,420 --> 00:20:31,300 So this is what that markup renders in Silverlight. 406 00:20:33,200 --> 00:20:33,920 Okay. 407 00:20:34,300 --> 00:20:36,060 So Silverlight security model 408 00:20:36,060 --> 00:20:41,140 is based on the .NET CLR security model, 409 00:20:41,320 --> 00:20:42,700 so code access security. 410 00:20:43,100 --> 00:20:45,160 Very briefly, code access security 411 00:20:45,160 --> 00:20:47,700 is security based on code identity. 412 00:20:48,000 --> 00:20:51,300 So your code gets different privileges 413 00:20:51,300 --> 00:20:52,500 depending on where it's from. 414 00:20:52,640 --> 00:20:53,940 So if it's from the Internet, 415 00:20:54,220 --> 00:20:55,540 it's going to have less privileges. 416 00:20:56,900 --> 00:21:03,400 So Silverlight has simplified classic code access security. 417 00:21:03,400 --> 00:21:07,900 So that the developer can only write transparent code. 418 00:21:08,920 --> 00:21:11,360 And then they can call into security, 419 00:21:11,520 --> 00:21:13,100 they can call into critical code 420 00:21:13,100 --> 00:21:15,180 with security-safe critical APIs, 421 00:21:15,340 --> 00:21:17,560 which Microsoft writes, 422 00:21:17,640 --> 00:21:19,940 and they are signed with a Microsoft public key. 423 00:21:22,700 --> 00:21:26,420 So that's how the sandbox works. 424 00:21:27,640 --> 00:21:29,840 So here's an example of what I'm talking about. 425 00:21:30,160 --> 00:21:32,720 I can't, in my Silverlight application, 426 00:21:32,720 --> 00:21:35,140 call file.create, 427 00:21:35,260 --> 00:21:37,160 because that's critical code. 428 00:21:38,480 --> 00:21:41,220 The second example will succeed 429 00:21:41,220 --> 00:21:45,480 because I'm calling from a safe critical API, 430 00:21:46,380 --> 00:21:48,980 which does stuff like input validation, 431 00:21:49,800 --> 00:21:51,880 as is shown in the example, 432 00:21:52,120 --> 00:21:53,660 the third example, which will fail, 433 00:21:54,400 --> 00:21:56,280 because it's trying to do something nasty 434 00:21:56,280 --> 00:21:57,420 like talk to the modem. 435 00:21:59,500 --> 00:22:02,000 So isolated storage is an example 436 00:22:02,000 --> 00:22:03,240 of one of the safe critical APIs, 437 00:22:03,640 --> 00:22:06,180 and some of the power that Silverlight has, 438 00:22:07,520 --> 00:22:09,160 access to the local system. 439 00:22:10,100 --> 00:22:13,420 And you can deny local storage. 440 00:22:14,000 --> 00:22:15,440 So that's a good thing to know. 441 00:22:17,060 --> 00:22:21,040 And network sockets is another way 442 00:22:21,040 --> 00:22:24,840 that Silverlight allows the browser plug-in 443 00:22:24,840 --> 00:22:26,180 to access the local system. 444 00:22:27,560 --> 00:22:30,040 And it requires a client access policy. 445 00:22:30,040 --> 00:22:32,100 So I'll talk a little bit about 446 00:22:32,100 --> 00:22:35,340 the cross-domain and Silverlight. 447 00:22:35,540 --> 00:22:38,360 So Silverlight honors the same 448 00:22:38,360 --> 00:22:40,180 cross-domain policy as Flash, 449 00:22:40,400 --> 00:22:43,660 so it will accept a cross-domain.xml file. 450 00:22:45,600 --> 00:22:47,160 Silverlight, by default, 451 00:22:47,260 --> 00:22:48,960 should only be able to call back 452 00:22:48,960 --> 00:22:50,500 to its domain of origin, 453 00:22:50,660 --> 00:22:53,740 but you can configure cross-domain access 454 00:22:53,740 --> 00:22:55,620 with these policy files. 455 00:22:55,980 --> 00:22:58,880 And client access policy is Silverlight's version 456 00:22:58,880 --> 00:23:00,520 of the cross-domain.xml. 457 00:23:02,440 --> 00:23:05,940 One of the interesting things that Silverlight has 458 00:23:05,940 --> 00:23:09,060 that Flash doesn't is the ability 459 00:23:09,060 --> 00:23:10,960 to turn off access to the hosting DOM. 460 00:23:11,240 --> 00:23:14,460 So you can embed Silverlight applications 461 00:23:14,460 --> 00:23:19,120 in the DOM and disallow them from... 462 00:23:19,120 --> 00:23:21,680 I mean, sorry, in a web page 463 00:23:21,680 --> 00:23:23,260 and disallow them from accessing the DOM. 464 00:23:24,580 --> 00:23:28,780 So the big deal here is that the attack surface 465 00:23:28,880 --> 00:23:31,240 is really in the safe critical APIs, 466 00:23:31,620 --> 00:23:36,200 and that's really Microsoft's job to maintain. 467 00:23:36,440 --> 00:23:42,200 So that offers some control with patching and whatnot. 468 00:23:42,780 --> 00:23:45,700 And then the other attack surface 469 00:23:45,700 --> 00:23:49,620 is really denial of service attacks against the user 470 00:23:49,620 --> 00:23:54,040 because Silverlight has access to the local system. 471 00:23:54,720 --> 00:23:57,040 Silverlight applications don't have to exit. 472 00:23:57,040 --> 00:24:00,200 It's up to the developer to implement that functionality. 473 00:24:02,500 --> 00:24:04,280 So really brief overview, 474 00:24:04,520 --> 00:24:06,280 but there's some fun stuff to play with here 475 00:24:06,280 --> 00:24:07,480 and a lot more work to be done. 476 00:24:07,620 --> 00:24:08,760 So I'll pass it over to David. 477 00:24:13,080 --> 00:24:16,120 So the frameworks that we've talked about so far 478 00:24:16,120 --> 00:24:17,920 have been kind of ways to write 479 00:24:17,920 --> 00:24:19,500 full-fledged desktop applications. 480 00:24:21,220 --> 00:24:24,220 In the case of Air, it's totally outside of the browser 481 00:24:24,220 --> 00:24:26,320 with some ways to interact with it. 482 00:24:27,600 --> 00:24:30,800 Some of the frameworks that we have coming up here, 483 00:24:30,940 --> 00:24:33,160 including Google Gears, Yahoo Browser Plus, 484 00:24:33,300 --> 00:24:34,220 and Mozilla Prism, 485 00:24:34,280 --> 00:24:36,500 are all more based around the browser 486 00:24:36,500 --> 00:24:38,360 but give extra capabilities. 487 00:24:38,880 --> 00:24:40,280 So you can see here that Gears 488 00:24:40,280 --> 00:24:44,060 doesn't have a whole lot that it can do. 489 00:24:44,200 --> 00:24:45,880 It does allow for running disconnected, 490 00:24:47,340 --> 00:24:49,760 and that's the main goal of Gears 491 00:24:49,760 --> 00:24:51,180 is to cache content locally 492 00:24:51,180 --> 00:24:52,840 and make it so a web app can be a local app. 493 00:24:54,000 --> 00:24:56,180 So the things that Gears consists of, 494 00:24:56,180 --> 00:24:58,000 there's an API for syncing data 495 00:24:58,000 --> 00:24:59,800 between your local machine and site. 496 00:25:00,900 --> 00:25:03,460 There's a SQLite instance locally 497 00:25:03,460 --> 00:25:07,300 that actually stores the data for that syncing. 498 00:25:07,860 --> 00:25:11,300 There's also a locally running application server. 499 00:25:11,680 --> 00:25:13,260 So you've got a browser plug-in 500 00:25:13,260 --> 00:25:14,960 that actually, if you're disconnected, 501 00:25:15,320 --> 00:25:16,800 it'll cache content 502 00:25:16,800 --> 00:25:18,720 and serve it back up to you 503 00:25:18,720 --> 00:25:20,360 from a local web server. 504 00:25:24,860 --> 00:25:25,700 We'll skip to it. 505 00:25:26,180 --> 00:25:27,320 So the other cool thing is that 506 00:25:27,320 --> 00:25:30,080 there are worker pools in Gears, 507 00:25:30,200 --> 00:25:32,000 and these are a method for, 508 00:25:32,080 --> 00:25:33,840 if you have really intensive JavaScript calculations, 509 00:25:35,020 --> 00:25:37,940 to offload them to be processed by something else 510 00:25:37,940 --> 00:25:40,520 rather than actually running inside the browser 511 00:25:40,520 --> 00:25:41,700 where you might lock the UI 512 00:25:41,700 --> 00:25:43,020 or diminish user experience. 513 00:25:45,380 --> 00:25:46,920 So for the most part, 514 00:25:47,000 --> 00:25:48,380 the mechanisms that are in Gears 515 00:25:49,070 --> 00:25:50,600 just utilize the same origin 516 00:25:50,600 --> 00:25:52,820 as a security precaution. 517 00:25:52,960 --> 00:25:55,160 They do give the ability to use 518 00:25:55,160 --> 00:25:56,840 parameterized SQL statements 519 00:25:56,840 --> 00:25:59,220 for accessing local database stores, 520 00:25:59,900 --> 00:26:01,340 and they do prompt for install. 521 00:26:02,160 --> 00:26:05,200 It's not a really awesome prompt 522 00:26:05,200 --> 00:26:07,100 and doesn't give users a lot of information 523 00:26:08,500 --> 00:26:10,760 because in Gears 0.3, 524 00:26:10,800 --> 00:26:12,440 which is still the current version, I believe, 525 00:26:12,980 --> 00:26:14,560 they introduced the ability for developers 526 00:26:14,560 --> 00:26:17,980 to basically have the security warning 527 00:26:17,980 --> 00:26:19,420 to look however they want it to. 528 00:26:20,960 --> 00:26:24,260 So here is a pretty trivial example. 529 00:26:24,260 --> 00:26:26,600 If you saw the Jafar talk, 530 00:26:26,800 --> 00:26:29,460 it turns out that there at least used to be a way 531 00:26:29,460 --> 00:26:32,680 to actually spoof the real URL, 532 00:26:32,880 --> 00:26:35,320 but what you have here is the friendly name up top, 533 00:26:35,800 --> 00:26:37,320 and if you just make the friendly name 534 00:26:37,320 --> 00:26:39,260 look like a legitimate site, 535 00:26:39,440 --> 00:26:41,960 you can actually customize the icon here 536 00:26:41,960 --> 00:26:43,020 so that it looks like a lock, 537 00:26:43,140 --> 00:26:45,160 which makes people want to click yes on things, 538 00:26:45,340 --> 00:26:48,940 and you can try and convince the user 539 00:26:48,940 --> 00:26:52,220 in whatever way possible to actually allow this. 540 00:26:52,380 --> 00:26:53,300 It's not... 541 00:26:53,300 --> 00:26:55,480 It doesn't really give you any information 542 00:26:55,480 --> 00:26:57,100 as to what could go wrong 543 00:26:57,100 --> 00:26:59,460 when you're accepting this kind of prompt, 544 00:27:00,240 --> 00:27:01,980 and I'll kind of get into 545 00:27:01,980 --> 00:27:03,800 what can actually go wrong a bit here. 546 00:27:05,040 --> 00:27:06,800 Suffice it to say that allowing developers 547 00:27:06,800 --> 00:27:10,560 to customize security prompts is not a great idea. 548 00:27:13,100 --> 00:27:15,840 But so with worker pools, 549 00:27:16,040 --> 00:27:17,600 one of the neat things about worker pools, 550 00:27:18,140 --> 00:27:20,720 because they don't lock up the UI 551 00:27:20,720 --> 00:27:23,000 or make your browser run slow, 552 00:27:23,300 --> 00:27:25,860 you can actually use them for things 553 00:27:25,860 --> 00:27:27,940 that would otherwise trigger, say, 554 00:27:28,020 --> 00:27:30,480 Firefox's runaway script detection, 555 00:27:30,740 --> 00:27:31,360 where it says, 556 00:27:31,520 --> 00:27:33,420 hey, this page is taking a really long time to respond. 557 00:27:33,660 --> 00:27:35,000 Do you want to let it keep going or not? 558 00:27:36,580 --> 00:27:38,580 Because it's so easy to get somebody 559 00:27:38,580 --> 00:27:41,320 to actually allow a site to use gears, 560 00:27:41,460 --> 00:27:44,840 you can actually use this to do things like 561 00:27:44,840 --> 00:27:46,900 push a bunch of hashes down to these machines 562 00:27:46,900 --> 00:27:48,440 and do hash crack... 563 00:27:48,440 --> 00:27:50,560 I mean, JavaScript is not the fastest way to crack hashes, 564 00:27:51,220 --> 00:27:53,280 but if you have a browser 565 00:27:53,300 --> 00:27:55,840 with an army of people that are all coming to your website 566 00:27:55,840 --> 00:27:57,700 and clicking yes and allowing you to use gears, 567 00:27:57,820 --> 00:27:59,500 you can actually run this stuff in the background. 568 00:27:59,720 --> 00:28:00,780 They go off and surf elsewhere. 569 00:28:01,020 --> 00:28:02,880 You can have it serve up the answers when it gets them. 570 00:28:03,260 --> 00:28:05,640 And it turns out that this actually works reasonably well. 571 00:28:08,080 --> 00:28:11,520 So the components of gears are pretty simple. 572 00:28:12,740 --> 00:28:16,360 Yahoo Browser Plus kind of goes in a weird direction 573 00:28:16,360 --> 00:28:19,320 where the idea of Browser Plus 574 00:28:19,320 --> 00:28:22,400 is making it so that developers 575 00:28:22,400 --> 00:28:27,520 rather than using a little framework 576 00:28:27,520 --> 00:28:32,180 for local data storage or other mechanisms like that, 577 00:28:32,280 --> 00:28:34,320 it basically makes it really easy to write 578 00:28:34,320 --> 00:28:36,200 your own modular browser plug-ins. 579 00:28:36,720 --> 00:28:39,420 So because nobody understands NPAPI 580 00:28:39,420 --> 00:28:42,060 and very few browser plug-ins exist, 581 00:28:42,500 --> 00:28:45,480 Yahoo decided that a way to make powerful web applications 582 00:28:45,480 --> 00:28:48,200 would be to write something that would allow people 583 00:28:48,200 --> 00:28:50,480 to just push down new browser plug-ins 584 00:28:50,480 --> 00:28:52,020 that run with full privilege. 585 00:28:54,400 --> 00:28:57,980 So there has been some attempt 586 00:28:57,980 --> 00:29:00,520 at putting security into this framework. 587 00:29:01,040 --> 00:29:04,200 Their inspiration for a good security model 588 00:29:04,200 --> 00:29:06,460 has been that of browser developers, 589 00:29:07,220 --> 00:29:09,680 which for something that actually allows you 590 00:29:09,680 --> 00:29:10,960 to run desktop applications, 591 00:29:11,620 --> 00:29:14,400 there could probably be a stronger model to follow. 592 00:29:15,660 --> 00:29:18,000 So you actually initialize this 593 00:29:18,000 --> 00:29:20,620 over an insecure connection back to Yahoo. 594 00:29:21,140 --> 00:29:22,540 It's another place where, 595 00:29:22,640 --> 00:29:24,420 who knows, because it's Akamai or something, 596 00:29:24,660 --> 00:29:25,960 you can't do it over SSL. 597 00:29:27,740 --> 00:29:29,820 So the first time you actually install it, 598 00:29:29,860 --> 00:29:31,120 you don't even have to restart your browser. 599 00:29:31,300 --> 00:29:33,580 It installs this plug-in and starts handling this stuff, 600 00:29:33,700 --> 00:29:35,620 and it'll push down on-demand components 601 00:29:36,140 --> 00:29:37,700 that are necessary for the web application. 602 00:29:38,120 --> 00:29:39,560 A couple of things that are included 603 00:29:39,560 --> 00:29:42,760 are a locally running version of ImageMagick 604 00:29:42,760 --> 00:29:44,960 to do image transforms, 605 00:29:46,180 --> 00:29:50,400 which has traditionally not been terribly bug-free code. 606 00:29:51,420 --> 00:29:54,800 There's a little sample app for uploading stuff to Flickr, 607 00:29:54,900 --> 00:29:57,080 notifications for Growl and Snarl 608 00:29:57,080 --> 00:29:59,740 to kind of poke into the OS notification framework, 609 00:30:00,040 --> 00:30:02,080 and an embedded Ruby interpreter. 610 00:30:03,980 --> 00:30:06,340 So this actually allows you 611 00:30:06,340 --> 00:30:08,720 to write further browser plug-ins in Ruby. 612 00:30:09,340 --> 00:30:12,020 So it's kind of this mash-up 613 00:30:12,020 --> 00:30:14,280 of ancient plug-in technology 614 00:30:14,280 --> 00:30:17,240 with new, sexy, slow interpreted languages. 615 00:30:18,820 --> 00:30:19,420 But... 616 00:30:19,420 --> 00:30:22,520 So these, of course, all run on the local machine 617 00:30:22,520 --> 00:30:24,520 with full user privilege. 618 00:30:26,040 --> 00:30:29,520 It's worse than ActiveX, as near as I can tell. 619 00:30:30,620 --> 00:30:32,880 The Ruby version that was shipping 620 00:30:32,880 --> 00:30:35,060 up until a week or two ago 621 00:30:35,060 --> 00:30:37,100 was actually the same version 622 00:30:37,100 --> 00:30:38,120 that some people might have heard about 623 00:30:38,120 --> 00:30:41,880 that had really trivial overflows 624 00:30:42,320 --> 00:30:44,060 in both arrays and strings. 625 00:30:45,540 --> 00:30:47,260 So precautions to developers, 626 00:30:47,400 --> 00:30:48,960 as long as you don't actually develop 627 00:30:49,420 --> 00:30:51,340 any applications using a rate of strings, 628 00:30:52,480 --> 00:30:53,420 you're perfectly safe. 629 00:30:54,720 --> 00:30:56,060 So it's not something... 630 00:30:56,060 --> 00:30:57,800 That was actually hanging out there for a really long time, 631 00:30:58,180 --> 00:30:59,260 and that's a really old version of Ruby, 632 00:30:59,400 --> 00:31:02,800 so it doesn't seem like there's been a lot of focus 633 00:31:04,060 --> 00:31:05,620 on keeping this stuff up to date. 634 00:31:05,780 --> 00:31:08,240 But admittedly, it's in a preview phase, 635 00:31:08,460 --> 00:31:09,720 and part of the reason for that 636 00:31:09,720 --> 00:31:11,540 is because they're trying to figure out how they can do this 637 00:31:11,540 --> 00:31:15,780 without making everything entirely insecure. 638 00:31:17,020 --> 00:31:17,420 And... 639 00:31:17,420 --> 00:31:21,420 I can't really see a way that that's going to happen. 640 00:31:22,720 --> 00:31:25,580 Right now, there is a framework 641 00:31:26,740 --> 00:31:30,440 for actually signing these modules, 642 00:31:30,780 --> 00:31:33,680 but they also accept calls from outside sources. 643 00:31:34,440 --> 00:31:36,820 So if you can get any kind of code execution in these modules, 644 00:31:36,900 --> 00:31:38,400 you can actually clobber the whitelist 645 00:31:38,400 --> 00:31:40,420 that says where you can load 646 00:31:41,820 --> 00:31:44,000 BrowserPlus plug-ins from, or correlates. 647 00:31:44,360 --> 00:31:46,420 And you can also change 648 00:31:46,420 --> 00:31:48,120 the verification procedures. 649 00:31:48,400 --> 00:31:50,040 All of these can clobber each other. 650 00:31:50,300 --> 00:31:53,280 There's no protections against any of them. 651 00:31:54,140 --> 00:31:54,660 So... 652 00:31:56,120 --> 00:31:58,360 Yeah, it's not that great of an idea. 653 00:31:58,740 --> 00:32:00,460 So it's... 654 00:32:01,260 --> 00:32:03,960 This might be able to be turned into something usable 655 00:32:04,800 --> 00:32:06,480 from a security perspective, 656 00:32:06,740 --> 00:32:09,180 but in general, as it stands right now, 657 00:32:09,960 --> 00:32:11,900 with no sandboxing at all, 658 00:32:12,020 --> 00:32:15,520 it would probably be a really easy way 659 00:32:15,520 --> 00:32:17,440 to install malware. 660 00:32:19,020 --> 00:32:21,680 So actually, probably my favorite of these frameworks 661 00:32:21,680 --> 00:32:25,180 are the ones that try and use a standards-based approach 662 00:32:25,180 --> 00:32:27,900 rather than trying to invent new APIs 663 00:32:27,900 --> 00:32:29,480 that aren't cross-platform 664 00:32:29,480 --> 00:32:31,400 and making people install them. 665 00:32:32,420 --> 00:32:35,560 Prism is actually pretty simple in concept. 666 00:32:35,960 --> 00:32:39,280 What it is is just a way to encapsulate a website 667 00:32:39,280 --> 00:32:42,580 into kind of a chromeless, stand-alone browser. 668 00:32:43,160 --> 00:32:45,020 And they set up their own little profiles, 669 00:32:45,020 --> 00:32:46,840 and they're locked to one site. 670 00:32:48,040 --> 00:32:50,040 If you click on links to another site, 671 00:32:50,100 --> 00:32:51,000 it'll actually open in a browser, 672 00:32:51,120 --> 00:32:53,160 just like if you're in an email application. 673 00:32:53,520 --> 00:32:54,960 It just passes it to the browser. 674 00:32:55,020 --> 00:32:56,320 It doesn't try and follow that stuff around, 675 00:32:56,540 --> 00:32:57,480 which is a good design. 676 00:32:59,040 --> 00:33:00,180 And there's no... 677 00:33:00,180 --> 00:33:02,180 You can't even override SSL certificate failures, 678 00:33:02,320 --> 00:33:05,060 which is also a pretty decent idea. 679 00:33:07,340 --> 00:33:08,860 They're really trivial to make. 680 00:33:08,940 --> 00:33:09,760 In their most basic form, 681 00:33:09,800 --> 00:33:12,540 all they need is an INI file that says where to go, 682 00:33:13,240 --> 00:33:14,760 some CSS layout stuff, 683 00:33:15,020 --> 00:33:16,020 some JavaScript rules, 684 00:33:16,580 --> 00:33:17,640 and things like that. 685 00:33:19,040 --> 00:33:21,880 There's a couple of Prism apps running together. 686 00:33:22,080 --> 00:33:22,720 You can see that they... 687 00:33:22,720 --> 00:33:25,020 You know, they'll sit around in the task bar, 688 00:33:25,200 --> 00:33:26,200 and you can... 689 00:33:26,820 --> 00:33:29,400 They don't have any location bars or anything like that. 690 00:33:29,560 --> 00:33:31,260 You can write something that looks like a full app, 691 00:33:31,340 --> 00:33:32,280 like Thunderbird or something, 692 00:33:32,860 --> 00:33:34,980 and it's not even necessarily apparent 693 00:33:34,980 --> 00:33:35,620 that it's a web app. 694 00:33:37,860 --> 00:33:40,040 The place where Prism falls down 695 00:33:40,040 --> 00:33:43,080 is that the actual JavaScript UI that you install 696 00:33:43,080 --> 00:33:44,920 has full XP, 697 00:33:45,020 --> 00:33:45,840 and it's got some PCOM scripting privileges. 698 00:33:47,060 --> 00:33:48,500 So this is the language 699 00:33:48,500 --> 00:33:50,140 that people write Firefox add-ons in. 700 00:33:51,080 --> 00:33:52,760 So anything that you can think of 701 00:33:52,760 --> 00:33:53,980 a Firefox add-in, 702 00:33:54,700 --> 00:33:55,820 you know, that it can do, 703 00:33:55,940 --> 00:33:58,220 you can basically do in one of these web app bundles, 704 00:33:58,340 --> 00:34:00,180 which is a little bit of overkill, 705 00:34:00,320 --> 00:34:02,460 since you don't really need to change a whole lot 706 00:34:03,000 --> 00:34:03,740 in these bundles. 707 00:34:04,180 --> 00:34:05,320 It's a pretty simple idea. 708 00:34:06,680 --> 00:34:08,540 So with Firefox add-ons, 709 00:34:08,540 --> 00:34:10,300 you have a simple way for people to... 710 00:34:11,020 --> 00:34:12,320 You know, there's a signing mechanism, 711 00:34:12,600 --> 00:34:13,820 there's an install prompt, there's a counter, 712 00:34:15,020 --> 00:34:16,620 there's a fairly good explanation to the users 713 00:34:16,620 --> 00:34:19,560 that, you know, this is not necessarily safe code. 714 00:34:21,180 --> 00:34:23,200 In Prism, what you get is just 715 00:34:23,200 --> 00:34:24,860 what looks like a bookmark dialog. 716 00:34:25,680 --> 00:34:28,020 And, you know, you check a couple of boxes 717 00:34:28,020 --> 00:34:30,060 if you want it to behave differently than the default, 718 00:34:30,200 --> 00:34:31,080 and you say where you want it to go. 719 00:34:32,620 --> 00:34:33,680 No warnings or anything. 720 00:34:35,140 --> 00:34:36,880 So it turns out that you can actually use 721 00:34:36,880 --> 00:34:39,080 this XP-COM scripting privilege to do things like... 722 00:34:39,540 --> 00:34:41,840 Right now, the people just host their web app bundles 723 00:34:41,840 --> 00:34:42,900 on a remote site, and they say, 724 00:34:42,980 --> 00:34:45,000 hey, I've made a bundle for such and such site, 725 00:34:45,020 --> 00:34:46,020 encapsulating that. 726 00:34:46,060 --> 00:34:46,820 Go ahead and install it. 727 00:34:47,540 --> 00:34:50,460 It turns out you can do things like have that, 728 00:34:50,600 --> 00:34:54,180 you know, if you had a webmail.com bundle, 729 00:34:54,320 --> 00:34:55,880 you can just do things like change 730 00:34:55,880 --> 00:34:57,320 people's proxy configuration settings 731 00:34:57,320 --> 00:34:58,660 to go through a server of your own, 732 00:35:00,320 --> 00:35:02,300 or relay content to other places. 733 00:35:02,880 --> 00:35:04,500 It's really a lot more functionality 734 00:35:04,500 --> 00:35:06,460 than anybody would really need to add here. 735 00:35:08,540 --> 00:35:11,160 So the idea of Prism is actually, 736 00:35:11,280 --> 00:35:12,540 I think, pretty sound. 737 00:35:12,940 --> 00:35:15,000 The XP-COM scripting privileges should really 738 00:35:15,020 --> 00:35:17,000 go away, especially since they're actually 739 00:35:17,000 --> 00:35:17,920 starting to push this. 740 00:35:18,060 --> 00:35:19,460 I think it's one of the featured add-ons 741 00:35:20,020 --> 00:35:22,000 for Firefox that, you know, 742 00:35:22,000 --> 00:35:23,320 they want people to install. 743 00:35:25,500 --> 00:35:29,300 Outside of the Prism framework, 744 00:35:29,580 --> 00:35:31,520 there's actually functionality in HTML5 745 00:35:31,520 --> 00:35:34,540 and new browsers like in WebKit and Firefox 746 00:35:35,240 --> 00:35:37,760 that allow you to do a lot of Rea-type stuff 747 00:35:38,800 --> 00:35:40,860 cross-platform without having to lock people 748 00:35:40,860 --> 00:35:42,560 into, you know, a proprietary solution. 749 00:35:43,380 --> 00:35:44,860 You may have heard of, 750 00:35:45,020 --> 00:35:47,600 of DOM storage, and this is a new, 751 00:35:47,940 --> 00:35:49,980 or parts of it are a new mechanism 752 00:35:50,520 --> 00:35:53,400 that were introduced in Firefox and WebKit. 753 00:35:53,620 --> 00:35:55,220 They give you a couple of different mechanisms 754 00:35:55,220 --> 00:35:56,160 to store data locally. 755 00:35:57,220 --> 00:36:00,280 They give you session storage and local storage. 756 00:36:00,420 --> 00:36:01,600 Session storage is just per session. 757 00:36:01,800 --> 00:36:04,100 Local storage is a big five-meg data store 758 00:36:04,100 --> 00:36:05,420 that you can use. 759 00:36:06,920 --> 00:36:09,760 You can have access to a local SQLite database now 760 00:36:10,540 --> 00:36:12,380 through the open database function. 761 00:36:13,340 --> 00:36:14,880 So you can create your own databases 762 00:36:15,020 --> 00:36:16,040 just like you were creating a cookie. 763 00:36:17,560 --> 00:36:19,220 And, you know, these are all protected 764 00:36:19,220 --> 00:36:20,080 by same-origin restrictions, 765 00:36:20,340 --> 00:36:23,160 but they have a couple of other interesting facets. 766 00:36:24,040 --> 00:36:25,820 So the reason why DOM storage is introduced, 767 00:36:26,120 --> 00:36:27,740 you can do local caching. 768 00:36:28,280 --> 00:36:30,120 You can do user tracking 769 00:36:30,520 --> 00:36:32,380 without having to ever prompt the user 770 00:36:32,380 --> 00:36:33,480 or let them know that you're doing it. 771 00:36:34,640 --> 00:36:37,600 You can, it gets around the things 772 00:36:37,600 --> 00:36:39,060 that web developers don't like about cookies, 773 00:36:39,140 --> 00:36:40,920 which is that people delete them or they refuse them 774 00:36:40,920 --> 00:36:41,980 and they have to write code to say, 775 00:36:42,100 --> 00:36:44,300 oh, this person turned cookies off, things like that. 776 00:36:45,020 --> 00:36:46,320 This gets around a lot of that. 777 00:36:46,580 --> 00:36:47,980 You have a really big data store 778 00:36:47,980 --> 00:36:52,160 and you can, you know, load whatever you want into it. 779 00:36:52,620 --> 00:36:55,360 And, like I say, it's an excellent tracking mechanism. 780 00:36:55,700 --> 00:36:57,720 The other thing is that now that SQL databases 781 00:36:57,720 --> 00:37:00,580 are running on a local system, 782 00:37:00,780 --> 00:37:02,120 you have the possibility where, 783 00:37:02,620 --> 00:37:05,960 normally SQL injection was a server-based, 784 00:37:06,100 --> 00:37:08,380 you know, this was you attacking a server, 785 00:37:08,440 --> 00:37:09,960 trying to get data off a remote database. 786 00:37:11,100 --> 00:37:14,000 And if you had, for instance, cross-site scripting flaws, 787 00:37:14,000 --> 00:37:15,540 you would use them to try and steal 788 00:37:15,540 --> 00:37:16,740 a user's authenticated session, 789 00:37:16,900 --> 00:37:18,000 log in and do stuff as them. 790 00:37:19,000 --> 00:37:21,340 Because you're now storing data locally, 791 00:37:21,560 --> 00:37:22,600 you actually have the case, 792 00:37:23,120 --> 00:37:25,220 you have the possibility for SQL injection 793 00:37:25,220 --> 00:37:26,420 if you can pass parameters in. 794 00:37:27,260 --> 00:37:28,880 Some frameworks let you parameterize 795 00:37:28,880 --> 00:37:30,640 and some just let you, you know, 796 00:37:30,640 --> 00:37:32,160 want you to write raw SQL. 797 00:37:34,200 --> 00:37:39,400 But there's also a neat scenario here, 798 00:37:39,540 --> 00:37:41,340 which is that if you go to a website 799 00:37:41,340 --> 00:37:42,700 that has cross-site scripting flaws 800 00:37:42,700 --> 00:37:45,500 and, you know, you go to your webmail site 801 00:37:45,500 --> 00:37:47,660 and you've got some data cached locally in your database, 802 00:37:47,900 --> 00:37:49,600 you can actually have pre-authentication 803 00:37:49,600 --> 00:37:50,760 cross-site scripting flaws 804 00:37:51,320 --> 00:37:54,460 that can steal this data and shuffle them off elsewhere. 805 00:37:54,880 --> 00:37:56,700 So you don't even have to actually wait 806 00:37:56,700 --> 00:37:57,860 for people to be logged in anymore 807 00:37:57,860 --> 00:38:02,000 to steal or destroy any of the data that they're storing, 808 00:38:02,620 --> 00:38:04,780 which makes, you know, cross-site scripting 809 00:38:04,780 --> 00:38:07,800 kind of an interesting attack. 810 00:38:09,760 --> 00:38:12,060 So there's a couple of things that are specific to Firefox 3 811 00:38:12,060 --> 00:38:13,020 that'll go through here real quick. 812 00:38:14,060 --> 00:38:16,880 Up until beta 2, they were still considering 813 00:38:16,880 --> 00:38:19,500 pushing cross-site XML HTTP requests 814 00:38:20,060 --> 00:38:22,240 with no real defining policy in there. 815 00:38:22,460 --> 00:38:24,860 Thankfully, it was pulled out before Firefox 3 shipped. 816 00:38:25,280 --> 00:38:27,860 But as near as I can tell, that's still an open issue. 817 00:38:28,340 --> 00:38:31,000 So if people have any pressure they can exert on Firefox 818 00:38:31,000 --> 00:38:32,960 to not do that, they should exercise it. 819 00:38:33,940 --> 00:38:36,760 It also has a global storage mechanism. 820 00:38:37,060 --> 00:38:39,080 And this kind of highlights part of the problem 821 00:38:39,080 --> 00:38:39,940 with some of these frameworks, 822 00:38:39,940 --> 00:38:41,500 which is that people are... 823 00:38:42,120 --> 00:38:43,900 You would think that a standards process 824 00:38:43,900 --> 00:38:46,220 would work where people would write a standard 825 00:38:46,220 --> 00:38:48,160 and review it 826 00:38:48,160 --> 00:38:49,760 and then go implement it in products. 827 00:38:50,000 --> 00:38:51,420 That's not how standards work at all. 828 00:38:51,780 --> 00:38:53,700 What happens is people write a draft standard 829 00:38:53,700 --> 00:38:55,540 that's kind of half done and has some ideas 830 00:38:55,540 --> 00:38:56,260 they've been kicking around, 831 00:38:57,260 --> 00:39:00,240 and the technology implementers, the browser vendors, 832 00:39:00,400 --> 00:39:02,240 have been looking at those and saying, 833 00:39:02,380 --> 00:39:04,060 wow, this particular feature is kind of neat. 834 00:39:04,140 --> 00:39:05,260 We're just going to implement it now. 835 00:39:06,200 --> 00:39:07,660 So that happened with global storage. 836 00:39:07,880 --> 00:39:09,920 It was then pulled from the HTML5 837 00:39:09,940 --> 00:39:11,980 spec because it wasn't a very good idea. 838 00:39:12,200 --> 00:39:15,140 It allows you to just use named data stores 839 00:39:15,140 --> 00:39:20,320 and with actually pretty small domain restrictions. 840 00:39:20,860 --> 00:39:22,680 Firefox 2s were particularly bad. 841 00:39:22,900 --> 00:39:25,080 And of course nobody knew that Firefox 2 had this mechanism. 842 00:39:25,460 --> 00:39:28,540 And there was no UI to actually let people know 843 00:39:28,540 --> 00:39:31,560 that this new storage and tracking mechanism 844 00:39:31,560 --> 00:39:32,180 had been inserted. 845 00:39:34,420 --> 00:39:36,380 Another strange thing with Firefox 3 846 00:39:36,380 --> 00:39:38,680 is that you have a whole ton of data 847 00:39:38,680 --> 00:39:39,520 that's not relational. 848 00:39:39,520 --> 00:39:40,820 In SQLite databases, 849 00:39:41,020 --> 00:39:45,120 that open up some other interesting attacks. 850 00:39:46,780 --> 00:39:48,440 There's actually, if people are interested, 851 00:39:48,640 --> 00:39:50,620 there's a lot of stuff that went into Firefox 3 852 00:39:50,620 --> 00:39:51,400 that's really interesting. 853 00:39:51,900 --> 00:39:55,240 If you go to a page called Firefox 3 for Developers, 854 00:39:55,600 --> 00:39:58,660 there are a whole host of new services 855 00:39:58,660 --> 00:40:02,940 that are, many of which can be their own research project. 856 00:40:04,140 --> 00:40:08,220 Support for the extended extensible style sheet language. 857 00:40:08,220 --> 00:40:12,280 I guess it didn't have enough extension mechanisms 858 00:40:12,280 --> 00:40:12,980 in it already, 859 00:40:13,140 --> 00:40:15,120 so they needed a more extended version. 860 00:40:16,220 --> 00:40:21,040 There's the NSIdleService XPCOM method, 861 00:40:21,140 --> 00:40:23,640 which allows for tracking how long users 862 00:40:23,640 --> 00:40:24,420 have been at their computer 863 00:40:24,420 --> 00:40:26,440 and if they're going away, things like that. 864 00:40:27,440 --> 00:40:32,620 There's also one of the probably not best ideas 865 00:40:32,620 --> 00:40:34,960 that went into Firefox 3 is that, 866 00:40:35,100 --> 00:40:36,920 well, it's actually, it's not a bad idea. 867 00:40:36,920 --> 00:40:40,380 What happens is now you can use other websites 868 00:40:40,380 --> 00:40:41,440 as protocol handlers. 869 00:40:41,620 --> 00:40:45,400 If your favorite site for sending email 870 00:40:45,400 --> 00:40:48,080 or your email program of choice effectively is Gmail, 871 00:40:48,880 --> 00:40:52,180 you can go ahead and tell the browser 872 00:40:52,180 --> 00:40:54,960 that I would like to use Gmail to handle this 873 00:40:54,960 --> 00:40:56,380 instead of spawning Thunderbird or Outlook. 874 00:40:58,300 --> 00:41:01,320 But the protocol handlers are another place 875 00:41:01,320 --> 00:41:03,200 where verification is really weak. 876 00:41:03,400 --> 00:41:05,940 This is just a very small snippet of code here 877 00:41:05,940 --> 00:41:08,780 that asks for a user to say, 878 00:41:08,960 --> 00:41:11,400 to use their site as a protocol handler. 879 00:41:12,820 --> 00:41:15,420 So since transmission of mail is something 880 00:41:15,420 --> 00:41:18,300 that's good for an attacker to take a look at 881 00:41:18,300 --> 00:41:21,000 for snooping on users, 882 00:41:21,160 --> 00:41:25,700 you can actually just put in your site by IP address. 883 00:41:26,440 --> 00:41:29,720 The only actual restriction on installing protocol handlers 884 00:41:29,720 --> 00:41:31,640 is that the malicious site 885 00:41:31,640 --> 00:41:34,700 and the site that the protocol handler refers to 886 00:41:34,700 --> 00:41:35,460 has to be the same. 887 00:41:35,940 --> 00:41:38,380 Which isn't actually a restriction at all. 888 00:41:39,580 --> 00:41:41,360 So here's what it actually looks like 889 00:41:41,360 --> 00:41:44,740 if you try and use a third party protocol handler 890 00:41:45,300 --> 00:41:46,140 in Firefox. 891 00:41:46,480 --> 00:41:47,680 You can see there's a, 892 00:41:47,840 --> 00:41:49,880 do you want to allow Yahoo mail 893 00:41:49,880 --> 00:41:52,000 something that you don't understand 894 00:41:52,000 --> 00:41:54,680 and then as an application for mail to links. 895 00:41:54,880 --> 00:41:56,560 And your options are add application 896 00:41:56,560 --> 00:41:58,440 or you can kind of close the dialogue. 897 00:41:58,580 --> 00:42:00,120 But mostly just add the application if you would. 898 00:42:01,540 --> 00:42:03,880 And this, the funny thing here is that 899 00:42:03,880 --> 00:42:05,920 when you actually add a protocol handler 900 00:42:06,500 --> 00:42:07,440 it'll do things, 901 00:42:08,020 --> 00:42:09,900 Firefox already actually knows about Yahoo mail 902 00:42:09,900 --> 00:42:11,340 and it knows where to send stuff for that. 903 00:42:11,500 --> 00:42:12,900 And that's the second option here. 904 00:42:13,440 --> 00:42:15,980 But the actual malicious snippet up there, 905 00:42:16,460 --> 00:42:18,460 what it does is it actually goes through, 906 00:42:18,720 --> 00:42:20,720 it follows the link, finds the fav icon 907 00:42:20,720 --> 00:42:22,640 and decides to use that as the icon 908 00:42:22,640 --> 00:42:24,060 for your new protocol handler. 909 00:42:24,480 --> 00:42:26,620 Not only that but in Windows XP 910 00:42:26,620 --> 00:42:28,200 it makes it so it's gray on gray. 911 00:42:28,420 --> 00:42:29,260 So you can't actually, 912 00:42:29,380 --> 00:42:30,520 there's an IP address under there. 913 00:42:31,000 --> 00:42:32,420 But you can't tell what it is. 914 00:42:32,800 --> 00:42:35,160 So what you actually have happen is, 915 00:42:35,940 --> 00:42:39,940 you have this more real than the real thing 916 00:42:39,940 --> 00:42:42,880 protocol handler that would make people 917 00:42:42,880 --> 00:42:45,340 accept, you know, choose a malicious one 918 00:42:45,340 --> 00:42:46,200 over the real one. 919 00:42:47,460 --> 00:42:50,520 Like hyper real or a simulacra or something. 920 00:42:53,240 --> 00:42:55,860 So I'm gonna go pretty quick through WebKit. 921 00:42:56,200 --> 00:42:58,540 But suffice it to say that WebKit is actually, 922 00:42:58,680 --> 00:43:00,800 they were pretty early adopter of some of these 923 00:43:00,800 --> 00:43:02,020 local storage mechanisms. 924 00:43:02,420 --> 00:43:04,860 They've had SQL database support for a while. 925 00:43:04,860 --> 00:43:06,940 And it's in a lot of stuff. 926 00:43:07,880 --> 00:43:08,520 It's actually, 927 00:43:08,660 --> 00:43:10,920 Nokia is the second biggest user of WebKit 928 00:43:12,040 --> 00:43:14,660 after Apple because it's based in, 929 00:43:14,720 --> 00:43:15,940 it's what's used on the iPhone, 930 00:43:16,100 --> 00:43:17,320 it's what's used on Safari. 931 00:43:17,700 --> 00:43:20,100 A lot of people probably don't know that you can do things 932 00:43:20,100 --> 00:43:22,400 like use local SQL databases for storage there. 933 00:43:22,920 --> 00:43:24,040 But it's also in OpenMoco 934 00:43:24,040 --> 00:43:26,540 and it's what's, you know, 935 00:43:26,540 --> 00:43:28,140 what Air uses for its rendering engine. 936 00:43:31,040 --> 00:43:33,360 So part of the problem with these storage mechanisms, 937 00:43:33,440 --> 00:43:34,840 other than the fact that you can do transactions 938 00:43:34,860 --> 00:43:35,320 and tracking with them, 939 00:43:35,400 --> 00:43:37,800 is that they're all basically capped at five megs 940 00:43:37,800 --> 00:43:39,620 and they're all per origin. 941 00:43:40,080 --> 00:43:43,560 You know, the origin being the classical thing. 942 00:43:43,660 --> 00:43:46,440 If you have 10,000 domain names, 943 00:43:46,500 --> 00:43:47,480 you've got 10,000 origins. 944 00:43:47,720 --> 00:43:48,640 And they don't, 945 00:43:48,640 --> 00:43:51,280 you can just have them be subdomains of a main site. 946 00:43:51,540 --> 00:43:53,300 So you have 15 megs per origin. 947 00:43:53,800 --> 00:43:56,500 And anybody that's actually got wildcard DNS 948 00:43:56,500 --> 00:43:57,700 or a whole bunch of names 949 00:43:57,700 --> 00:43:59,160 or is on an internal network 950 00:43:59,160 --> 00:44:02,100 can actually fill up your hard drive 951 00:44:03,360 --> 00:44:04,400 pretty quickly. 952 00:44:04,400 --> 00:44:05,760 In a matter of, 953 00:44:05,760 --> 00:44:07,400 depending on your hard drive capacity, 954 00:44:07,860 --> 00:44:13,440 it could be five minutes to, say, ten minutes. 955 00:44:14,340 --> 00:44:16,260 But you can actually make this stuff 956 00:44:16,260 --> 00:44:17,580 grow out of control really quickly. 957 00:44:17,760 --> 00:44:19,300 That's actually really important 958 00:44:19,300 --> 00:44:20,440 if you've got a mobile device. 959 00:44:21,020 --> 00:44:22,860 Because if you've only got, say, 960 00:44:22,940 --> 00:44:23,840 eight gigs of storage 961 00:44:23,840 --> 00:44:25,060 and you can take it all out 962 00:44:25,060 --> 00:44:26,620 and you're pooling your storage 963 00:44:26,620 --> 00:44:29,880 with your actual RAM, 964 00:44:30,580 --> 00:44:34,380 you can kind of not brick permanent storage. 965 00:44:34,380 --> 00:44:37,840 But you can make these devices pretty much unusable. 966 00:44:38,320 --> 00:44:40,400 And there's no way to actually disable these mechanisms 967 00:44:40,400 --> 00:44:41,700 that's easily available. 968 00:44:44,540 --> 00:44:45,940 So there's some sample code. 969 00:44:46,080 --> 00:44:47,560 You can pick up the slides afterwards 970 00:44:48,180 --> 00:44:50,420 that kind of show how you do this kind of stuff. 971 00:44:50,700 --> 00:44:53,500 One other little quirk about this kind of stuff 972 00:44:53,500 --> 00:44:56,780 is that you can actually insert 973 00:44:56,780 --> 00:44:58,900 a bunch of Base64-encoded data 974 00:44:59,920 --> 00:45:02,440 that forensics programs will try and pick up. 975 00:45:02,740 --> 00:45:04,360 So you can use this stuff. 976 00:45:04,360 --> 00:45:06,780 This is to shove tons of arbitrary content, 977 00:45:07,800 --> 00:45:09,180 inappropriate images or things 978 00:45:09,180 --> 00:45:10,860 that people aren't supposed to be in possession of, 979 00:45:11,300 --> 00:45:13,000 and litter the user's hard drive with 980 00:45:13,000 --> 00:45:14,640 while you're doing your little DOS attack. 981 00:45:16,580 --> 00:45:19,160 And this also works quite well in practice. 982 00:45:20,420 --> 00:45:22,220 HTML5 is a weird beast. 983 00:45:22,340 --> 00:45:24,100 I encourage everybody to read the specification. 984 00:45:26,440 --> 00:45:28,820 Security so far has not been part of the standards process. 985 00:45:29,420 --> 00:45:30,840 The only thing that's actually in it 986 00:45:30,840 --> 00:45:32,800 is that there's a note that it needs to be written someday. 987 00:45:32,800 --> 00:45:38,400 But the spec is pretty much approaching completion 988 00:45:38,400 --> 00:45:39,300 as near as I can tell. 989 00:45:39,580 --> 00:45:41,840 And it's something that should probably go in 990 00:45:41,840 --> 00:45:43,980 a little bit earlier than the very end. 991 00:45:46,020 --> 00:45:47,600 So I'm going to turn it over to Alex 992 00:45:47,600 --> 00:45:50,160 to kind of talk about some of the more interesting 993 00:45:52,060 --> 00:45:54,640 ways that you can use these RIA frameworks 994 00:45:54,640 --> 00:45:58,280 to attack users and what you can do about them. 995 00:45:59,680 --> 00:46:00,080 Thanks. 996 00:46:00,480 --> 00:46:01,840 Okay, so to wrap it up, 997 00:46:01,860 --> 00:46:02,780 let's go through some of the things 998 00:46:02,800 --> 00:46:04,180 that the new kind of attacks that we're facing 999 00:46:04,180 --> 00:46:06,480 in the RIA Web 3.0 world. 1000 00:46:06,600 --> 00:46:08,760 Sorry I said that, but to throw it out there. 1001 00:46:09,020 --> 00:46:09,800 Some of the new things. 1002 00:46:09,900 --> 00:46:12,580 So attacks of re-applications against the operating system. 1003 00:46:13,100 --> 00:46:16,040 We have now local storage, which, as David pointed out, 1004 00:46:16,100 --> 00:46:17,500 there's a lot of privacy and tracking concerns 1005 00:46:17,500 --> 00:46:19,580 because either UIs don't exist 1006 00:46:19,580 --> 00:46:21,740 or the UIs for wiping out or turning this stuff off 1007 00:46:21,740 --> 00:46:24,140 are not integrated with UIs for cookies. 1008 00:46:24,320 --> 00:46:27,260 So just about when people started figuring out 1009 00:46:27,260 --> 00:46:28,960 how to turn off cookies or clear them appropriately, 1010 00:46:29,880 --> 00:46:31,820 we now have new local storage mechanisms 1011 00:46:31,820 --> 00:46:32,820 that they don't understand. 1012 00:46:33,120 --> 00:46:34,400 We've started to see this with people, 1013 00:46:34,520 --> 00:46:36,720 banks using Flash cookies and Flash 1014 00:46:36,720 --> 00:46:38,800 as local storage mechanisms to track their customers, 1015 00:46:39,020 --> 00:46:42,680 and they call that, you know, dual authentication. 1016 00:46:43,940 --> 00:46:46,080 You know, we also have a denial of service risk, 1017 00:46:46,560 --> 00:46:49,300 like he said, by using multiple domains to... 1018 00:46:49,770 --> 00:46:52,240 5 megabytes times infinity is still infinity, right? 1019 00:46:52,340 --> 00:46:54,980 So having a limit that then can be used over and over again 1020 00:46:54,980 --> 00:46:56,080 gives you a denial of service mechanism. 1021 00:46:57,280 --> 00:46:58,420 From a malware perspective, 1022 00:46:58,700 --> 00:47:00,480 probably Adobe Air is the most concerning here, 1023 00:47:00,480 --> 00:47:03,160 just because it does have, as designed, 1024 00:47:03,260 --> 00:47:04,300 full privileges locally, 1025 00:47:05,620 --> 00:47:07,200 although all of these frameworks 1026 00:47:07,200 --> 00:47:09,780 are adding new huge attack surfaces, right? 1027 00:47:09,840 --> 00:47:11,840 The fact that an entire SQL database 1028 00:47:11,840 --> 00:47:12,980 is embedded in your browser 1029 00:47:12,980 --> 00:47:16,600 and callable by malicious JavaScript is huge, right? 1030 00:47:16,680 --> 00:47:18,420 Because now you have every kind of command 1031 00:47:18,420 --> 00:47:21,400 that you can do in SQLite you can execute locally, 1032 00:47:21,580 --> 00:47:22,980 and if SQLite has an overflow, 1033 00:47:23,180 --> 00:47:25,520 now you have a very rich, broad attack surface, 1034 00:47:25,660 --> 00:47:28,560 and anybody who's ever read the errata 1035 00:47:28,560 --> 00:47:30,420 on a single Oracle patch will understand 1036 00:47:30,480 --> 00:47:32,080 how difficult it is to write something 1037 00:47:32,080 --> 00:47:34,660 like a SQL interpreter that is secure. 1038 00:47:35,380 --> 00:47:37,060 In the err situation, 1039 00:47:37,940 --> 00:47:40,060 you're talking about people, you know, 1040 00:47:40,060 --> 00:47:41,420 using the install box 1041 00:47:41,420 --> 00:47:43,280 and trying to trick people into installing it, 1042 00:47:43,300 --> 00:47:44,220 having a malware issue. 1043 00:47:45,160 --> 00:47:46,780 From a web perspective, 1044 00:47:47,660 --> 00:47:49,220 we now have a very interesting issue 1045 00:47:49,220 --> 00:47:50,880 where cross-site scripting pre-login 1046 00:47:50,880 --> 00:47:52,320 becomes much more powerful, right? 1047 00:47:52,640 --> 00:47:54,380 Cross-site scripting against a webmail app 1048 00:47:54,380 --> 00:47:56,800 used to only be useful if the person had an active cookie, 1049 00:47:56,940 --> 00:47:58,580 which for a lot of times they would, right? 1050 00:47:58,580 --> 00:48:01,220 Or you'd have to do a trick. 1051 00:48:01,320 --> 00:48:02,780 You'd have to trick the person into logging in 1052 00:48:02,780 --> 00:48:04,940 and then have the cross-site scripting execute afterwards. 1053 00:48:05,620 --> 00:48:06,840 Now with local data storage, 1054 00:48:07,100 --> 00:48:09,260 if I can do a referred cross-site scripting, 1055 00:48:09,280 --> 00:48:10,980 I can do it in an invisible iframe. 1056 00:48:11,100 --> 00:48:12,840 They don't have to log in or have a local cookie. 1057 00:48:13,020 --> 00:48:15,400 It can just run and pull all of your cached email 1058 00:48:15,400 --> 00:48:17,880 out of the local data storage and send it, right? 1059 00:48:17,960 --> 00:48:20,100 So pre-authentication cross-site scripting 1060 00:48:20,100 --> 00:48:22,200 with the local domain storage and local SQL storage 1061 00:48:22,200 --> 00:48:25,700 in Gears and HTML5 is very frightening 1062 00:48:25,700 --> 00:48:28,180 and adds a lot more power to cross-site scripting attacks 1063 00:48:28,180 --> 00:48:29,280 that were kind of useless before. 1064 00:48:30,500 --> 00:48:32,460 We now have SQL injection in JavaScript. 1065 00:48:32,780 --> 00:48:35,840 Your web app, not the database behind it, 1066 00:48:35,980 --> 00:48:39,580 but the JavaScript that runs to make your web 2.0 app run 1067 00:48:39,580 --> 00:48:41,000 can have a SQL injection vulnerability. 1068 00:48:42,040 --> 00:48:43,740 And that's not a good thing, right? 1069 00:48:43,800 --> 00:48:46,200 Because the people that write the JavaScript and write the HTML 1070 00:48:46,200 --> 00:48:48,320 are not the same people that write the web app, 1071 00:48:48,480 --> 00:48:51,180 the JDBC calls and the ODBC calls, 1072 00:48:51,280 --> 00:48:53,260 the people that understand what SQL injection is in the past. 1073 00:48:53,520 --> 00:48:55,260 So we're talking about a whole new group 1074 00:48:55,260 --> 00:48:57,360 of generally graphic design kind of people 1075 00:48:57,360 --> 00:48:59,500 that sit at ritual roasters in San Francisco 1076 00:48:59,500 --> 00:49:01,180 with their MacBook Airs and their thick glasses 1077 00:49:01,540 --> 00:49:02,940 and their lots of piercings 1078 00:49:02,940 --> 00:49:04,420 that those kinds of people now 1079 00:49:04,420 --> 00:49:06,040 are going to have to worry about SQL injection 1080 00:49:06,040 --> 00:49:07,220 and they've never had to do it before. 1081 00:49:09,120 --> 00:49:10,980 CSRF is something interesting from RIA apps. 1082 00:49:11,060 --> 00:49:12,020 We can't really cover that too much. 1083 00:49:13,280 --> 00:49:15,600 In the case of Prism, we have sandbox apps 1084 00:49:15,600 --> 00:49:16,400 that can affect each other 1085 00:49:16,400 --> 00:49:17,900 and do all of the nasty XPCOM stuff. 1086 00:49:18,340 --> 00:49:20,040 In the case of BrowserPlus, you have modules 1087 00:49:20,040 --> 00:49:22,120 that are running with full executable locally. 1088 00:49:22,400 --> 00:49:24,300 And as David said, things like ImageMagick, 1089 00:49:24,360 --> 00:49:26,120 which has all of these algorithms 1090 00:49:26,120 --> 00:49:27,080 that are extremely dangerous 1091 00:49:27,080 --> 00:49:28,680 and have had buffer flows in the past. 1092 00:49:29,520 --> 00:49:31,640 We can also chain these frameworks together. 1093 00:49:31,800 --> 00:49:34,080 You can launch an error application 1094 00:49:34,080 --> 00:49:35,880 from inside a Prism app, for example. 1095 00:49:36,240 --> 00:49:37,920 And so there is some concern there. 1096 00:49:38,680 --> 00:49:39,760 So some checklists. 1097 00:49:39,800 --> 00:49:41,100 If you're a RIA developer, 1098 00:49:41,400 --> 00:49:44,200 your data stores for local SQL or structured data 1099 00:49:44,200 --> 00:49:46,480 use non-predictable GUIDs. 1100 00:49:46,500 --> 00:49:48,360 Use parameterized SQL if you can, 1101 00:49:48,400 --> 00:49:49,400 although that's not always possible. 1102 00:49:49,860 --> 00:49:51,160 Lock your apps to your domain. 1103 00:49:52,300 --> 00:49:53,260 Some other stuff. 1104 00:49:53,460 --> 00:49:55,380 You guys are bad guys, so we'll skip ahead. 1105 00:49:56,600 --> 00:49:58,200 If you're a security professional, 1106 00:49:58,520 --> 00:49:59,920 our recommendations are 1107 00:50:00,960 --> 00:50:02,260 looking at the attack surface, 1108 00:50:02,400 --> 00:50:04,180 such as the IL parser to the new virtual machines, 1109 00:50:04,340 --> 00:50:05,300 embedded HTML rendering. 1110 00:50:06,580 --> 00:50:07,660 If you're a corporate admin, 1111 00:50:07,820 --> 00:50:10,080 don't let your users install RIA frameworks. 1112 00:50:10,300 --> 00:50:12,220 You can use something like Group Policy Objects 1113 00:50:12,220 --> 00:50:14,020 to do this in IE. 1114 00:50:14,120 --> 00:50:15,400 Not sure how you do it in Firefox. 1115 00:50:17,420 --> 00:50:18,820 If you're a normal person, 1116 00:50:18,940 --> 00:50:19,880 don't install a RIA framework 1117 00:50:19,880 --> 00:50:21,540 unless you actually need it. 1118 00:50:22,060 --> 00:50:23,560 Read the install boxes carefully 1119 00:50:24,090 --> 00:50:25,220 and get ready for the apocalypse. 1120 00:50:26,120 --> 00:50:27,220 If you're a penetration tester, 1121 00:50:27,720 --> 00:50:30,280 look for dangerous parameters 1122 00:50:30,280 --> 00:50:31,900 passed into something like an error application 1123 00:50:31,900 --> 00:50:33,380 on instantiation. 1124 00:50:33,840 --> 00:50:36,140 Make sure people are using parameterized SQL statements. 1125 00:50:37,020 --> 00:50:38,220 Make sure that data stores, 1126 00:50:38,640 --> 00:50:39,440 if possible, 1127 00:50:39,640 --> 00:50:41,500 are using GUIDs for naming conventions, 1128 00:50:41,640 --> 00:50:43,680 so cross-site scripting attacks might not be able to find them. 1129 00:50:44,260 --> 00:50:45,880 Look for limits on storage mechanisms. 1130 00:50:46,620 --> 00:50:48,220 Make sure people are using SSL 1131 00:50:48,220 --> 00:50:49,760 with these mechanisms because they're so dangerous. 1132 00:50:49,880 --> 00:50:52,020 If you pull down executable code that can use them 1133 00:50:52,020 --> 00:50:52,760 over HTTP, 1134 00:50:52,760 --> 00:50:55,160 you now have a much bigger issue 1135 00:50:55,160 --> 00:50:56,160 than people like stealing cookies. 1136 00:50:57,200 --> 00:50:58,000 In conclusion, 1137 00:50:58,520 --> 00:51:00,540 these RIA frameworks are very widely different 1138 00:51:00,540 --> 00:51:02,480 in what they can do in their security models. 1139 00:51:03,100 --> 00:51:04,500 It is extremely likely that 1140 00:51:04,500 --> 00:51:05,480 using these RIA frameworks, 1141 00:51:05,600 --> 00:51:07,360 that web developers are going to introduce 1142 00:51:07,360 --> 00:51:09,060 all kinds of new, very interesting flaws 1143 00:51:09,880 --> 00:51:11,760 in web applications as well as things 1144 00:51:11,760 --> 00:51:12,960 that are supposed to be desktop applications. 1145 00:51:13,420 --> 00:51:15,560 The web is becoming less standardized, 1146 00:51:15,780 --> 00:51:16,460 which is the whole point. 1147 00:51:16,620 --> 00:51:18,120 This is all about corporate control 1148 00:51:18,120 --> 00:51:20,480 of which of these companies is going to control the API 1149 00:51:22,760 --> 00:51:24,480 so breaking standardization is what you have to do 1150 00:51:24,480 --> 00:51:25,500 if you want to monopolize the browser. 1151 00:51:26,000 --> 00:51:28,560 From that perspective, it's making security a little harder. 1152 00:51:28,880 --> 00:51:30,160 It's making things a lot more dangerous. 1153 00:51:31,020 --> 00:51:32,460 I don't think we have time for Q&A 1154 00:51:32,460 --> 00:51:33,440 because I'm getting some kind of 1155 00:51:33,440 --> 00:51:35,060 you're going to die, cut, cut, cut sign. 1156 00:51:35,720 --> 00:51:37,440 We'll step off the stage if you want to ask questions 1157 00:51:37,440 --> 00:51:38,740 and we'll also be in room 115 1158 00:51:40,060 --> 00:51:42,040 for a breakout session if you have questions or comments. 1159 00:51:42,300 --> 00:51:43,060 Thank you for coming.