mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Java: test files for WebView file access query
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
| WebViewFileAccess.java:8:9:8:41 | setAllowFileAccess(...) | WebView setting setAllowFileAccess may allow for unauthorized access of sensitive information. |
|
||||
| WebViewFileAccess.java:10:9:10:53 | setAllowFileAccessFromFileURLs(...) | WebView setting setAllowFileAccessFromFileURLs may allow for unauthorized access of sensitive information. |
|
||||
| WebViewFileAccess.java:12:9:12:58 | setAllowUniversalAccessFromFileURLs(...) | WebView setting setAllowUniversalAccessFromFileURLs may allow for unauthorized access of sensitive information. |
|
||||
@@ -0,0 +1,14 @@
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebSettings;
|
||||
|
||||
class WebViewFileAccess {
|
||||
void configure(WebView view) {
|
||||
WebSettings settings = view.getSettings();
|
||||
|
||||
settings.setAllowFileAccess(true);
|
||||
|
||||
settings.setAllowFileAccessFromFileURLs(true);
|
||||
|
||||
settings.setAllowUniversalAccessFromFileURLs(true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
Security/CWE/CWE-200/AndroidWebViewSettingsFileAccess.ql
|
||||
@@ -1 +1 @@
|
||||
//semmle-extractor-options: --javac-args -cp ${testdir}/../../../../../stubs/apache-commons-lang3-3.7/
|
||||
//semmle-extractor-options: --javac-args -cp ${testdir}/../../../../../stubs/apache-commons-lang3-3.7/:${testdir}/../../../../../stubs/google-android-9.0.0
|
||||
Reference in New Issue
Block a user