Merge pull request #10241 from joefarebrother/android-webview-dubugging

Java: Add query for WebView debugging enabled
This commit is contained in:
Joe Farebrother
2022-09-28 10:50:51 +01:00
committed by GitHub
17 changed files with 143 additions and 1 deletions

View File

@@ -0,0 +1 @@
//semmle-extractor-options: --javac-args -cp ${testdir}/../../../../stubs/google-android-9.0.0

View File

@@ -0,0 +1,23 @@
import android.webkit.WebView;
class Test {
boolean DEBUG_BUILD;
void test1() {
WebView.setWebContentsDebuggingEnabled(true); // $hasValueFlow
}
void test2(){
if (DEBUG_BUILD) {
WebView.setWebContentsDebuggingEnabled(true);
}
}
void test3(boolean enabled){
WebView.setWebContentsDebuggingEnabled(enabled); // $hasValueFlow
}
void test4(){
test3(true);
}
}

View File

@@ -0,0 +1,11 @@
import java
import TestUtilities.InlineFlowTest
import semmle.code.java.security.WebviewDubuggingEnabledQuery
class HasFlowTest extends InlineFlowTest {
override DataFlow::Configuration getTaintFlowConfig() { none() }
override DataFlow::Configuration getValueFlowConfig() {
result = any(WebviewDebugEnabledConfig c)
}
}

View File

@@ -1 +1 @@
//semmle-extractor-options: --javac-args -cp ${testdir}/../../../stubs/google-android-9.0.0
//semmle-extractor-options: --javac-args -cp ${testdir}/../../../../stubs/google-android-9.0.0