File tree Expand file tree Collapse file tree 4 files changed +21
-26
lines changed
semmle/code/java/security Expand file tree Collapse file tree 4 files changed +21
-26
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1212
1313import java
1414import semmle.code.java.dataflow.FlowSources
15- import ServletUrlRedirect
15+ import semmle.code.java.security.UrlRedirect
1616import DataFlow:: PathGraph
1717
1818class UrlRedirectConfig extends TaintTracking:: Configuration {
Original file line number Diff line number Diff line change 1212
1313import java
1414import semmle.code.java.dataflow.FlowSources
15- import ServletUrlRedirect
15+ import semmle.code.java.security.UrlRedirect
1616import DataFlow:: PathGraph
1717
1818class UrlRedirectLocalConfig extends TaintTracking:: Configuration {
Original file line number Diff line number Diff line change 11import java
22import semmle.code.java.dataflow.DataFlow
3+ import semmle.code.java.frameworks.Servlets
34
45/** A URL redirection sink */
56abstract class UrlRedirectSink extends DataFlow:: Node { }
7+
8+ /** A Servlet URL redirection sink. */
9+ class ServletUrlRedirectSink extends UrlRedirectSink {
10+ ServletUrlRedirectSink ( ) {
11+ exists ( MethodAccess ma |
12+ ma .getMethod ( ) instanceof HttpServletResponseSendRedirectMethod and
13+ this .asExpr ( ) = ma .getArgument ( 0 )
14+ )
15+ or
16+ exists ( MethodAccess ma |
17+ ma .getMethod ( ) instanceof ResponseSetHeaderMethod or
18+ ma .getMethod ( ) instanceof ResponseAddHeaderMethod
19+ |
20+ ma .getArgument ( 0 ) .( CompileTimeConstantExpr ) .getStringValue ( ) = "Location" and
21+ this .asExpr ( ) = ma .getArgument ( 1 )
22+ )
23+ }
24+ }
You can’t perform that action at this time.
0 commit comments