GitHub, one of the largest repositories of commercial and open source software on the web, has been hacked. Over the weekend, developer Egor Homakov exploited a gaping vulnerability in GitHub that allowed him (or anyone else with basic hacker know-how) to gain administrator access to projects such as Ruby on Rails, Linux, and millions of others. Homakov could’ve deleted the entire history of projects such as jQuery, Node.js, Reddit, and Redis.
Since launching in 2008, GitHub has quickly outpaced competitors like Codeplex and, depending on which metric you use, it has even outgrown the long-time incumbent Sourceforge. In essence, GitHub is a web-based wrapper around Linus Torvalds’ Git revision control system (which he initially wrote to aid Linux development), but it is the addition of social network features like feeds, friends, and trends that have fueled GitHub’s impressive growth. Ultimately, GitHub makes it very easy and fast for developers to collaborate — plus it’s free for open source projects — and as a result, some 1.4 million developers have been attracted to the service in just three years, creating more than 2.3 million repositories. A list of the most-forked projects on GitHub almost reads like a contemporary who’s who of successful open source projects.
Despite its size and importance, though, GitHub has never been hacked — until now. GitHub uses the Ruby on Rails application framework, and Rails has been weak to what’s known as a mass-assignment vulnerability for years. Basically, Homakov exploited this vulnerability to add his public key to the Rails project on GitHub, which then meant that GitHub identified him as an administrator of the project. From here, he could effectively do anything, including deleting the entire project from the web; instead, he posted a fairly comical commit. GitHub summarily suspended Homakov, fixed the hole, and, after “reviewing his activity,” he has been reinstated.
Putting aside the way GitHub handled the situation (quickly and with aplomb), the main issue is that GitHub was vulnerable to an incredibly simple and well-known Rails hack that has probably existedsince the site’s inception. Ruby experts like Michael Hartl and Eric Chapweske have been writing (and warning) about the mass-assignment vulnerability since 2008, when GitHub was first launched. In short, it’s highly likely that Egor Homakov was not the first person to exploit GitHub in this way. We would’ve heard about it if a large project had been deleted out of the blue — but maybe hackers have been quietly modifying code bases for their own, nefarious ends.
Moving forward, GitHub has apologized for obfuscating the how white hat hackers should disclose security vulnerabilities and set up a new help page that clearly lists how to report issues. GitHub, alongside 37signal’s array of popular web apps (Basecamp and Campfire), is probably the biggest deployment of Ruby on Rails on the web. After last year’s long series of high-profile hacks on technology companies like Sony, RSA, LastPass, and Google, we probably shouldn’t be surprised that GitHub was vulnerable — but still, when it is a service that so many important projects rely on, it’s shocking that an age-old vulnerability wasn’t picked up in a security audit; if GitHub performs security audits, that is.