News for hackers. Stuff that matters.
Re:Consumer key/secret for official Twitter clients by lukeholder on Thursday March 07, 2013 @06:22AM (#5337116)
uh, this is not good. Why would someone post that under their own github account?
Re:Consumer key/secret for official Twitter clients by cmelbye on Thursday March 07, 2013 @06:28AM (#5337133)
It's more or less public knowledge. You can find it yourself by running "strings" on the Twitter app binary. Any attempts on Twitter's part to limit the disclosure of these tokens would almost certainly invoke the Streisand Effect.
Re:Consumer key/secret for official Twitter clients by lukeholder on Thursday March 07, 2013 @06:29AM (#5337136)
Couldn't another app use these tokens and take advantage of lax api limits ?
Re:Consumer key/secret for official Twitter clients by pilif on Thursday March 07, 2013 @06:35AM (#5337148)
Yes. And that's the point of the disclosure.
Re:Consumer key/secret for official Twitter clients by RockyMcNuts on Thursday March 07, 2013 @09:31AM (#5337713)
Anyone know what are the API limits for these keys? Is Twitter really favoring this key, or is that hypothetical?

Of course, you still have to log in as a user, and Twitter could blacklist accounts that use this key on non-Twitter apps, which are going to have a lot of 'tells' and a specific signature in patterns of how they use the API.

(Twitter could even take advantage of that by hiding a code in a usage pattern, kind of like the POW who blinked in Morse code when he was put on TV)

Re:Consumer key/secret for official Twitter clients by ceejayoz on Thursday March 07, 2013 @10:32AM (#5338145)
> Is Twitter really favoring this key, or is that hypothetical?

In at least one way, yes. New third-party Twitter clients are limited to 100k users, but Twitter's official clients are unlimited. If those clients built in a "use your own authentication token" UI, you could put your official client's tokens in and work around that limit.

Re:Consumer key/secret for official Twitter clients by pilif on Thursday March 07, 2013 @10:23AM (#5338083)
> Is Twitter really favoring this key, or is that hypothetical?

I don't know about API quotas, but I'm totally sure that they allow more than 100K tokens.

Re:Consumer key/secret for official Twitter clients by mortalkastor on Thursday March 07, 2013 @07:35AM (#5337279)
On Android, the foss client Twidere let users change the tokens in the options. https://play.google.com/store/apps/details?id=org.mariotaku....

The Chrome app Hotot too. https://chrome.google.com/webstore/detail/hotot/cnfkkfleeioo...

Re:Consumer key/secret for official Twitter clients by matsuu on Thursday March 07, 2013 @06:39AM (#5337151)
NekoTsui supports to change consumer key/secret. https://itunes.apple.com/app/nekotsui/id476924886
Re:Consumer key/secret for official Twitter clients by jasiek on Thursday March 07, 2013 @06:53AM (#5337181)
I think Apple will simply not permit applications that use these keys and are not official clients in the App Store. Looks like something that is pretty easy to automate.
Re:Consumer key/secret for official Twitter clients by cbsmith on Thursday March 07, 2013 @07:05AM (#5337203)
You presume that one would use the keys on iPhone. No reason you couldn't run them on a Linux box in AWS...
Re:Consumer key/secret for official Twitter clients by codeka on Thursday March 07, 2013 @07:04AM (#5337199)
I'm not sure why Apple would play police for Twitter, though.
Re:Consumer key/secret for official Twitter clients by cryptoz on Thursday March 07, 2013 @09:10AM (#5337603)
Isn't Twitter integrated into Apple's mobile operating system? Such tight partnerships is plenty reason for them to play police for Twitter.
Re:Consumer key/secret for official Twitter clients by fpgeek on Thursday March 07, 2013 @01:48PM (#5339352)
Yes and no. Apple wants to protect their Twitter partnership, but... Apple knows that there aren't any effective police in the park next door. So the question is whether Apple values their Twitter relationship enough that they're willing to cede most of the future energy and enthusiasm around third-party Twitter clients to Android.

It's possible, but I don't think it is at all an easy call.

Re:Consumer key/secret for official Twitter clients by arethuza on Thursday March 07, 2013 @07:18AM (#5337236)
How would Apple know that the app uses these keys? If they run something similar to strings then all you have to do is store the keys in some kind of obfuscated form.
Re:Consumer key/secret for official Twitter clients by interpol_p on Thursday March 07, 2013 @07:47AM (#5337310)
Right but as soon as the press find out, and they will, that developer account will be banned. Most devs won't see it as worth the risk.
Re:Consumer key/secret for official Twitter clients by cathustler on Thursday March 07, 2013 @08:23AM (#5337429)
What responsibility does Apple have to Twitter except the notification center widget?
Re:Consumer key/secret for official Twitter clients by soemarko on Thursday March 07, 2013 @08:06AM (#5337365)
Twitter did this to themselves. Without the limit, this information is worthless. It'll make sense for an app like Tweetro[1] to add custom token as a feature or easter egg.

1: http://www.theverge.com/2012/11/11/3631108/tweetro-user-toke...

Re:Consumer key/secret for official Twitter clients by jdminhbg on Thursday March 07, 2013 @01:00PM (#5339063)
> Without the limit, this information is worthless.

Not true. Say you have a malicious Twitter client app that posts "Lose Weight In 30 days! <link>." Normally, Twitter could shut this offending app down by rejecting their client ID/secret; if they're using the official Twitter creds though, doing so would shut down all official Twitter apps in the process.

Re:Consumer key/secret for official Twitter clients by fastest963 on Thursday March 07, 2013 @01:08PM (#5339103)
They already have spam systems in place to catch repetitive spam tweets and block them.
Re:Consumer key/secret for official Twitter clients by andyjohnson0 on Thursday March 07, 2013 @06:50AM (#5337178)
It would be possible to obfuscate a secret by storing it in several parts and combining them at run time. Still very far from secure, but this would require much more effort to extract the secret from the app.

Anyone: what is best practice here (Android and/or iOS)?

Edit:

Storing application secrets in Android's credential storage [1]. I have no idea how secure this actually is.

Should I obfuscate OAuth consumer secret stored by Android app? [2]

[1] http://nelenkov.blogspot.co.uk/2012/05/storing-application-s...

[2] http://stackoverflow.com/questions/7121966/should-i-obfuscat...

Re:Consumer key/secret for official Twitter clients by dexen on Thursday March 07, 2013 @09:15AM (#5337631)
> It would be possible to obfuscate a secret by storing it in several parts and combining them at run time.

Then run `strings' on virtual memory image of the offending process. Same difference.

Re:Consumer key/secret for official Twitter clients by pandog on Thursday March 07, 2013 @06:56AM (#5337183)
Correct me if I'm wrong here but I believe that then all one would need to do is stick an SSL intercepting proxy (such as http://mitmproxy.org/doc/ssl.html) in the middle and get the keys from there.
Re:Consumer key/secret for official Twitter clients by andyjohnson0 on Thursday March 07, 2013 @07:10AM (#5337211)
That depends on how the secret is used by the client to authenticate with the remote service.

If the client just sends the secret as part of an authentication request, then a proxy would reveal it. But if some form of challenge/response [1] process is used, where the value sent is derived from the secret and an unpredictable challenge sent by the remote service, then as far as I know a proxy wouldn't help.

I don't know enough about the details of the Twitter/DropBox/etc APIs work to know if they use challenge-response.

[1] http://en.wikipedia.org/wiki/Challenge%E2%80%93response_auth...

Re:Consumer key/secret for official Twitter clients by JoachimSchipper on Thursday March 07, 2013 @07:00AM (#5337190)
It's at least possible to accept only the keys from your real servers, which would stop this attack.

For what happens in the real world, see Georgiev et al.'s "The most dangerous code in the world" at https://crypto.stanford.edu/~dabo/pubs/abstracts/ssl-client-... (spoiler: I described this paper in our internal knowledgebase as "very readable. Promises lots of facepalming and delivers in spades.")

Re:Consumer key/secret for official Twitter clients by talaketu on Thursday March 07, 2013 @11:59AM (#5338655)
Incorrect. The consumer-secret and access-token-secret are not transmitted from client to the server during oauth. They are only used to sign requests.
Re:Consumer key/secret for official Twitter clients by xyzzy123 on Thursday March 07, 2013 @06:06PM (#5340995)
Clarification: For v1. In v2 the secrets just go over SSL.
Re:Consumer key/secret for official Twitter clients by lucian1900 on Thursday March 07, 2013 @08:08AM (#5337371)
Only if the app uses the phone's certificate store, as opposed to a hard-coded one.
Re:Consumer key/secret for official Twitter clients by JoachimSchipper on Thursday March 07, 2013 @06:58AM (#5337188)
For Android, I suppose you could just run a Java bytecode obfuscator before converting the bytecode to Dalvik. There doesn't seem to be something comparable for iOS.

One simple solution is to set N-1 arrays to random data (hardcoded or generated at compile time) and set the last array to the real secret XOR random array #1 XOR random array #2 XOR ... XOR random array #N-1; this doesn't exactly stop a determined attacker, but it does stop "strings".

Re:Consumer key/secret for official Twitter clients by objclxt on Thursday March 07, 2013 @10:19AM (#5338055)
There's very little point obfuscating strings in iOS - since you can attach a debugger to the binary itself on jailbroken handsets (or using cycript) you can step through to the method(s) that use the secret keys and pull them out from there.
Re:Consumer key/secret for official Twitter clients by vidarh on Thursday March 07, 2013 @08:30AM (#5337458)
Unless you know the device isn't rooted this doesn't really achieve very much. On a rooted device an "attacker" could have replaced the crede tial storage with something that will conveniently store the data unprotected.

It is helpful as a way of ensuring random applications don't get hold of the data, but not for keeping the data from a determined user.

Re:Consumer key/secret for official Twitter clients by kristofferR on Thursday March 07, 2013 @06:31AM (#5337139)
Isn't this actually a great thing since it enables developers to develop Twitter clients that aren't dependent on tokens and approval from Twitter?
Re:Consumer key/secret for official Twitter clients by scorcher on Thursday March 07, 2013 @06:41AM (#5337155)
You could only make an app that would explode if/when they decide to change keys
Re:Consumer key/secret for official Twitter clients by Drakim on Thursday March 07, 2013 @06:46AM (#5337170)
Along with any official client that is slightly out of date. Twitter might be hesitant to alienate their users.
Re:Consumer key/secret for official Twitter clients by mtrimpe on Thursday March 07, 2013 @06:53AM (#5337180)
The app could also just download the latest extracted keys from your server when it experiences an authentication failure.
Re:Consumer key/secret for official Twitter clients by aidos on Thursday March 07, 2013 @06:49AM (#5337173)
I guess twitter, and any other client would just say - key revoked, you need to update the app for it to work again. It's an endless game of cat and mouse.
Re:Consumer key/secret for official Twitter clients by nanidin on Thursday March 07, 2013 @07:51AM (#5337323)
Using the official key in an unofficial client sounds like a problem that will be solved with the legal system, not by increasing the burden on Twitter.
Re:Consumer key/secret for official Twitter clients by pifflesnort on Thursday March 07, 2013 @09:57AM (#5337896)
Maybe. Look at AIM and the free/shareware clients for a historical example.
Re:Consumer key/secret for official Twitter clients by slig on Thursday March 07, 2013 @06:44AM (#5337166)
But they can't change those keys without isolating every installation until it's updated, right?
Re:Consumer key/secret for official Twitter clients by dmdeller on Thursday March 07, 2013 @08:16AM (#5337391)
Indeed. Constantly changing keys would cause as many problems for users of the official client as it would for unofficial clients.

Twitter could make some way for the official client to fetch new keys from a server without a binary update, but then they'd have to somehow protect that mechanism from third parties...

I suppose the next logical step would be to procedurally generate keys based on the date, and have only the algorithm (not the keys themselves) known to the official client. Not in any way insurmountable, but a little more difficult to crack.