Java: test files for WebView file access query

This commit is contained in:
Ed Minnix
2022-11-14 15:11:15 -05:00
parent 73d6360eee
commit 7a0544d80e
4 changed files with 19 additions and 1 deletions

View File

@@ -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. |

View File

@@ -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);
}
}

View File

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

View File

@@ -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