News for hackers. Stuff that matters.
Re:Researchers publish Snapchat code allowing phone number m... by antics on Wednesday December 25, 2013 @04:26AM (#6962666)
I'll see if I can put it briefly. Maybe Chad will show up, he's much better at this than me.

The problem basically comes down to the fact that Snapchat needs to be able to discriminate between clients that are legit, and clients that are not legit. In other words, at some point Snapchat has to trust that it's distributing the server key (or cookie or whatever it uses in the future to allow clients to say "hey, it's me, you can trust me") to a legit client and NOT to a badguy client. This is not possible. Consider this issue taken to the extreme: even if you built Snapchat directly into the OS, and then signed, you could still root the phone and spoof the relevant parts of the OS to make it seem like you're a legit client when really you're not. Note that even pinning the cert doesn't work. You can still get around it by sniffing around the relevant buffers.

Spoofing the client basically guarantees that the API can be tricked into providing services that it was designed to avoid providing. For example, you can save all Snaps upon receipt. This is a trivial abuse. There are much graver implications that lead to much graver privacy concerns, but I hope you'll understand when I don't publicly announce them. :) Though perhaps Chris will tell you about them if you ask nicely.

Re:Researchers publish Snapchat code allowing phone number m... by pencilo on Wednesday December 25, 2013 @09:58AM (#6963097)
Chad here.

First off I'd like to give props to the gibsonsec.org guys, that is a really high quality protocol breakdown and the attack is neat. I see nothing wrong with going full disclosure after being ignored this long.

The key point is to understand that I, as a protocol reverse engineer/attacker/professional bad dude have access to _everything_ the Snapchat app has. I own the network and the device the app is running on. I can look at every bit of Snapchat's memory space if I want.

I can view all network traffic between the app and the servers. Either by MITMing the app or if the app has cert pinning nothing stops me from peaking at buffers(I did this with Square, it was actually not that painful).

With just that you can see it is not possible to stop me from saving a Snap. I don't even need to make my own API calls, I can simply intercept the traffic of the actual Snapchat client and pull the image out of there. Even if you had a magical way to make sure only the actual app was requesting the Snap it wont help, it is the legit client.

The more important take away though isn't that Snapchat is broken, because that's not super interesting.

What you should take away from Snapchat is that you cannot stop people from calling your remote APIs that your apps are using. All it takes is someone sufficiently bored to go dig through pcaps and decompiled code to map out the API.

So what do you do? Don't trust the damn client. Your service shouldn't be broken just because I am calling your API outside of the bounds of how your application will call them.

This isn't a new idea, but it seems like a lot of people never learned this lesson.

Re:Researchers publish Snapchat code allowing phone number m... by antics on Wednesday December 25, 2013 @12:53PM (#6963611)
As I said before: Chad is way better at this than me! :)
Re:Researchers publish Snapchat code allowing phone number m... by jrockway on Wednesday December 25, 2013 @04:33AM (#6962680)
Even simpler. Point a camera at your screen and snap a photo.
Re:Researchers publish Snapchat code allowing phone number m... by antics on Wednesday December 25, 2013 @04:42AM (#6962698)
Yeah, I mean, my major point is that Snapchat cannot deliver the services without trusting the client at some level, but that trust cannot be guaranteed.
Re:Researchers publish Snapchat code allowing phone number m... by sbov on Wednesday December 25, 2013 @05:34AM (#6962755)
I guess I don't understand the revelation here. Isn't this true of any client? Video game companies have been fighting this battle for over a decade.

Maybe the problem is that I don't use snapchat so I don't understand why it's such a problem for them.

Re:Researchers publish Snapchat code allowing phone number m... by jrockway on Wednesday December 25, 2013 @06:17AM (#6962812)
I think the problem is that Snapchat is significantly less complex than a video game. With a video game, a cheater might benefit from something like removing the fog of war. So the server can just calculate that itself, and not tell you about things your client can't see. This makes cheating more difficult. (But of course, the game needs to be fast, so sometimes you have to give the client more information than it should display. In this space, room for undetectable exploits exist, and so there is a lot of complexity like spyware that reads /proc/mem to check if you're cheating. Or so they say, I've never read the source code...)

I've never used Snapchat, but from what I understand Snapchat basically sends people pictures with a time limit for looking at them. At that point, the client has perfect information, and it's up to the client to stop displaying the picture and remove it from system RAM, swap, CPU cache, GPU memory, and so on with 100% reliability after that timer expires, or the whole app is pointless. Since that's impossible unless you control every aspect of the system and encase it in self-destructing epoxy, the system is mostly pointless. (In that sense, it's like DRM. If you can view it, you can copy it.)

My understanding is that this is mostly used for sexting, which begs for me to ask this question: why are you sending naked pictures of yourself to someone you don't trust with naked pictures of yourself? Maybe work on those human relationships rather than outsourcing trust to some random company? Get off my lawn. Wheeze.

Re:Researchers publish Snapchat code allowing phone number m... by schrodinger on Wednesday December 25, 2013 @07:21AM (#6962866)
It's not meant to be secure, it's meant to be delete by default. Even without an exploit you can take a screenshot of the picture you receive.

However, defaults matter. Even if you're sending a private picture to someone you completely trust, if you do it by email or mms, they'll likely leave that picture lying around inadvertently for someone borrowing their phone to accidentally and embarrassingly stumble upon. With snapchat, the picture will be automatically deleted unless the recipient takes explicit measures to save it. THAT is the feature, not security.

Re:Researchers publish Snapchat code allowing phone number m... by DanBC on Wednesday December 25, 2013 @11:02AM (#6963228)
> or the whole app is pointless.

It still has some use. I don't want to keep the photos of the lunch my sister just ate; she doesn't want to keep the image of the bread I just baked. SnapChat is handy for these kinds of things where people do not care at all about security.

Obviously, if people are sending nudes and hoping those images will never find their way onto the Internet it's a bit more worrying. I guess we should be persuading people to think carefully before sending nude images of themselves to other people. (And educating youth about the perils of nudes).

Re:Researchers publish Snapchat code allowing phone number m... by aidanlister on Wednesday December 25, 2013 @06:52AM (#6962843)
Snapchat let's you sext people you trust right now, without having to worry about trusting them until the end of time.
Re:Researchers publish Snapchat code allowing phone number m... by girvo on Wednesday December 25, 2013 @07:28AM (#6962876)
It's not mostly used for sexting, though yes that is one use. It's mostly used for ephemeral, silly photos between friends.
Re:Researchers publish Snapchat code allowing phone number m... by pencilo on Wednesday December 25, 2013 @09:41AM (#6963068)
There is an important difference between what Snapchat needs and what game designers need.

First of all, look at what is actually successful for DRM in video games. The only surefire way to make sure someone is actually valid is to force them to authenticate(and get data from your server) to play the game. To do this they'll need to provide credentials(like a CD key) and then they'll get the content[1].

Now look at Snapchat. At no point do we need to fake having valid credentials. We are coming in and presenting valid credentials to Snapchat, my login and password, and it verifies those are correct and begins a sessions.

If you want an analogy to game DRM you need to look toward things like hacked clients in MMOs.

tl;dr Games want to prevent people without valid credentials from playing, we have valid credentials already(our own accounts). [1] This is really simplified and you can find many games, like the new SimCity, that the server interaction is small and simply emulated in the crack.

Re:Researchers publish Snapchat code allowing phone number m... by plausibility on Wednesday December 25, 2013 @04:48AM (#6962705)
Well find_friends exploit is one of them - my favorite was one found by clever/you [1] which leaked _any_ user's phone number because they weren't validating auth tokens correctly. That's long since been patched, and rightly so - definitely more dire a situation than war dialing.

[1]: http://cleveryou.net/post/40537133131/oops-snapchat-flaw-lea...