mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
Merge pull request #10241 from joefarebrother/android-webview-dubugging
Java: Add query for WebView debugging enabled
This commit is contained in:
@@ -0,0 +1 @@
|
||||
//semmle-extractor-options: --javac-args -cp ${testdir}/../../../../stubs/google-android-9.0.0
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user