mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Java: WebView setAllowContentAccess query test cases
This commit is contained in:
@@ -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. |
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
Security/CWE/CWE-200/AndroidWebViewSettingsContentAccess.ql
|
||||
Reference in New Issue
Block a user