Java: WebView setAllowContentAccess query test cases

This commit is contained in:
Ed Minnix
2022-11-16 00:05:41 -05:00
parent a023726c03
commit 7cc53126f3
3 changed files with 20 additions and 0 deletions

View File

@@ -0,0 +1 @@
| WebViewContentAccess.java:10:9:10:44 | setAllowContentAccess(...) | Sensitive information may be exposed via a malicious link due to access of content:// links being permitted. |

View File

@@ -0,0 +1,18 @@
package com.example.test;
import android.webkit.WebView;
import android.webkit.WebSettings;
public class WebViewContentAccess {
void configureWebViewUnsafe(WebView view) {
WebSettings settings = view.getSettings();
settings.setAllowContentAccess(true);
}
void configureWebViewSafe(WebView view) {
WebSettings settings = view.getSettings();
settings.setAllowContentAccess(false);
}
}

View File

@@ -0,0 +1 @@
Security/CWE/CWE-200/AndroidWebViewSettingsContentAccess.ql