This information is intended for developers with an app that contains the Sensitive JavaScript Interface Vulnerability.
What’s happening
Please refer to the notice in Play Console.
Action required
- Open the Google Play email notification sent to the account owner’s email address to see which apps are affected and the deadlines to resolve these issues.
- Update your affected apps and fix the vulnerability.
- Submit the updated versions of your affected apps.
Upon resubmission, your app will be reviewed again. This process can take several hours. If the app passes review and is published successfully, then no further action is required. If the app fails review, then the new app version will not be published and you will receive an email notification.
Additional details
According to the Device and network abuse policy, 'Apps or third-party code (for example, SDKs) with JavaScript loaded at runtime must not allow potential violations of Play developer policies'.
In this article, we refer to any object that exposes functionality to a WebView through the addJavascriptInterface
method of a WebView as a JavaScript interface as described in Google Developers blog, Building web apps in WebView.
This vulnerability class allows for potential user data and malware violations to occur through JavaScript interfaces. Depending on the exposed interfaces, this can lead to unanticipated data collection and exfiltration along with potentially harmful applications without the app or SDK developer’s knowledge.
We recommend that you prevent this vulnerability in one of the following ways:
Option 1: Ensure that WebViews do not add Objects to the JavaScript interface
Ensure that there are no objects added to the JavaScript interface of any WebView that loads untrusted web content. You can do this in two ways:
- Ensure that no objects are ever added to the JavaScript interface via calls to addJavascriptInterface.
-
Remove objects from the JavaScript interface in shouldInterceptRequest via removeJavascriptInterface before untrusted content is loaded by the WebView.
Option 2: Ensure that sensitive functionality is not exposed through a JavaScript interface
Ensure that any sensitive functionality (such as Android API calls that require permissions) is not added to JavaScript interfaces. This includes not gathering sensitive data such as information about the user/device or exposing APIs such as accessibility or SMS messaging. There are multiple ways to resolve your vulnerability this way:
- Reimplement any functionality that requires sensitive permissions or gathers sensitive information so that it is called from code packaged within the application. Ensure that prominent disclosure is provided to users.
- Remove any functions that provide access to sensitive functionality or user data that is accessible from the interface.
Option 3: Ensure that your WebView is not exposing sensitive functionality to untrusted content
If your WebView contains sensitive functionality, it may not load arbitrary JavaScript from unknown sources and must provide prominent disclosure of the data or functionality being used. Ensure that only strictly scoped URLs and content owned by the app developer are loaded into the WebView.
In the case that the vulnerability is not remediated, the app will be enforced for potential Play policy violations.
We're here to help
If you’ve reviewed the policy and feel that our decision may have been in error, please contact our policy support team. We’ll get back to you within two working days.
Thanks for your continued support in helping to make Google Play a positive experience for both developers and consumers.