FaceBook PHP Code error causes Code Leak

Written on Monday August 13th 2007 at 11:12 am

 

Owing to a misconfigured server, Facebook exposed its homepage code to what the company called "a handful of users” over the weekend. The leaked code was promptly posted on a new blog, Facebook Secrets, for all of the internet to see.

Although Facebook hasn't specified what exactly was wrong with the server, it seem reasonable to conclude that some sort of mod_php error caused apache to serve the code as an ordinary text file rather than processing it as PHP.

The code leak does not constitute a security breach and there's probably no immediate reason to be concerned about your data. However, given the number of PHP includes and auxiliary file paths listed, hackers now have a much better idea of how Facebook works and where potential vulnerabilities may lie. And it's hardly comforting that such an amateur programming mistake is happening to a site the size of Facebook.

PHP is notorious for just this sort of thing 'serving code as text' but there are ways you prevent it from happening on your own site. The easiest and most effective way is to use the Apache module mod_security, which can detect and stop PHP source code from being sent at plain text.

Regrettably for Facebook, the site apparently wasn't using mod_security on the particular server that was misconfigured.

One group that should be quite happy with the leak is ConnectU, the company currently embroiled in a lawsuit with Facebook which alleges that the latter stole code from the former. If the alleged code happened to be on Facebook's front page, ConnectU's case just got a whole lot stronger, though ConnectU hasn't said anything to that effect.

Given the amount of personal data that many people have dumped into Facebook, an outside security breach would likely lead to an identity theft nightmare, should it ever happen. And if this weekend's code leak is any indication, Facebook doesn't seem to be operating at the security level you would expect from a site of that size.

3 Comments

Guest

On Saturday October 13th 2007 at 10:06 am Guest said

Sorry, it just sounds like a crazy idea for me :)…

Kaila Yu

On Friday October 19th 2007 at 11:56 am Kaila Yu said

I Googled for something completely different, but found your page... and have to say thanks. nice read...

Chrissy

On Monday January 7th 2008 at 5:26 pm Chrissy said

Greg u r awesome, thanks for the great reads!

Add a comment or Login

Your Name: *

Your Email: *

Choose a Password: *

Confirm Password: *

Comments: *


Are you Human? Please enter the number you see above (for verification purposes)