Thank you all for coming. I am David Thiel. This is Alex Stamos and Justine Osborne. We're consultants with iSEC Partners and are here to talk a little bit about some new web application frameworks that move web applications a lot more onto the desktop and give them a lot more power than you're used to. So there are a bunch of different vendors and frameworks that we have to get through in a limited amount of time, so I'm going to go pretty quick through the introduction here. But ARIA is a term that was invented to describe applications that behave a little bit more like desktop apps than a regular web application. They are all fairly different, but there are some things that they have in common. They tend to make heavy use of AJAX-type calls, so asynchronous updates to pages. They introduce a lot of new local storage. They introduce a lot of new storage mechanisms, including DOM storage, and we'll talk about later some SQL databases. They tend to lean towards having an offline mode, so that you can sync up your web mail or something like that and go onto a plane and still continue to use a web application or one of these apps to continue to work just like it were a desktop app. Some of them break out of the browser entirely. Some of them utilize existing browsers. And others are basically like installing a new little mini web browser on your machine. They also have increased privilege in general over what a normal web application has. They're able to store data locally. They can open their own sockets. They can read and write to files. It's essentially a way to turn web apps into full-fledged desktop apps. So, basically, everybody started with desktop applications. They moved all of their applications into web browsers and decided it wasn't a very good idea. And I guess, so now we move them back onto the desktop, and this is progress. So, the reasons why you would want to use one of these applications, it's becoming more sexy than regular web 2.0 stuff. It also, it does give you a little bit of a benefit in terms of responsiveness. You can have large local data stores locally and cache them and use those. We talked about desktop integration. You can also write these entirely in HTML, JavaScript, Flash, things that web application developers are all familiar with. You don't really have to write a lot of new code, and it's all pretty easy. 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. And if they have good ideas, then we can get cooler applications. But it's, you know, it's a good thing. You know, potentially not that great of a thing because there's a fairly low barrier to entry. And there are, you know, the amount of privilege that these applications have is increased a fair bit over your traditional web browser app. So, these are the ones we're going to look at. 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. And Alex will start off with Adobe Air. Thanks, Dave. 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. Just as a quick comparison of the full, how full-fledged the feature set is for each of these different frameworks. As you can see, everything's checked here because Adobe Air can do just about anything. Adobe Air is, while it's called a rich internet application framework, sometimes by default. But Adobe and often in the press, it really is more of a, it actually totally is a full-featured desktop runtime, right? 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. It's cross-browser and cross-platform. Right now, they've released it for OS X and Windows. But Pellis, do you want to wave to everybody? Pellis or Lee from Adobe will take your request for your favorite open-source operating system and, you know, prioritize it. They'll get right on the NetBSD development real soon. You can make these applications in multiple different environments. 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. But you can also make these applications with free tools, just writing text, HTML, and JavaScript and using a compiler. That's great. So, this is a great tool that you can get for free from Adobe. In that case, the basic system here, the basic unit here is the Flash Swift that runs within the Flash virtual machine. 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. 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. This is much more intended to be more powerful than a general re-application. There's no sandbox. Apps run with the full power of the user. So, because this is a desktop application, shouldn't we just write it off as if it's malicious, that's fine. If it's not, that's fine. It's all up to the user. Not really, right? It's not just like a normal, say, Win32 program on a desktop. The power of AIR is the I in RIA. It's the internet connectivity part. It is very, RIA, AIR apps are very easy to launch. It's an optional thing for the developer. But they're easy to make it so that AIR applications can be launched by web browsers, by sites. And I think that's the way they're normally going to be used. So that if you go to, say, eBay, eBay has their own AIR application. One day, eBay is probably going to turn it on. 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. So they can be invoked by browsers. They have a lot of native mechanisms for loading external content. 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. You have to play a movie, right? That's one line of code or two lines of code in ActionScript and Adobe AIR. So it's very easy for developers to bring down content from untrusted places and run it locally within this desktop application. And it's highly likely that's going to happen, right? It would be really stupid to go just write a full desktop app that has no internet connectivity with AIR. It's not the thing that you write the next competitor to office in. It's a thing that you write that has tight internet integration and lots of media capability. So really, it's probably better to think of Adobe AIR like ActiveX or fulltrust.net applications. The code runs as full privileges. And there is some code prevention and sandboxing techniques there. But like ActiveX, once it's installed, it can do anything the heck it wants. Fortunately, Adobe seems to have learned a couple things from ActiveX, and we'll talk about that. So AIR applications are identified by two things. There's an app ID and a publisher ID. The publisher ID is a big, long, entropic-looking string that is calculated by the person's information that they add into a certificate, and then the public key of a certificate that is generated for each developer. The app ID is just a string that is decided by that developer. AIR applications can't be launched directly. You can't just use an object tag or call them from JavaScript like an ActiveX control. You have to launch them from inside of a flash file itself. So to launch an AIR application, you load up a flash file. Just like an app. Just a normal, jailed Swift. And then within that flash file, they pull down AIR.swift, which is Adobe's recommended way of doing it, which is a flash file that now adds more functionality to your local Flash 9 instance. Unfortunately, there's no secure way of doing this. You can't do HTTPS here because this turns out to be ACOM-ized. If you want to do it securely, you should copy AIR.swift to your local site and then change this URL to do HTTPS to your local site. Once those classes are now defined, within your execution environment, your Flash execution environment, you can then check to see if an application is installed and get its version. This means once you have AIR apps installed, any site you go to can find out what AIR apps you have installed, which is fine for some AIR apps. If you have the My Little Pony MM org written in Adobe AIR, perhaps that's the kind of thing that you don't want to expose. There's no way that you can prevent malicious Flash applets from finding out what AIR apps you have installed and exactly what version. And once we know, hey, it's installed, it's pretty simple to just launch it, calling a new function called launch application, giving it the app ID, the pub ID, and then arguments. That's an array of arguments of objects that get passed to it. So this can be passed from a non-trusted Flash Swift into a trusted Adobe AIR application. By default, the code that runs in an AIR application runs with full writes. They've added a bunch of classes to JavaScript or ActionScript, depending on what you're using to write your AIR application in, to do a bunch of dangerous stuff like talk to files locally and install in program files, and you can write stuff over Windows system 32 and such. With the existing capabilities in AIR 1.1, it is possible to make a local system run native code into backdoor and operating system. There are rumors on blogs that talk about it that Adobe will eventually add more things like shell execute and stuff. There's no actual security downside there. You already have full control. It'll just make it maybe a little bit easier for people. You don't actually have a code access security model like .NET or Java where you have method permitting, method or class-by-class control over what an application can call. Instead, they've created five predefined sandboxes. The application sandbox is the default sandbox that your application boots up in. You can do anything you want. There's the remote sandbox, which is if you pull stuff down from the Internet, like a Swift from the Internet, or you open up an iframe to an HTML page on the Internet, then that's going to, by default, run in the remote sandbox. And there's three others that if we had multiple hours, we could talk about, but you guys probably don't care about. Kind of intermediate ones. When you load that external data, it automatically goes into the remote sandbox. An important part of their security model is that stuff that runs in the application sandbox, the local code that's doing all the dangerous stuff, should not be able to do just-in-time execution. It shouldn't be able to pull code down and then install it. Flash used to have the ability that you could take a byte string and create a Flash class out of it and call it. You can't do that. You can't run the JavaScript eval command, for example. You can't have a script tag that does a cross-domain source. So they've worked really hard to find all the things that will allow you to get commands from the Internet and not allow them in the application sandbox. On the other side, there's the remote sandbox. The remote sandbox can't do dangerous stuff, but it can do things like evals and pull down SWIFTs from remote that run locally and pull down JavaScript remotely and can do cross-domain XMLHP requests, depending on some things. This is probably a sufficient place for most developers to write their code. Unfortunately, though, they're going to be running the application sandbox by default. So these are some reasonable security protections that Adobe has probably worked very hard to put in. Obviously, because they're reasonable security protections, web developers are going to work really hard to circumvent them, which is the history of how this kind of stuff works. So one thing they could do is look for mistakes Adobe made in the classification of methods that are dangerous or not dangerous. That's, you know, not easy. We've looked a little bit. It seems like they've done a reasonable job of classifying the stuff that can't run the application sandbox, that's dynamic code, and classifying the dangerous stuff that can't run the remote sandbox. But better yet, they provide a mechanism that allows you to move information back and forth between these sandboxes. It's called the sandbox bridge. Basically, the way it works is, say I have an application that runs in the application sandbox. It can do anything the heck it wants. And it wants to load up an iframe. And in that iframe is going to be untrusted code from the Internet. But it has to expose some kind of functionality to that untrusted code. You create an object, like here we call the high-right stuff object. We give it a method called write to file. And we put a bunch of dangerous stuff in there. And it takes a couple of arguments. And then we attach that object to what's called the parent sandbox bridge, which already exists. And then once we've attached it to the parent sandbox bridge, we call and we say here's an iframe, pull down some dangerous stuff. And then the code in the iframe, say JavaScript, can say, okay, parent sandbox bridge, thank you for giving me that function, that dangerous function, I'm going to use it. It's kind of like setting a set UID bit on a method. If this is a variable, it's passed by copying. It's not passed by reference. But obviously it has to be some kind of passing by reference if it's a function like this, because it does run with the permissions of the parent. So in this example, this was a very bad move, right? In this case, the developer created a function that can take an arbitrary file name and arbitrary content and then write it to the hard drive. It exposed it to the untrusted code running in an iframe. And so in this case, they have, with only a couple of lines of code, the web developer or the air developer, they're not web developers anymore, right? Now they're empowered to be desktop developers. So the desktop developer that doesn't know how to use anything but HTML and JavaScript has gone and ruined the entire Adobe sandbox model. Adobe has to provide some kind of way for doing the communication, but it looks like it is going to be pretty easy for people to shoot themselves in the foot. Air requires Flash 9. Air itself is an add-on to Flash that the first time you load an Air app, Adobe provides a sample code called, I think, badge.swift that will automatically have the Air methods loaded up, and it gives you this little pop-up. Do you want to install Adobe Air? No real security warnings or anything. This actually isn't, like, too dangerous a thing. It comes down as a signed binary and installs. Once the Air runtime is installed in Flash, Air applications can be installed. They can be bundled as .air files, which are binaries that contain a bunch of swifts and an XML file and stuff like that, zip files. They can also be installed from a web page. If you have a swift, it can call the install application function. That pops a little thing that says, do you want to open this file or save it? After that, you get a prompt like this. Every single Air application has to be signed by either a trusted root cert, and they've got three CAs, I believe, that can issue those certs, or they have to be signed by a self-signed cert. This is what you get if it comes from a trusted cert. If you paid more than $120, there would be projectors here that could actually show you this text, but I'll read it for you. It says publisher, which is a publisher name that's pulled from the certificate. It says application. This is an application name that is controlled by the bad guy, so you can put, not necessarily the bad guy, the Adobe Air developer. The Air developer can put anything they want in there. It says system access unrestricted. This little green icon says verified, and then the little red icon says system access unrestricted. The application may access your file system in the internet, which may put your computer at risk. While technically accurate, this is perhaps not a strong enough warning to tell people, hey, by the way, if this is malicious, it can do whatever the heck it wants to your desktop. If it is unsigned, and also the default selection is install, so if you hit space or enter, you're going to automatically install it. If you do a self-signed certificate, they don't show the publisher. They say unknown, but they do still publish up the application name. In this case, it's a string of Chinese characters I can't read, and this is an application I downloaded from Adobe.com, published apparently by a Chinese person with a self-signed certificate, and they say that the publisher identity can't be determined, and it still has unrestricted access. As of right now, there's no way to turn off the bottom that says unrestricted access, because there's no version of Air that doesn't run with full access. So that always says read unrestricted. This kind of looks like pre-Internet Explorer 7 ActiveX controls. Just like Microsoft, Adobe has decided we're going to give people the information necessary to make an intelligent decision. But unfortunately, the level of skill needed to make that intelligent decision includes understanding the public-private key cryptography of how the Flash virtual machine works and whether or not Adobe Air is a desktop runtime. So for all you guys now, you can make that decision intelligently. If we give this talk something like 120 million times, then we should cover the Internet using Populous, and everybody will be able to make that correctly. But for the most part, just like with ActiveX, giving people the correct information might not be enough. ActiveX gave that right information, and their legacy became malware, that people would click yes to anything because they couldn't make that intelligent decision. And this kind of scary thing is that these days, the Flash virtual machine is much more popular than Internet Explorer actually has ever been. They have a more dominant position in the Internet market than Internet Explorer ever had, and so it might be a much better way to seed malware. So our suggestion is changing the default action on the signed certificate, adding a countdown timer, at least in the self-signed section, so that people have to read the warning. There is a registry key to turn off self-signed certificate support. Right now, it's allowed by default, there are reasonable reasons why you'd want to support self-signed certificates, but I don't think it's a reasonable thing to have turned on by default for most consumers, so flipping it. And then I don't think Adobe should be advertising self-signed error binaries from their own site, from Adobe.com. It's probably better for Adobe to enforce people getting real certificates, and perhaps doing a couple of sanity checks on the error apps before they come through. Right now, you can upload any error app to Adobe.com. It's going to be exposed to a lot of people. It might be a very good way to seed malware with Adobe looking to give a grant of imprimpture that this is a reasonable thing. We also think that there's probably some room between totally jailed error and completely free loose... I'm sorry, totally jailed Flash and completely free loose error. Most of the applications that are probably going to want to use error don't need to install a rootkit, right? That's not a function that, you know, a online store really needs. Well, maybe they think they need it, but I don't think that for their business model as of now, they're going to need that kind of functionality. So perhaps in error two or error three, we will see a middle ground solution here where you can install an error application that can't do anything willy-nilly. Okay. So we'll have questions at the end because we're going to run out of time, but for now, we'll turn it over to Justine to talk about Silverlight. Hi. So I'm just going to give a brief overview of Silverlight. So Silverlight is a browser plugin comparable in functionality to Flash. Oh. It claims to be cross-platform, but currently Linux support is left as an exercise to the community. It supports a subset of the .NET framework, and there's two versions. Silverlight 1 has been finally released, and Silverlight 2 is in the beta version. So both Silverlight 1 and Silverlight 2 use XAML to render DUI. So XAML stands for the Extensible Application Market Language. And Silverlight 1 uses JavaScript for dynamic content. Silverlight 2 introduces the core CLR, which is a slimmed-down version of the .NET CLR for dynamic content. So here's an example of some XAML markup. So this is a language similar to HTML. You can create little widgets like a slider. It's very simple and easy for designers, intuitive for designers to pick up. So this is what that markup renders in Silverlight. Okay. So Silverlight security model is based on the .NET CLR security model, so code access security. Very briefly, code access security is security based on code identity. So your code gets different privileges depending on where it's from. So if it's from the Internet, it's going to have less privileges. So Silverlight has simplified classic code access security. So that the developer can only write transparent code. And then they can call into security, they can call into critical code with security-safe critical APIs, which Microsoft writes, and they are signed with a Microsoft public key. So that's how the sandbox works. So here's an example of what I'm talking about. I can't, in my Silverlight application, call file.create, because that's critical code. The second example will succeed because I'm calling from a safe critical API, which does stuff like input validation, as is shown in the example, the third example, which will fail, because it's trying to do something nasty like talk to the modem. So isolated storage is an example of one of the safe critical APIs, and some of the power that Silverlight has, access to the local system. And you can deny local storage. So that's a good thing to know. And network sockets is another way that Silverlight allows the browser plug-in to access the local system. And it requires a client access policy. So I'll talk a little bit about the cross-domain and Silverlight. So Silverlight honors the same cross-domain policy as Flash, so it will accept a cross-domain.xml file. Silverlight, by default, should only be able to call back to its domain of origin, but you can configure cross-domain access with these policy files. And client access policy is Silverlight's version of the cross-domain.xml. One of the interesting things that Silverlight has that Flash doesn't is the ability to turn off access to the hosting DOM. So you can embed Silverlight applications in the DOM and disallow them from... I mean, sorry, in a web page and disallow them from accessing the DOM. So the big deal here is that the attack surface is really in the safe critical APIs, and that's really Microsoft's job to maintain. So that offers some control with patching and whatnot. And then the other attack surface is really denial of service attacks against the user because Silverlight has access to the local system. Silverlight applications don't have to exit. It's up to the developer to implement that functionality. So really brief overview, but there's some fun stuff to play with here and a lot more work to be done. So I'll pass it over to David. So the frameworks that we've talked about so far have been kind of ways to write full-fledged desktop applications. In the case of Air, it's totally outside of the browser with some ways to interact with it. Some of the frameworks that we have coming up here, including Google Gears, Yahoo Browser Plus, and Mozilla Prism, are all more based around the browser but give extra capabilities. So you can see here that Gears doesn't have a whole lot that it can do. It does allow for running disconnected, and that's the main goal of Gears is to cache content locally and make it so a web app can be a local app. So the things that Gears consists of, there's an API for syncing data between your local machine and site. There's a SQLite instance locally that actually stores the data for that syncing. There's also a locally running application server. So you've got a browser plug-in that actually, if you're disconnected, it'll cache content and serve it back up to you from a local web server. We'll skip to it. So the other cool thing is that there are worker pools in Gears, and these are a method for, if you have really intensive JavaScript calculations, to offload them to be processed by something else rather than actually running inside the browser where you might lock the UI or diminish user experience. So for the most part, the mechanisms that are in Gears just utilize the same origin as a security precaution. They do give the ability to use parameterized SQL statements for accessing local database stores, and they do prompt for install. It's not a really awesome prompt and doesn't give users a lot of information because in Gears 0.3, which is still the current version, I believe, they introduced the ability for developers to basically have the security warning to look however they want it to. So here is a pretty trivial example. If you saw the Jafar talk, it turns out that there at least used to be a way to actually spoof the real URL, but what you have here is the friendly name up top, and if you just make the friendly name look like a legitimate site, you can actually customize the icon here so that it looks like a lock, which makes people want to click yes on things, and you can try and convince the user in whatever way possible to actually allow this. It's not... It doesn't really give you any information as to what could go wrong when you're accepting this kind of prompt, and I'll kind of get into what can actually go wrong a bit here. Suffice it to say that allowing developers to customize security prompts is not a great idea. But so with worker pools, one of the neat things about worker pools, because they don't lock up the UI or make your browser run slow, you can actually use them for things that would otherwise trigger, say, Firefox's runaway script detection, where it says, hey, this page is taking a really long time to respond. Do you want to let it keep going or not? Because it's so easy to get somebody to actually allow a site to use gears, you can actually use this to do things like push a bunch of hashes down to these machines and do hash crack... I mean, JavaScript is not the fastest way to crack hashes, but if you have a browser with an army of people that are all coming to your website and clicking yes and allowing you to use gears, you can actually run this stuff in the background. They go off and surf elsewhere. You can have it serve up the answers when it gets them. And it turns out that this actually works reasonably well. So the components of gears are pretty simple. Yahoo Browser Plus kind of goes in a weird direction where the idea of Browser Plus is making it so that developers rather than using a little framework for local data storage or other mechanisms like that, it basically makes it really easy to write your own modular browser plug-ins. So because nobody understands NPAPI and very few browser plug-ins exist, Yahoo decided that a way to make powerful web applications would be to write something that would allow people to just push down new browser plug-ins that run with full privilege. So there has been some attempt at putting security into this framework. Their inspiration for a good security model has been that of browser developers, which for something that actually allows you to run desktop applications, there could probably be a stronger model to follow. So you actually initialize this over an insecure connection back to Yahoo. It's another place where, who knows, because it's Akamai or something, you can't do it over SSL. So the first time you actually install it, you don't even have to restart your browser. It installs this plug-in and starts handling this stuff, and it'll push down on-demand components that are necessary for the web application. A couple of things that are included are a locally running version of ImageMagick to do image transforms, which has traditionally not been terribly bug-free code. There's a little sample app for uploading stuff to Flickr, notifications for Growl and Snarl to kind of poke into the OS notification framework, and an embedded Ruby interpreter. So this actually allows you to write further browser plug-ins in Ruby. So it's kind of this mash-up of ancient plug-in technology with new, sexy, slow interpreted languages. But... So these, of course, all run on the local machine with full user privilege. It's worse than ActiveX, as near as I can tell. The Ruby version that was shipping up until a week or two ago was actually the same version that some people might have heard about that had really trivial overflows in both arrays and strings. So precautions to developers, as long as you don't actually develop any applications using a rate of strings, you're perfectly safe. So it's not something... That was actually hanging out there for a really long time, and that's a really old version of Ruby, so it doesn't seem like there's been a lot of focus on keeping this stuff up to date. But admittedly, it's in a preview phase, and part of the reason for that is because they're trying to figure out how they can do this without making everything entirely insecure. And... I can't really see a way that that's going to happen. Right now, there is a framework for actually signing these modules, but they also accept calls from outside sources. So if you can get any kind of code execution in these modules, you can actually clobber the whitelist that says where you can load BrowserPlus plug-ins from, or correlates. And you can also change the verification procedures. All of these can clobber each other. There's no protections against any of them. So... Yeah, it's not that great of an idea. So it's... This might be able to be turned into something usable from a security perspective, but in general, as it stands right now, with no sandboxing at all, it would probably be a really easy way to install malware. So actually, probably my favorite of these frameworks are the ones that try and use a standards-based approach rather than trying to invent new APIs that aren't cross-platform and making people install them. Prism is actually pretty simple in concept. What it is is just a way to encapsulate a website into kind of a chromeless, stand-alone browser. And they set up their own little profiles, and they're locked to one site. If you click on links to another site, it'll actually open in a browser, just like if you're in an email application. It just passes it to the browser. It doesn't try and follow that stuff around, which is a good design. And there's no... You can't even override SSL certificate failures, which is also a pretty decent idea. They're really trivial to make. In their most basic form, all they need is an INI file that says where to go, some CSS layout stuff, some JavaScript rules, and things like that. There's a couple of Prism apps running together. You can see that they... You know, they'll sit around in the task bar, and you can... They don't have any location bars or anything like that. You can write something that looks like a full app, like Thunderbird or something, and it's not even necessarily apparent that it's a web app. The place where Prism falls down is that the actual JavaScript UI that you install has full XP, and it's got some PCOM scripting privileges. So this is the language that people write Firefox add-ons in. So anything that you can think of a Firefox add-in, you know, that it can do, you can basically do in one of these web app bundles, which is a little bit of overkill, since you don't really need to change a whole lot in these bundles. It's a pretty simple idea. So with Firefox add-ons, you have a simple way for people to... You know, there's a signing mechanism, there's an install prompt, there's a counter, there's a fairly good explanation to the users that, you know, this is not necessarily safe code. In Prism, what you get is just what looks like a bookmark dialog. And, you know, you check a couple of boxes if you want it to behave differently than the default, and you say where you want it to go. No warnings or anything. So it turns out that you can actually use this XP-COM scripting privilege to do things like... Right now, the people just host their web app bundles on a remote site, and they say, hey, I've made a bundle for such and such site, encapsulating that. Go ahead and install it. It turns out you can do things like have that, you know, if you had a webmail.com bundle, you can just do things like change people's proxy configuration settings to go through a server of your own, or relay content to other places. It's really a lot more functionality than anybody would really need to add here. So the idea of Prism is actually, I think, pretty sound. The XP-COM scripting privileges should really go away, especially since they're actually starting to push this. I think it's one of the featured add-ons for Firefox that, you know, they want people to install. Outside of the Prism framework, there's actually functionality in HTML5 and new browsers like in WebKit and Firefox that allow you to do a lot of Rea-type stuff cross-platform without having to lock people into, you know, a proprietary solution. You may have heard of, of DOM storage, and this is a new, or parts of it are a new mechanism that were introduced in Firefox and WebKit. They give you a couple of different mechanisms to store data locally. They give you session storage and local storage. Session storage is just per session. Local storage is a big five-meg data store that you can use. You can have access to a local SQLite database now through the open database function. So you can create your own databases just like you were creating a cookie. And, you know, these are all protected by same-origin restrictions, but they have a couple of other interesting facets. So the reason why DOM storage is introduced, you can do local caching. You can do user tracking without having to ever prompt the user or let them know that you're doing it. You can, it gets around the things that web developers don't like about cookies, which is that people delete them or they refuse them and they have to write code to say, oh, this person turned cookies off, things like that. This gets around a lot of that. You have a really big data store and you can, you know, load whatever you want into it. And, like I say, it's an excellent tracking mechanism. The other thing is that now that SQL databases are running on a local system, you have the possibility where, normally SQL injection was a server-based, you know, this was you attacking a server, trying to get data off a remote database. And if you had, for instance, cross-site scripting flaws, you would use them to try and steal a user's authenticated session, log in and do stuff as them. Because you're now storing data locally, you actually have the case, you have the possibility for SQL injection if you can pass parameters in. Some frameworks let you parameterize and some just let you, you know, want you to write raw SQL. But there's also a neat scenario here, which is that if you go to a website that has cross-site scripting flaws and, you know, you go to your webmail site and you've got some data cached locally in your database, you can actually have pre-authentication cross-site scripting flaws that can steal this data and shuffle them off elsewhere. So you don't even have to actually wait for people to be logged in anymore to steal or destroy any of the data that they're storing, which makes, you know, cross-site scripting kind of an interesting attack. So there's a couple of things that are specific to Firefox 3 that'll go through here real quick. Up until beta 2, they were still considering pushing cross-site XML HTTP requests with no real defining policy in there. Thankfully, it was pulled out before Firefox 3 shipped. But as near as I can tell, that's still an open issue. So if people have any pressure they can exert on Firefox to not do that, they should exercise it. It also has a global storage mechanism. And this kind of highlights part of the problem with some of these frameworks, which is that people are... You would think that a standards process would work where people would write a standard and review it and then go implement it in products. That's not how standards work at all. What happens is people write a draft standard that's kind of half done and has some ideas they've been kicking around, and the technology implementers, the browser vendors, have been looking at those and saying, wow, this particular feature is kind of neat. We're just going to implement it now. So that happened with global storage. It was then pulled from the HTML5 spec because it wasn't a very good idea. It allows you to just use named data stores and with actually pretty small domain restrictions. Firefox 2s were particularly bad. And of course nobody knew that Firefox 2 had this mechanism. And there was no UI to actually let people know that this new storage and tracking mechanism had been inserted. Another strange thing with Firefox 3 is that you have a whole ton of data that's not relational. In SQLite databases, that open up some other interesting attacks. There's actually, if people are interested, there's a lot of stuff that went into Firefox 3 that's really interesting. If you go to a page called Firefox 3 for Developers, there are a whole host of new services that are, many of which can be their own research project. Support for the extended extensible style sheet language. I guess it didn't have enough extension mechanisms in it already, so they needed a more extended version. There's the NSIdleService XPCOM method, which allows for tracking how long users have been at their computer and if they're going away, things like that. There's also one of the probably not best ideas that went into Firefox 3 is that, well, it's actually, it's not a bad idea. What happens is now you can use other websites as protocol handlers. If your favorite site for sending email or your email program of choice effectively is Gmail, you can go ahead and tell the browser that I would like to use Gmail to handle this instead of spawning Thunderbird or Outlook. But the protocol handlers are another place where verification is really weak. This is just a very small snippet of code here that asks for a user to say, to use their site as a protocol handler. So since transmission of mail is something that's good for an attacker to take a look at for snooping on users, you can actually just put in your site by IP address. The only actual restriction on installing protocol handlers is that the malicious site and the site that the protocol handler refers to has to be the same. Which isn't actually a restriction at all. So here's what it actually looks like if you try and use a third party protocol handler in Firefox. You can see there's a, do you want to allow Yahoo mail something that you don't understand and then as an application for mail to links. And your options are add application or you can kind of close the dialogue. But mostly just add the application if you would. And this, the funny thing here is that when you actually add a protocol handler it'll do things, Firefox already actually knows about Yahoo mail and it knows where to send stuff for that. And that's the second option here. But the actual malicious snippet up there, what it does is it actually goes through, it follows the link, finds the fav icon and decides to use that as the icon for your new protocol handler. Not only that but in Windows XP it makes it so it's gray on gray. So you can't actually, there's an IP address under there. But you can't tell what it is. So what you actually have happen is, you have this more real than the real thing protocol handler that would make people accept, you know, choose a malicious one over the real one. Like hyper real or a simulacra or something. So I'm gonna go pretty quick through WebKit. But suffice it to say that WebKit is actually, they were pretty early adopter of some of these local storage mechanisms. They've had SQL database support for a while. And it's in a lot of stuff. It's actually, Nokia is the second biggest user of WebKit after Apple because it's based in, it's what's used on the iPhone, it's what's used on Safari. A lot of people probably don't know that you can do things like use local SQL databases for storage there. But it's also in OpenMoco and it's what's, you know, what Air uses for its rendering engine. So part of the problem with these storage mechanisms, other than the fact that you can do transactions and tracking with them, is that they're all basically capped at five megs and they're all per origin. You know, the origin being the classical thing. If you have 10,000 domain names, you've got 10,000 origins. And they don't, you can just have them be subdomains of a main site. So you have 15 megs per origin. And anybody that's actually got wildcard DNS or a whole bunch of names or is on an internal network can actually fill up your hard drive pretty quickly. In a matter of, depending on your hard drive capacity, it could be five minutes to, say, ten minutes. But you can actually make this stuff grow out of control really quickly. That's actually really important if you've got a mobile device. Because if you've only got, say, eight gigs of storage and you can take it all out and you're pooling your storage with your actual RAM, you can kind of not brick permanent storage. But you can make these devices pretty much unusable. And there's no way to actually disable these mechanisms that's easily available. So there's some sample code. You can pick up the slides afterwards that kind of show how you do this kind of stuff. One other little quirk about this kind of stuff is that you can actually insert a bunch of Base64-encoded data that forensics programs will try and pick up. So you can use this stuff. This is to shove tons of arbitrary content, inappropriate images or things that people aren't supposed to be in possession of, and litter the user's hard drive with while you're doing your little DOS attack. And this also works quite well in practice. HTML5 is a weird beast. I encourage everybody to read the specification. Security so far has not been part of the standards process. The only thing that's actually in it is that there's a note that it needs to be written someday. But the spec is pretty much approaching completion as near as I can tell. And it's something that should probably go in a little bit earlier than the very end. So I'm going to turn it over to Alex to kind of talk about some of the more interesting ways that you can use these RIA frameworks to attack users and what you can do about them. Thanks. Okay, so to wrap it up, let's go through some of the things that the new kind of attacks that we're facing in the RIA Web 3.0 world. Sorry I said that, but to throw it out there. Some of the new things. So attacks of re-applications against the operating system. We have now local storage, which, as David pointed out, there's a lot of privacy and tracking concerns because either UIs don't exist or the UIs for wiping out or turning this stuff off are not integrated with UIs for cookies. So just about when people started figuring out how to turn off cookies or clear them appropriately, we now have new local storage mechanisms that they don't understand. We've started to see this with people, banks using Flash cookies and Flash as local storage mechanisms to track their customers, and they call that, you know, dual authentication. You know, we also have a denial of service risk, like he said, by using multiple domains to... 5 megabytes times infinity is still infinity, right? So having a limit that then can be used over and over again gives you a denial of service mechanism. From a malware perspective, probably Adobe Air is the most concerning here, just because it does have, as designed, full privileges locally, although all of these frameworks are adding new huge attack surfaces, right? The fact that an entire SQL database is embedded in your browser and callable by malicious JavaScript is huge, right? Because now you have every kind of command that you can do in SQLite you can execute locally, and if SQLite has an overflow, now you have a very rich, broad attack surface, and anybody who's ever read the errata on a single Oracle patch will understand how difficult it is to write something like a SQL interpreter that is secure. In the err situation, you're talking about people, you know, using the install box and trying to trick people into installing it, having a malware issue. From a web perspective, we now have a very interesting issue where cross-site scripting pre-login becomes much more powerful, right? Cross-site scripting against a webmail app used to only be useful if the person had an active cookie, which for a lot of times they would, right? Or you'd have to do a trick. You'd have to trick the person into logging in and then have the cross-site scripting execute afterwards. Now with local data storage, if I can do a referred cross-site scripting, I can do it in an invisible iframe. They don't have to log in or have a local cookie. It can just run and pull all of your cached email out of the local data storage and send it, right? So pre-authentication cross-site scripting with the local domain storage and local SQL storage in Gears and HTML5 is very frightening and adds a lot more power to cross-site scripting attacks that were kind of useless before. We now have SQL injection in JavaScript. Your web app, not the database behind it, but the JavaScript that runs to make your web 2.0 app run can have a SQL injection vulnerability. And that's not a good thing, right? Because the people that write the JavaScript and write the HTML are not the same people that write the web app, the JDBC calls and the ODBC calls, the people that understand what SQL injection is in the past. So we're talking about a whole new group of generally graphic design kind of people that sit at ritual roasters in San Francisco with their MacBook Airs and their thick glasses and their lots of piercings that those kinds of people now are going to have to worry about SQL injection and they've never had to do it before. CSRF is something interesting from RIA apps. We can't really cover that too much. In the case of Prism, we have sandbox apps that can affect each other and do all of the nasty XPCOM stuff. In the case of BrowserPlus, you have modules that are running with full executable locally. And as David said, things like ImageMagick, which has all of these algorithms that are extremely dangerous and have had buffer flows in the past. We can also chain these frameworks together. You can launch an error application from inside a Prism app, for example. And so there is some concern there. So some checklists. If you're a RIA developer, your data stores for local SQL or structured data use non-predictable GUIDs. Use parameterized SQL if you can, although that's not always possible. Lock your apps to your domain. Some other stuff. You guys are bad guys, so we'll skip ahead. If you're a security professional, our recommendations are looking at the attack surface, such as the IL parser to the new virtual machines, embedded HTML rendering. If you're a corporate admin, don't let your users install RIA frameworks. You can use something like Group Policy Objects to do this in IE. Not sure how you do it in Firefox. If you're a normal person, don't install a RIA framework unless you actually need it. Read the install boxes carefully and get ready for the apocalypse. If you're a penetration tester, look for dangerous parameters passed into something like an error application on instantiation. Make sure people are using parameterized SQL statements. Make sure that data stores, if possible, are using GUIDs for naming conventions, so cross-site scripting attacks might not be able to find them. Look for limits on storage mechanisms. Make sure people are using SSL with these mechanisms because they're so dangerous. If you pull down executable code that can use them over HTTP, you now have a much bigger issue than people like stealing cookies. In conclusion, these RIA frameworks are very widely different in what they can do in their security models. It is extremely likely that using these RIA frameworks, that web developers are going to introduce all kinds of new, very interesting flaws in web applications as well as things that are supposed to be desktop applications. The web is becoming less standardized, which is the whole point. This is all about corporate control of which of these companies is going to control the API so breaking standardization is what you have to do if you want to monopolize the browser. From that perspective, it's making security a little harder. It's making things a lot more dangerous. I don't think we have time for Q&A because I'm getting some kind of you're going to die, cut, cut, cut sign. We'll step off the stage if you want to ask questions and we'll also be in room 115 for a breakout session if you have questions or comments. Thank you for coming.