File tree Expand file tree Collapse file tree 3 files changed +24
-0
lines changed
java/ql/src/semmle/code/java Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change 1919
2020## Changes to QL libraries
2121
22+ * The default set of taint sources in the ` FlowSources ` library is extended to
23+ cover parameters annotated with Spring framework annotations indicating
24+ remote user input from servlets. This affects all security queries, which
25+ will yield additional results on projects using the Spring Web framework.
2226* The ` ParityAnalysis ` library is replaced with the more general ` ModulusAnalysis ` library, which improves the range analysis.
2327
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import semmle.code.java.frameworks.android.XmlParsing
1616import semmle.code.java.frameworks.android.WebView
1717import semmle.code.java.frameworks.JaxWS
1818import semmle.code.java.frameworks.android.Intent
19+ import semmle.code.java.frameworks.SpringWeb
1920
2021/** Class for `tainted` user input. */
2122abstract class UserInput extends DataFlow:: Node { }
@@ -66,6 +67,8 @@ class RemoteUserInput extends UserInput {
6667 m .getParameter ( 4 ) = this .asParameter ( ) or
6768 m .getParameter ( 5 ) = this .asParameter ( )
6869 )
70+ or
71+ this .asParameter ( ) .getAnAnnotation ( ) instanceof SpringServletInputAnnotation
6972 }
7073
7174 /**
Original file line number Diff line number Diff line change 1+ import java
2+
3+ /** A Spring framework annotation indicating remote user input from servlets. */
4+ class SpringServletInputAnnotation extends Annotation {
5+ SpringServletInputAnnotation ( ) {
6+ exists ( AnnotationType a |
7+ a = this .getType ( ) and
8+ a .getPackage ( ) .getName ( ) = "org.springframework.web.bind.annotation"
9+ |
10+ a .hasName ( "MatrixVariable" ) or
11+ a .hasName ( "RequestParam" ) or
12+ a .hasName ( "RequestHeader" ) or
13+ a .hasName ( "CookieValue" ) or
14+ a .hasName ( "RequestPart" )
15+ )
16+ }
17+ }
You can’t perform that action at this time.
0 commit comments