mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Java: Add parameters of @JavascriptInterface methods as a remote flow sources
This commit is contained in:
@@ -298,3 +298,16 @@ class OnActivityResultIntentSource extends OnActivityResultIncomingIntent, Remot
|
||||
|
||||
override string getSourceType() { result = "Android onActivityResult incoming Intent" }
|
||||
}
|
||||
|
||||
/**
|
||||
* A parameter of a method annotated with the `android.webkit.JavascriptInterface` method
|
||||
*/
|
||||
class AndroidJavascriptInterfaceMethodParameter extends RemoteFlowSource {
|
||||
AndroidJavascriptInterfaceMethodParameter() {
|
||||
exists(JavascriptInterfaceMethod m | this.asParameter() = m.getAParameter())
|
||||
}
|
||||
|
||||
override string getSourceType() {
|
||||
result = "Parameter of method with JavascriptInterface annotation"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,3 +127,10 @@ class CreateFromParcelMethod extends Method {
|
||||
this.getEnclosingCallable().getDeclaringType().getAnAncestor() instanceof TypeParcelable
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A method annotated with the `android.webkit.JavascriptInterface` annotation.
|
||||
*/
|
||||
class JavascriptInterfaceMethod extends Method {
|
||||
JavascriptInterfaceMethod() { this.hasAnnotation("android.webkit", "JavascriptInterface") }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user