Zobrazují se příspěvky se štítkemGoogle. Zobrazit všechny příspěvky
Zobrazují se příspěvky se štítkemGoogle. Zobrazit všechny příspěvky

pondělí 23. února 2015

Password protection for purchases in Google Play can be bypassed. (And some other issues.) How to defend yourself?

Google Play allows you to buy apps, books and music. Once you enter a payment method, (e.g. payment card or carrier invoice), it is saved, so you can use the same payment method in the next purchase. Google offers password protection for that. It sounds great, but it can be bypassed. We actually don't have an additional security, but an unkept promise, which may have the opposite effect – the user might rely on the security enhancement, which does not work correctly.

There is an extra issue for users with multiple Android devices. The thief of one device can install apps on the other devices of that user. I'll also mention another related issue, but the last one is fixed.

This is just a warning about security issues, not a manual for the abuse.

This article is a translation (with minor modifications) of my recent article. I am sorry for the delay, I hoped to release this article sooner.

Google will not fix it.

Well, there were also some related issues in two-factor authentication, but Google fixed them quickly after they were reported. Google however refused to fix two Google Play related issues I will talk about.

By the way, Google has paid a bug bounty and listed me in the Hall of Fame, but they said they were happy with the current situation.

Where is the merit of the issue?

Google Play allow us to purchase some content using the Google Play application for Android, which is usually password protected. I haven't looked in the details of password verification, but I hope this is designed correctly. However, this is not the only way I can buy an item in Google Play. I can also use the web interface on https://play.google.com/. The web interface does not require the password for buying an item.

Moreover, the attacker does not need the victim to be logged in a Google account in a browser on the stolen device. Once the Google account is present in the device (which very likely due to the connections to the Android ecosystem), we can use the account also in a web browser. We just need a tool, which is often pre-installed in Android devices. I am talking about Google Chrome for Android, which suggest the attack when you are on the Google login page:

Well, it is unclear from the screenshot if there is a real attack possible. For example, Google might consider this login method to be something inferior, so Google would ask for password when buying an application. This is, however, not the case. Google allows you to use this passwordless login for buying apps without knowing the password.

There is one more issue. The attacker can install any application (paid or free) on other devices of the victim. For example, If you have your tablet stolen, the thief might abuse this feature for spying your phone.

How could Google fix it?

I've suggested some countermeasures:

  • Remove the passwordless login feature. This would surely mitigate these attacks, but it costs too much of user convenience and there are some more convenient ways.
  • If user uses the passwordless login, the Google Play webapp would require the user's password for any application installation request. If user logs in with the password, Google would allow installing apps without entering the password again.
  • The password would be required always when the user purchases some item in Google Play.
  • Some combination of the above. My preferred approach is asking for password when user buys an item (regardless the authentication method) and asking for password when installing any application (either paid or free) on a remote device using the passwordless login feature. However, when user uses, say, Firefox for Android, so he can log in only with the password-based authentication, he would allow the attacker to install any free application on other devices of the victim.

How can I defend myself?

First, when you lose an Android device, you should change your Google account password as soon as possible. (I also recommend changing all the passwords of other affected accounts, not just the Google account.) This performs a remote logout on the Android devices.

Screen lock might help, but it can be bypassed in general. In some cases, it might be very easy, e.g. on phone with enough access to recovery. In some cases, it might be hard, but one can disassemble the phone and directly access the flash memory. (Well, this extreme case is hard and might not be worth the cost.) Nevertheless, screen lock is likely to discourage some people.

Remote wipe tools can also help, but they should not be a primary countermeasure for this issue. First, I advise you to change the password regardless of remote wipe tools, because you can never be sure if you have it done in time. Moreover, I am not aware of any secure delete functionality in Android remote wipe tools. Of course, when you change the password, there might be still some other reasons for doing a remote wipe, so I don't suggest remote wipe tools to be useless. They are useful, but you should not rely on them too much…

And of course, the best countermeasure is not having your device lost :)

Issues outside the Google Play

Of course, there are some other parts Google ecosystem affected by passwordless login.

Two-factor authentication

