Reverse engineering Facebook photo links; circumvents privacy settings
lightbluetouchpaper.org
lightbluetouchpaper.org
Take one of my photos for example:
http://photos-b.ll.facebook.com/photos-ll-snc1/v2339/95/113/...
to:
http://photos-b.ll.facebook.com/photos-ll-snc1/v2339/95/113/...
This would largely be applicable when profiles are deemed private and all you can do is view the small profile picture. In the grand scheme of things, it is minor but it should still be fixed.
They seem to have discontinued the "b" prefix shortly after I found it (perhaps to save space?). It was a bit of a privacy concern that they retained the full-resolution image, considering that most users probably do not crop their images before uploading them.
I think Facebook uses Java for this bit (not totally sure, and I don't want to have to log in just to check)
particularly annoying when uploading to S3, since you have to go client->server->client->server->S3.
I've just set up a similar system (non-public media served from a faster server without access checking) and the fact that the urls needed to be non-guessable was pretty damn obvious. The timeout thing is also really really obvious if you don't want people to be able to pass around a permanent link.
It used to be that when a friend was tagged in a photo album of a non-friend, you could only view those photos that your friend was in. By removing the "id=xxxxxx" from the URL, you could view ALL photos from the non-friend's album.
As of recently, you can now view ALL photos from any non-friend's album if a friend is tagged in only one of the photos (alleviating the need for the "hack")! Hence, for all their talk about privacy and their very complicated privacy settings, it seems that in some ways your Facebook data is becoming subtly less secure!
Meaning that if you upload in the US you are a tiny bit safer.
This vulnerability is an example of Facebook's failure to think things through. It does push my buttons and I'm going to say something. Just because it's popular doesn't mean it's good.
Analogy: Let's say I had a car company that competed with a fictitious competitor, Toyonda. There was a news story on HackerNews about a software bug that caused all Toyonda Freerunners to crash whenever somebody pushed the gas too long. I then posted a comment that my car, the Legendary Esquilax, doesn't have that bug. It's self-serving and adds nothing to the conversation.
Now, if you said something like, "Our Esquilax line of cars uses an O(1) lookup on the rotor hashtable to avoid a backup of 'gas' events which caused the bottleneck bug at the root of the Toyonda issue." That would be interesting, provide useful news about competing products, and potentially spark a discussion about the "right" gas pedal algorithms.
About your comment on lecturing: I signed up with Hacker News to post a comment. Every person needs an impetus to join a community, and your comment provided that for me.
PS Welcome to HN.
In any case we can't expect a website as big as facebook to implement encrypted urls which dynamically change with each user's session, which the session data server-side is used to decrypt and execute. Its not necessarily the best way to do things (like say ensuring the given user HAS permission to access the photo before serving it.)
O well I guess if the problem is too big for facebook, it must be too big for the rest of us. I am going to go to work tomorrow and rip it out of our application since this should not be a solvable problem.