Vulnerabilities in apps are always a cause for concern, especially when said apps handle sensitive information, particularly financial. We examined two popular in-app payment (IAP) SDKs—Google Wallet and the Chinese payment platform Alipay—and discovered that these contain a vulnerability that can be exploited for phishing attacks. The versions we analyzed were Google IAP versions 2 and 3 and Alipay SDK 1.0.
We have notified the developers of these findings. As of this writing, Alipay has patched the vulnerability. Meanwhile, Google is encouraging developers to use a newer version of its platform, which offers better security. They have also notified developers of several apps who are using the specific SDKs.
The Issue with Intents and Intent-Filters
The vulnerability is related to the intent and intent filter used by the apps. The intent is a “messaging object” that can be used to request an action or process from an app component. They (intents) can be used for communication between app components. Explicit intents are used if the developer wants an action to be performed by a specific component in a specific app. Implicit intents are used when a developer allows the process to be performed by components of other apps. For example, if an app needs to show the user a specific location, it can allow a different app to receive the GPS location.
The Android platform uses intent-filters of apps to determine which app can perform the implicit intent. If an app contains the matching intent-filter, it can perform the task requested by the intent.
There appears to be a flaw in the communication between the mobile payment application and the payment client applications. The mobile payment apps used an implicit intent, which can be intercepted by a malicious app via a high priority intent filter. An intent filter can be made “high priority” by combining several system APIs.
The Flaw in the Google Wallet SDK
For transactions involving the affected Google Wallet SDK, the app must communicate with the Google Play app on the device so that Google Play can notify the user about the payment and then request confirmation.
Figure 1. Confirmation message
However, the IAP SDK uses an implicit intent, ACTION=”com.android.vending.billing.MarketBillingService.BIND,” which can be intercepted by the intent filter action android:name=”com.android.vending.billing.MarketBillingService.BIND.” A malicious app can use the same intent-filter to display a phishing page such as the one below.
Figure 2. Sample phishing message
Phishing Via the Alipay SDK
Alipay has the same process as that of Google Wallet. After the user clicks the “pay” button, the app will communicate with the Alipay mobile client so that the client will display a confirmation message. And just like the flaw in Google Wallet, the communication can be intercepted by a malicious app by using the same intent-filter. In this case, the intent filter is action android:name=”com.alipay.android.app.IAlixPay.” The malicious app can then send its own message in lieu of the legitimate message.
Figure 3. Fake Alipay message
Third party apps employ Google Wallet or Alipay SDK to communicate to the legitimate Google Wallet or Alipay SDK and for real payment process. The purpose of the said SDK is to send the pay intent to the Google Wallet or Alipay. A malicious app can replace the real Google Wallet or Alipay to receive the payment intent.
For example users make a payment via third party apps and of course, they expect to see the legitimate Google Wallet or Alipay. In this case, however, a phishing app may come out to appear like the real Google Wallet or Alipay. As such, users may trust the phishing app and input his/her password and bank account details.
Phishing and Financial Loss
These fake messages show the potential for phishing attacks. However, phishing attacks could just be the beginning. Once cybercriminals have access to user accounts, they can then proceed to steal information stored in the account. Given that the affected apps handle payments, it’s a very likely that credit card and other payment information could be stolen. They can then use that information or sell it in the cybercriminal underground.
Moreover, users may not suspect these malicious messages. Since the apps handle payments, they might assume that the messages are simply intended to confirm the accounts before proceeding with the actual payment.
Fixing the Flaw
Developers should always use explicit intents for processes dealing with sensitive information. In such cases, only the desired app will be able to perform the process, minimizing the possibility of interception via malicious app. However, explicit intents are not enough. Developers can also require that their apps check for the signatures of other apps as proof of their legitimacy before communicating with them.
As previously mentioned, we informed Google and Alipay about this issue on May 27th. Alipay fixed the issue by July 18th, rolling out the SDK version 2.0. Google has informed us that the current IAP code includes code that uses an explicit intent. We advise developers to use these new versions for their applications. Google has also stated that they are currently monitoring for and have not seen any evidence of exploits of the said vulnerability.
We continue to actively monitor for any threats that may take advantage of this vulnerability. We advise users to install security software in their mobile devices to detect and block malicious apps that may take advantage of vulnerabilities such as this one.