There are some apps (e.g. Android) not supporting the two-factor authentication, so Google allows you to generate an application-specific password for these purposes. In order to generate an application-specific password, you have to re-enter your password, which is good. However, it used to be enough to use the password-less authentication in Android for generating new application-specific password. This could be abused by a thief of an Android device for having an access to the account even after the user changes the password.

Well, Google sends an e-mail when user generates a new application-specific password, but the attacker is very likely to have access to his GMail account, so he can easily delete it.

It is worth noting that this used to be also an issue for Android non-users. An adversary was able to abuse this feature for cloning an application-specific password and use the cloned one even after the old one is revoked. Some social engineering (like choosing a good name for it) might be needed for successful attack.

Fortunately, this issue was fixed quickly after I reported it.

Access to history and some other more protected data

Google tries to protect some data more than others. For example, when you go to https://history.google.com/, Google is likely to require your password even if you are logged in. The passwordless login seems to weaken this extra protection. Google sees this to be just a feature, not a bug. You can see the history data by using Google Search app. So, mobile devices (including tablets) seem to have a different security policy from desktops. It might be confusing, but we should be aware of it.

úterý 20. ledna 2015

V Google Play lze obejít ochranu nákupů heslem. Jak se bránit?

Google Play umožňuje nakupovat aplikace, knihy a hudbu. Jakmile jednou vyplníte způsob platby (např. platební karta nebo vyúčtování operátora), uloží se a můžete toho využít při přístím nákupu. Od určité doby se Google rozhodl ochránit tyto nákupy heslem. Tato snaha je určitě chvályhodná, pokud by to ale nešlo obejít. Takto máme místo zabezpečení spíše nesplněný slib, který může mít spíše opačné účinky – uživatel se může na zabezpečení spoléhat, to ale nebude fungovat.

Další problém nastává, pokud máte více zařízení s Androidem. Případný zloděj jednoho z těchto zařízení Vám může instalovat aplikace na jiné zařízení bez Vašeho vědomí.

Článek slouží pouze jako varování před bezpečnostními problémy, ne jako návod na zneužití chyby.

Google chybu opravovat nechce.

Přesněji řečeno, nechce opravovat tu část v Google Play. Problém postihoval i například dvoufaktorovou autentizaci, ale tam to již Google opravil velmi brzy po nahlášení. O dalších dopadech ale později.

Zajímavé je, že mi Google vyplatil odměnu za nalezení bezpečnostního problému a zařadil mě do síně slávy, ale přesto to opravovat nechtějí.

Kde je problém?

Na Google Play můžeme nakupovat přes aplikaci pro Android. Ta chce heslo. Způsob, jak jej ověřuje jsem nezkoumal, předpokládám ale, že jej pošle serveru a že (snad) server tudy nedovolí nákup bez potřebného ověření. To ale není jediný způsob, jak mohu nakoupit v Google Play. Druhá možnost je navštívit https://play.google.com/ a nakoupit přes webové rozhraní. Webové rozhraní nepožaduje nákup znovu potvrdit heslem.

Možná se zdá, že útočník potřebuje uživatele, který zůstal v prohlížeči přihlášený ke svému účtu u Google. Není tomu tak. Jakmile v telefonu je účet Google (což obvykle je, pokud chce uživatel používat Google Play apod.), můžeme se s ním totiž přihlásit i ve webovém prohlížeči. Stačí nám na to jednoduchý nástroj, který je navíc v mnohých telefonech a tabletech již předinstalovaný. Jedná se o Google Chrome pro Android. Je to velmi jednoduché, stačí navštívit stránku s přihlášením a Chrome Vám řekne, co máte udělat:

Teoreticky v této chvíli útočník ještě nemá nutně vyhráno. Google by mohl brát přihlášení touto cestou jako „méněcenné“ a pro nákup přesto chtít heslo. Na svém vlastním účtu jsem si ale vyzkoušel, že zde Google heslo nevyžaduje.

Další problém je, že tudy lze instalovat aplikace (jak placené, tak ty zdarma) na libovolné zařízení spojené s tímto účtem Google. Pokud například ztratíte telefon, zloděj by mohl této vlastnosti zneužít ke špehování Vašeho telefonu.

