News for hackers. Stuff that matters.
Re:Pokemon Go is a huge security risk by arielweisberg on Monday July 11, 2016 @11:39AM (#12071762)
And just like that I will never sign in with Google anywhere ever again. I just assumed that an app couldn't grant itself full permissions without notifying me, but now I can see why that might not be the case since they are free to present whatever UI they want in app.

In my dream world Google would revoke Niantic's API access forever in order to make an example out of them. Maybe, eventually, if they can prove that they didn't hoover up all the information they had access to they can be unbanned after a year.

Unlikely though considering they used to be a part of Google.

Re:Pokemon Go is a huge security risk by chatmasta on Monday July 11, 2016 @01:23PM (#12072632)
This is a fundamental security issue due to a combination of the OAuth protocol and UIWebView (and whatever the Android equivalent is), which I've posted about before [0]. Basically, the problem is that OAuth depends on web-based access granting, but an app has full permissions over the DOM of the WebView where the OAuth screen is. So you're entering your password into a WebView of a third party URL, but unlike a traditional safari page, the WebView is fully "owned" by the app, so the developers can inject arbitrary code into the DOM of the third party website.

There is no technical limitation to an app engaging in very nefarious activity. For example an app could modify the DOM on the sign-in screen to grab your password after you enter it. Of course the accountability of MITM and security reviews might mitigate this risk, but passwords are generally only a few bytes and could easily be obfuscated and passed surreptitiously over the wire.

I've seen a (quite popular) app implement this for facebook invitations, which should only have a limit of 50 friends, to secretly (in the background, without any action on your behalf other than logging in, or perhaps pressing a "continue" button) invite every one of your friends to download the app. Since facebook does not notify you when you send an inviation, you would not even know the app did this unless one of your friends who you invited asked you about it.

[0] https://news.ycombinator.com/item?id=11637209 (thanks molecule)

Re:Pokemon Go is a huge security risk by qzervaas on Monday July 11, 2016 @02:33PM (#12073188)
In iOS 9 there is SFSafariViewController which doesn't give such control.

Some providers (e.g. Fitbit) require you use this instead of UIWebView in order to access their API, presumably to avoid accessing the DOM.

Not sure exactly how they are enforcing this though, since they don't provide their own OAuth library.

Re:Pokemon Go is a huge security risk by chatmasta on Monday July 11, 2016 @02:47PM (#12073295)
Yeah, you could always override the method in the Fitbit library that implements that requirement.
Re:Pokemon Go is a huge security risk by molecule on Monday July 11, 2016 @01:29PM (#12072682)
> how do I permalink to a comment?

The comment's timestamp is a link.

Re:Pokemon Go is a huge security risk by crescentfresh on Monday July 11, 2016 @01:45PM (#12072821)
> the WebView is fully "owned" by the app, so the developers can inject arbitrary code into the DOM of the third party website

Uh, seriously? I just suggested to our mobile team to integrate this way on Android (I implemented the OAuth 2 server).

I would've made the same suggestion to a 3rd party app vendor when the day comes.

Re:Pokemon Go is a huge security risk by russjr08 on Monday July 11, 2016 @02:03PM (#12072958)
A Chrome Custom Tab is probably the better way to go.
Re:Pokemon Go is a huge security risk by KirinDave on Monday July 11, 2016 @01:58PM (#12072927)
In summary, if you give a nefarious app your password it can do a nefarious thing?

I'm curious how exactly this is specific to the UIWebView implementation.

Re:Pokemon Go is a huge security risk by skewart on Monday July 11, 2016 @03:00PM (#12073413)
It's because the app has access to and control over the DOM of the UIWebView. Suppose some app called EvilGameFoo is asking you to authenticate with your Google account. They should kick you to a UI controlled by Google, which EvilGameFoo cannot in any way inspect or access, where you enter your credentials. Google then tells EvilGameFoo that they can vouch for you. Instead, UIWebView lets the app asking you to sign in via an identity provider inspect the DOM of the UK where you enter your credentials. Hence it lets EvilGameFoo read your password.
Re:Pokemon Go is a huge security risk by bradleyjg on Monday July 11, 2016 @03:12PM (#12073522)
How are you supposed to know that it is actually a UI controlled by google and not a simulation of a UI controlled by google?

The OAuth model not only enables phishing directly even worse than that, it disarms people's natural skepticism towards phishing attempts. Its adoption was a terrible idea.

Re:Pokemon Go is a huge security risk by skewart on Monday July 11, 2016 @03:41PM (#12073752)
Well, on the web you're generally following redirects to a URL. You can verify the owner and authenticity of the host. (A phone app could kick you out to a browser app (not a web view) to authenticate.) Then after you've signed in and granted permission on, say, Google, Google will redirect you to a URL that the other app configured with Google. On a phone that URL should have a host or protocol that the app has registered with so your phone's OS will kick you back to the app after you signed in on the web browser.

Of course, you're absolutely right that it would be trivial to spoof, say, Google or Facebook or Twitter and collect credentials. I would _hope_ that behavior would be detected by Apple or Google during app security screening, but maybe not. Regardless, I totally agree with you about OAuth and security. It does present a lot of problems.

Re:Pokemon Go is a huge security risk by chii on Tuesday July 12, 2016 @04:19AM (#12077510)
Google could send you a confirmation email which is the second factor in this oauth flow. It makes it more annoying, but more secure. It's always a trade off I guess.
Re:Pokemon Go is a huge security risk by wtbob on Monday July 11, 2016 @08:23PM (#12075846)
> How are you supposed to know that it is actually a UI controlled by google and not a simulation of a UI controlled by google?

I have a certificate signed by Symantec guaranteeing that it's authentic!

Re:Pokemon Go is a huge security risk by KirinDave on Monday July 11, 2016 @04:45PM (#12074420)
Right, but what if they didn't use the UIWebView tactic and instead used custom chrome to submit the data. Couldn't they just tap it at that level?

Outside of the Android model where it does the auth for you upon request and only hands the app a token, I don't really see how you don't open yourself to this attack.

iOS really doesn't provide a way for other vendors in an inner ring of consumer trust and power to deal with this. While I'm not a fan of the decision to give full access to Pokemon Go, I didn't find it surprising that it did so on iOS and I had to make a conscious decision to "trust" Pokemon Go as part of the process.

Re:Pokemon Go is a huge security risk by skewart on Monday July 11, 2016 @04:58PM (#12074546)
Oh yeah, for sure, there are plenty of other ways a nefarious app could scrape a user's credentials during OAuth on iOS.

If UIWebView didn't allow the app access to the DOM then it wouldn't be possible this way. But,of course, the user has no way to know how the UI is implemented.

Re:Pokemon Go is a huge security risk by jonny_eh on Monday July 11, 2016 @02:02PM (#12072948)
If an app does this, won't Google revoke their API key?
Re:Pokemon Go is a huge security risk by ceejayoz on Monday July 11, 2016 @02:29PM (#12073150)
They have to detect it. The app could quietly collect credentials for months/years, and revoking the API key won't change those passwords.
Re:Pokemon Go is a huge security risk by SirensOfTitan on Monday July 11, 2016 @08:09PM (#12075774)
> In my dream world Google would revoke Niantic's API access forever in order to make an example out of them. Maybe, eventually, if they can prove that they didn't hoover up all the information they had access to they can be unbanned after a year.

I'm really glad you're not making that decision then. Banning some company based on their use of public, legal APIs would be an absolutely toxic decision for Google's platform.

It's Google's fault for allowing this kind of access with no notification (yes, the fault here might lie somewhere in OAuth, but there's plenty that Google could do to make this less serious). Don't blame people for leveraging options at their disposal.

Re:Pokemon Go is a huge security risk by danudey on Monday July 11, 2016 @05:03PM (#12074590)
Elsewhere in the thread it is alleged that this is a bug (or misbehaviour) with Google's iOS authentication library. It's possible that Niantic is not requesting any permissions and the library defaults that to 'full access' and not 'no access'.

I've yet to see it confirmed, though.

Re:Pokemon Go is a huge security risk by Alex3917 on Monday July 11, 2016 @01:04PM (#12072448)
This issue only affects apps though. When granting OAuth permission via the web, you are actually redirected to google's website, and then afterwards redirected back to the site you were on.
Re:Pokemon Go is a huge security risk by maxerickson on Monday July 11, 2016 @01:35PM (#12072742)
Google recommends using the browser workflow for installed apps too.

https://developers.google.com/identity/protocols/OAuth2Insta...

Which probably isn't very helpful, as lots of users won't notice whether they are using a browser or not.

Does anybody know how Pokemon Go ends up interacting with accounts that have 2 factor authentication turned on? I sure wouldn't type my main password into some app, I'd at least use an app password:

https://support.google.com/accounts/answer/185833?hl=en

Re:Pokemon Go is a huge security risk by horizone on Monday July 11, 2016 @06:36PM (#12075351)
2 Factor works. I'm forced to log back in when ever there is server troubles, which is annoying, but what ever.
Re:Pokemon Go is a huge security risk by jasalo on Monday July 11, 2016 @04:33PM (#12074283)
Did you try using an App password? Doesn't seem to work for me
Re:Pokemon Go is a huge security risk by maxerickson on Monday July 11, 2016 @05:57PM (#12075056)
No I haven't tried it.
Re:Pokemon Go is a huge security risk by ocdtrekkie on Monday July 11, 2016 @01:04PM (#12072450)
The other day someone's web app I clicked on, and it automagically signed me in with Google and added itself to my connected apps. Cloudcraft.co, I think it was. When I hit their signup link, it auto-signed in with Google without me even clicking their Google button.

After I disconnected it, it didn't behave that way a second time. So I am kinda mystified what happened there. But it was pretty strange.

Re:Pokemon Go is a huge security risk by fattire on Monday July 11, 2016 @03:31PM (#12073658)
Could the app be intercepting the confirm screen and auto-agreeing w/o user interaction?
Re:Pokemon Go is a huge security risk by ocdtrekkie on Monday July 11, 2016 @05:47PM (#12074978)
I am very hesitant to accuse the app of doing something intentionally shady like that. I don't really :know: what happened, and I couldn't replicate it myself after removing the app from my account and visiting it again.
Re:Pokemon Go is a huge security risk by serge2k on Monday July 11, 2016 @01:04PM (#12072458)
> I just assumed that an app couldn't grant itself full permissions without notifying me, but now I can see why that might not be the case since they are free to present whatever UI they want in app.

Is that the case? Doesn't this still require going through the standard prompts?

Re:Pokemon Go is a huge security risk by criley2 on Monday July 11, 2016 @01:06PM (#12072472)
Anecdote: On Android 6.0 the Pokemon Go game requested 4 permissions on first launch. Account, Camera, Storage, and one other I believe. I had to individually approve each one.
Re:Pokemon Go is a huge security risk by sp332 on Monday July 11, 2016 @01:09PM (#12072512)
That's just access to your phone, not your Google account. Those permissions don't cover the app's ability to read your email.
Re:Pokemon Go is a huge security risk by criley2 on Monday July 11, 2016 @01:10PM (#12072518)
I also do not have an entry on my Google permissions page (https://security.google.com/settings/security/permissions?pl...), this appears to be an iOS only bug, explaining why no Android user can recreate this bug
Re:Pokemon Go is a huge security risk by mohaine on Monday July 11, 2016 @02:02PM (#12072949)
I can verify this. I logged in with Google and see no permission given to the app.
Re:Pokemon Go is a huge security risk by trhaynes on Monday July 11, 2016 @03:49PM (#12073846)
I do have an entry on that page!

"Pokemon Go Release - Has full access to your Google account"

Revoking access now. Glad I read HN!

Re:Pokemon Go is a huge security risk by sp332 on Monday July 11, 2016 @01:08PM (#12072495)
According to the article, it does not.
Re:Pokemon Go is a huge security risk by jack_pp on Monday July 11, 2016 @04:42PM (#12074387)
or just use a burner email for stuff you don't trust