File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
java/ql/src/semmle/code/java/frameworks/spring Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -295,3 +295,27 @@ class SpringModelResponseType extends RefType {
295295 exists ( SpringModel model | usesType ( model .getATypeInModel ( ) , this ) )
296296 }
297297}
298+
299+ /**
300+ * A user data type which may be populated from a HTTP request.
301+ *
302+ * This includes types directly referred to as either @ModelAttribute or @RequestBody parameters,
303+ * or types which are referred to by those types.
304+ */
305+ class SpringUntrustedDataType extends RefType {
306+ SpringUntrustedDataType ( ) {
307+ exists ( SpringRequestMappingParameter p |
308+ p .isModelAttribute ( )
309+ or
310+ p .getAnAnnotation ( ) .( SpringServletInputAnnotation ) .getType ( ) .hasName ( "RequestBody" )
311+ |
312+ this .fromSource ( ) and
313+ this = p .getType ( )
314+ )
315+ or
316+ exists ( SpringUntrustedDataType mt |
317+ this = mt .getAField ( ) .getType ( ) and
318+ this .fromSource ( )
319+ )
320+ }
321+ }
You can’t perform that action at this time.
0 commit comments