Skip to content

Commit 3bd3304

Browse files
committed
Add some models for the org.lastaflute.web library
Methods annotated `@Execute` are handlers for URLs. Therefore, the parameters of the methods annotated with the `org.lastaflute.web.Execute` annotation are likely either URL parameters or forms.
1 parent 9a72914 commit 3bd3304

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
extensions:
2+
- addsTo:
3+
pack: codeql/java-all
4+
extensible: summaryModel
5+
data:
6+
- ["org.lastaflute.web.ruts.multipart", "MultipartFormFile", True, "getContentType", "()", "", "Argument[this]", "ReturnValue", "taint", "manual"]
7+
- ["org.lastaflute.web.ruts.multipart", "MultipartFormFile", True, "getFileData", "()", "", "Argument[this]", "ReturnValue", "taint", "manual"]
8+
- ["org.lastaflute.web.ruts.multipart", "MultipartFormFile", True, "getFileName", "()", "", "Argument[this]", "ReturnValue", "taint", "manual"]
9+
- ["org.lastaflute.web.ruts.multipart", "MultipartFormFile", True, "getInputStream", "()", "", "Argument[this]", "ReturnValue", "taint", "manual"]

java/ql/lib/semmle/code/java/dataflow/FlowSources.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import semmle.code.java.frameworks.android.Android
2020
import semmle.code.java.frameworks.android.ExternalStorage
2121
import semmle.code.java.frameworks.android.OnActivityResultSource
2222
import semmle.code.java.frameworks.android.Intent
23+
private import semmle.code.java.frameworks.Lastaflute
2324
import semmle.code.java.frameworks.play.Play
2425
import semmle.code.java.frameworks.spring.SpringWeb
2526
import semmle.code.java.frameworks.spring.SpringController
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import java
2+
import semmle.code.java.dataflow.FlowSources
3+
4+
/**
5+
* The `org.lastaflute.web.Execute` annotation.
6+
*/
7+
class LastafluteExecuteAnnotation extends Annotation {
8+
LastafluteExecuteAnnotation() { this.getType().hasQualifiedName("org.lastaflute.web", "Execute") }
9+
}
10+
11+
/**
12+
* The parameter of a method defining a URL handler using the Lastaflute framework.
13+
*/
14+
class LastafluteHandlerParameterSource extends RemoteFlowSource {
15+
LastafluteHandlerParameterSource() {
16+
exists(Parameter p | p.getCallable().getAnAnnotation() instanceof LastafluteExecuteAnnotation |
17+
p = this.asParameter()
18+
)
19+
}
20+
21+
override string getSourceType() { result = "Lastaflute handler parameter" }
22+
}

0 commit comments

Comments
 (0)