Jak by to mohl Google opravit?

Googlu jsem navrhoval několik variant:

  • Odstranit automatické přihlašování. Účinné řešení, ale zbytečně radikální.
  • Pokud se uživatel přihlásil přes automatické přihlášení, chtělo by se po něm při instalaci aplikace přes webový Google Play heslo. Pokud se uživatel přihlásil zadáním přihlašovacích údajů, heslo by se po něm nechtělo.
  • Heslo by bylo vyžadováno na každý nákup, ale ne pro aplikace zdarma.
  • Nějaká kombinace výše uvedených pravidel. Preferoval bych, kdyby se Google ptal na heslo jak při nákupu jakékoli aplikace i přes webové rozhraní (i kdyby byl uživatel přihlášen na počítači přes jméno a heslo), tak v případě automatického přihlášení při instalaci jakékoli aplikace (třeba i aplikace zdarma) na vzdálené zařízení. Nicméně, pokud se uživatel z nějakého důvodu přihlásí ke svému účtu na mobilu v jiném prohlížeči (a tedy nutně použije heslo), třeba jen kvůli vyhledávání, umožní to útočníkovi instalovat neplacené aplikace na jiná zařízení uživatele.

Jak se bránit?

Zaprvé, při ztrátě telefonu nebo tabletu s Androidem co nejdříve změnit heslo k účtu Google. (Je samozřejmě vhodné změnit i hesla k ostatním účtům.) Tím ztracený telefon nebo tablet vzdáleně odhlásíte.

Samozřejmě může pomoci nějaký i zámek obrazovky, ten ale v principu lze obejít. Někdy to lze snadno (extrém je rootnutý telefon se zapnutým USB laděním, ale to už dnes není tak jednoduché zneužít – novější Android požaduje povolit klíč počítače), jindy obtížněji (teoreticky vždy můžeme telefon rozebrat a dostat z něj třeba flash paměť, otázka je, jestli to stojí za to). Každopádně zámek obrazovky telefonu může někoho odradit.

A samozřejmě ze všeho nejlepší je telefon ani tablet neztratit :)

Týká se to pouze Google Play?

Jak je možná zřejmé, tento problém se netýká výhradně Google Play, ale měl trošku více dopadů. Dříve jsem o dalších dopadech mlčel, protože by mohly naznačit podstatu chyby.

Dvoufaktorová autentizace

Ne všechny aplikace podporují dvoufaktorovou autentizaci, takže Google umožňuje si nechat vygenerovat speciální heslo, které budete používat v jedné konkrétní aplikaci. Google to zcela správně ochránil heslem. Jenže, jak možná tušíte, nebylo potřeba znát heslo. Stačilo mít účet Google v Androidu a bylo možné podobnou cestou generovat nová speciální hesla. Google sice uživateli poslal e-mail, že vygeneroval nové application-specific password, ale to nemuselo být moc platné, když útočník měl typicky i přístup k jeho e-mailu a mohl jej smazat…

Stojí za zmínku, že bylo možné takto „rozmnožit“ tato speciální hesla. Pomocí speciálního hesla je možné se přihlásit do Androidu. S přihlášením do Androidu potom bylo možné výše uvedeným způsobem získat nové speciální heslo.

Celý tento problém s dvoufaktorovou autentizací ale Google opravil brzy po nahlášení.

Přístup k historii a dalším datům s vyšší ochranou

Když jdu například na https://history.google.com/, Google po mě chce zopakovat heslo. Chápu to tak, že historie vyhledávání patří mezi data, která si podle Google zasluhují vyšší ochranu, a proto vyžaduje zadat heslo znovu. Automatické přihlášení v Google Chrome pro Android ale tuto zvýšenou ochranu narušuje. Jenže to není bráno za slabinu, protože v Androidu lze tuto historii prohlížet i jinudy. Rozumím, že bezpečnostní zásady na desktopu se mohou lišit od těch na mobilu. Je to sice trošku matoucí, ale chápu to.