This is a mostly non-technical post where I wanted to talk about the concept of application original sin. Every application has original sin, meaning it was conceived. Any application had to start somewhere. It started with a single line of code, to be precise. Or maybe it started before that with touching a file in a directory. That user had to have file permissions to write the file, the file itself took test data, wrote into test databases, and so on. On and on the application development went until it was complete with its very first version. But that’s very rarely where it stops. Often you can find an application living well into future years, being molded and expanded upon. But all the while it stemmed from that original sin, making it very hard to change beyond what it was originally intended to do.
Last night Jeremiah and I spent a good long while on the phone talking about cross site request forgeries. The short of it is that we are all pretty screwed. The internet is so incredibly flawed that there is essentially no hope at the moment. But what would it take to fix it? The first thing that popped into my head was Wordpress and how they created nonces for certain tasks. Sure, that’s nice and all, but the amount of websites that are vulnerable only because they run Wordpress is pretty small. Any open source package has got a higher chance of fixing these flaws (if anyone ever got around to fixing them all and releasing a new package). But even that is pretty unlikely.
Then you start thinking about all the other applications that are completely proprietary. Each one of them would need to be modified, not just to stop CSRF, but also XSS since XSS can often read nonces. Ouch! Given that a huge percentage suffer from both of those attacks, I don’t see this happening anytime in the near future. So what do we do? Are we really and truly that screwed?
Mozilla contacted Jeremiah, Billy Hoffman and I to look at the new cross domain XMLHTTPRequest standard they are thinking about building into Firefox. There was only one small new hole introduced by creating something that I think would make most security people wince. Why’s that? Because it’s already so broken! Adding another function that allows you to break security in another way doesn’t change your actual attack surface area by much. Sure there will be downstream dumb things that are created with the applications that are built off the technology itself, but it’s not like this is mind blowingly bad security - at least it’s not much worse than how browsers currently function. Not to pick on Firefox in particular, because every major browser company is at fault here (that I’m aware of).
I got this message from a friend today, “seriously seriously? I’ve got to surf around with Javascript AND CSS turned off?” He didn’t even mention Java, VBScript, Flash, ActiveX and a host of other things. I’m afraid due to cross site request forgeries it’s far worse than that even. Every image, every included style, every iframe and frame, everything that’s embedded in any way, can cause CSRF. It’s the “holy crap that’s bad” vulnerability that affects nearly every site out there. The only trick is getting the right person to perform the action and that’s really not as hard as it may sound. Not to mention all of the insane amount of information leakage found on the internet. I’ll have to write a paper on this topic sometime. It’s ridiculous how much information you can get from a single hit to a webpage, it really is.
Ultimately, the point here is what I think we all feared. The Internet just was never designed to be secure. It’s suffering from it’s original sin - it was conceived and built with ease of use in mind, not security. And due to new technologies being built on top of it all the time, we can’t even retrofit at the pace that the technology is evolving. When the experts in the field are telling browser companies, “It’s so messed up anyway, there’s no sense in worrying about creating equally insecure functions at this point” you know you’ve got problems.