Skip to content

Commit 7cc5312

Browse files
committed
Java: WebView setAllowContentAccess query test cases
1 parent a023726 commit 7cc5312

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
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. |
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.example.test;
2+
3+
import android.webkit.WebView;
4+
import android.webkit.WebSettings;
5+
6+
public class WebViewContentAccess {
7+
void configureWebViewUnsafe(WebView view) {
8+
WebSettings settings = view.getSettings();
9+
10+
settings.setAllowContentAccess(true);
11+
}
12+
13+
void configureWebViewSafe(WebView view) {
14+
WebSettings settings = view.getSettings();
15+
16+
settings.setAllowContentAccess(false);
17+
}
18+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Security/CWE/CWE-200/AndroidWebViewSettingsContentAccess.ql

0 commit comments

Comments
 (0)