Sbouamri / Approver

Test repository
0 stars 0 forks source link

[ID: WEBVIEW_ALLOW_FILE_ACCESS] WebView Local File Access Attacks Checking #89

Open Sbouamri opened 5 years ago

Sbouamri commented 5 years ago

Found setAllowFileAccess(true) or not set (enabled by default) in WebView. The attackers could inject malicious script into WebView and exploit the opportunity to access local resources. REMEDIATION: This vulnerability can be mitigated by disabling local file system access (which is enabled by default) by setting yourWebView.getSettings().setAllowFileAccess(false). This precaution disables the file system access only. Assets and resources are still accessible using URIs, like file:///android_asset and file:///android_res. The attackers can still use method yourWebView.loadUrl("file:///data/data/[your_package_name]/[file]"); to access app's local file. Vulnerable Code:

string Lorg/csploit/android/plugins/mitm/hijacker/HijackerWebView;->onCreate(Landroid/os/Bundle;)V