Skip to content

Commit 5834e4a

Browse files
committed
Add UrlRedirectQuery.qll
1 parent cc22a7d commit 5834e4a

File tree

2 files changed

+20
-11
lines changed

2 files changed

+20
-11
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/** Provides a taint-tracking configuration for reasoning about URL redirections. */
2+
3+
import java
4+
import semmle.code.java.dataflow.FlowSources
5+
import semmle.code.java.security.UrlRedirect
6+
7+
/**
8+
* A taint-tracking configuration for reasoning about URL redirections.
9+
*/
10+
module UrlRedirectConfig implements DataFlow::ConfigSig {
11+
predicate isSource(DataFlow::Node source) { source instanceof RemoteFlowSource }
12+
13+
predicate isSink(DataFlow::Node sink) { sink instanceof UrlRedirectSink }
14+
}
15+
16+
/**
17+
* Taint-tracking flow for URL redirections.
18+
*/
19+
module UrlRedirectFlow = TaintTracking::Global<UrlRedirectConfig>;

java/ql/src/Security/CWE/CWE-601/UrlRedirect.ql

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,7 @@
1212
*/
1313

1414
import java
15-
import semmle.code.java.dataflow.FlowSources
16-
import semmle.code.java.security.UrlRedirect
17-
18-
module UrlRedirectConfig implements DataFlow::ConfigSig {
19-
predicate isSource(DataFlow::Node source) { source instanceof RemoteFlowSource }
20-
21-
predicate isSink(DataFlow::Node sink) { sink instanceof UrlRedirectSink }
22-
}
23-
24-
module UrlRedirectFlow = TaintTracking::Global<UrlRedirectConfig>;
25-
15+
import semmle.code.java.security.UrlRedirectQuery
2616
import UrlRedirectFlow::PathGraph
2717

2818
from UrlRedirectFlow::PathNode source, UrlRedirectFlow::PathNode sink

0 commit comments

Comments
 (0)