Skip to content

Commit d777478

Browse files
committed
Java: add Spring MultipartFile as RemoteFlowSource
1 parent ae2bab7 commit d777478

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,19 @@ private class MessageBodyReaderParameterSource extends RemoteFlowSource {
103103
override string getSourceType() { result = "MessageBodyReader parameter" }
104104
}
105105

106+
private class SpringMultipartFileSource extends RemoteFlowSource {
107+
SpringMultipartFileSource() {
108+
exists(MethodAccess ma, Method m |
109+
ma = this.asExpr() and
110+
m = ma.getMethod() and
111+
m.getDeclaringType().hasQualifiedName("org.springframework.web.multipart", "MultipartFile") and
112+
m.getName().matches("get%")
113+
)
114+
}
115+
116+
override string getSourceType() { result = "Spring MultipartFile getter" }
117+
}
118+
106119
private class SpringServletInputParameterSource extends RemoteFlowSource {
107120
SpringServletInputParameterSource() {
108121
this.asParameter().getAnAnnotation() instanceof SpringServletInputAnnotation

0 commit comments

Comments
 (0)