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 12
12
13
13
import java
14
14
import semmle.code.java.dataflow.FlowSources
15
- import ServletUrlRedirect
15
+ import semmle.code.java.security.UrlRedirect
16
16
import DataFlow:: PathGraph
17
17
18
18
class UrlRedirectConfig extends TaintTracking:: Configuration {
Original file line number Diff line number Diff line change 12
12
13
13
import java
14
14
import semmle.code.java.dataflow.FlowSources
15
- import ServletUrlRedirect
15
+ import semmle.code.java.security.UrlRedirect
16
16
import DataFlow:: PathGraph
17
17
18
18
class UrlRedirectLocalConfig extends TaintTracking:: Configuration {
Original file line number Diff line number Diff line change 1
1
import java
2
2
import semmle.code.java.dataflow.DataFlow
3
+ import semmle.code.java.frameworks.Servlets
3
4
4
5
/** A URL redirection sink */
5
6
abstract 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