Java: Add parameters of @JavascriptInterface methods as a remote flow sources

This commit is contained in:
Ed Minnix
2022-12-08 13:53:40 -05:00
parent f9b8200009
commit ab7ca1d642
2 changed files with 20 additions and 0 deletions

View File

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

View File

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