{"id":"MSF-android--browser--webview_addjavascriptinterface","name":"Android Browser and WebView addJavascriptInterface Code Execution","description":"This module exploits a privilege escalation issue in Android < 4.2's WebView component that arises when untrusted JavaScript code is executed by a WebView that has one or more Interfaces added to it. The untrusted JavaScript code can call into the Java Reflection APIs exposed by the Interface and execute arbitrary commands. Some distributions of the Android Browser app have an addJavascriptInterface call tacked on, and thus are vulnerable to RCE. The Browser app in the Google APIs 4.1.2 release of Android is known to be vulnerable. A secondary attack vector involves the WebViews embedded inside a large number of Android applications. Ad integrations are perhaps the worst offender here. If you can MITM the WebView's HTTP connection, or if you can get a persistent XSS into the page displayed in the WebView, then you can inject the html/js served by this module and get a shell. Note: Adding a .js to the URL will return plain javascript (no HTML markup).","cves":["CVE-2012-6636","CVE-2013-4710"],"author":"jduck, joev","published":"2012-12-21","platform":"Android,Linux","type":"remote","language":"Ruby","source":"metasploit","sourceUrl":"https://github.com/rapid7/metasploit-framework/blob/90dfbaa741421d0179f9f371109c215d49400444/modules/exploits/android/browser/webview_addjavascriptinterface.rb","path":"modules/exploits/android/browser/webview_addjavascriptinterface.rb","revision":"90dfbaa741421d0179f9f371109c215d49400444","filename":"webview_addjavascriptinterface.rb","vulnerabilities":[{"id":"CVE-2012-6636","state":"PUBLISHED","title":null,"titleSource":null,"description":"The Android API before 17 does not properly restrict the WebView.addJavascriptInterface method, which allows remote attackers to execute arbitrary methods of Java objects by using the Java Reflection API within crafted JavaScript code that is loaded into the WebView component in an application targeted to API level 16 or earlier, a related issue to CVE-2013-4710.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2012-6636","cvss":{"version":"2.0","baseScore":6.8,"severity":"medium","vectorString":"AV:N/AC:M/Au:N/C:P/I:P/A:P","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2012-6636"},"updatedAt":"2024-08-06T21:36:01.826Z","retrievedAt":"2026-11-26T11:42:36.252Z","stale":false,"error":null},{"id":"CVE-2013-4710","state":"PUBLISHED","title":null,"titleSource":null,"description":"Android 3.0 through 4.1.x on Disney Mobile, eAccess, KDDI, NTT DOCOMO, SoftBank, and other devices does not properly implement the WebView class, which allows remote attackers to execute arbitrary methods of Java objects or cause a denial of service (reboot) via a crafted web page, as demonstrated by use of the WebView.addJavascriptInterface method, a related issue to CVE-2012-6636.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2013-4710","cvss":{"version":"2.0","baseScore":9.3,"severity":"high","vectorString":"AV:N/AC:M/Au:N/C:C/I:C/A:C","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2013-4710"},"updatedAt":"2024-08-06T16:52:27.233Z","retrievedAt":"2026-11-26T11:42:41.108Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/MSF-android--browser--webview_addjavascriptinterface.png?v=2","url":"https://exploitbin.com/exploits/MSF-android--browser--webview_addjavascriptinterface","downloadUrl":"https://exploitbin.com/api/v1/exploits/MSF-android--browser--webview_addjavascriptinterface/download","codeUrl":"https://exploitbin.com/api/v1/exploits/MSF-android--browser--webview_addjavascriptinterface/code","licenseUrl":"https://exploitbin.com/sources#metasploit"}