Skip to content

Commit be24b29

Browse files
committed
Add UrlRedirectLocalQuery.qll
1 parent 0249187 commit be24b29

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 to reason about URL redirection from local sources. */
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 to reason about URL redirection from local sources.
9+
*/
10+
module UrlRedirectLocalConfig implements DataFlow::ConfigSig {
11+
predicate isSource(DataFlow::Node source) { source instanceof LocalUserInput }
12+
13+
predicate isSink(DataFlow::Node sink) { sink instanceof UrlRedirectSink }
14+
}
15+
16+
/**
17+
* Taint-tracking flow for URL redirection from local sources.
18+
*/
19+
module UrlRedirectLocalFlow = TaintTracking::Global<UrlRedirectLocalConfig>;

java/ql/src/Security/CWE/CWE-601/UrlRedirectLocal.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 UrlRedirectLocalConfig implements DataFlow::ConfigSig {
19-
predicate isSource(DataFlow::Node source) { source instanceof LocalUserInput }
20-
21-
predicate isSink(DataFlow::Node sink) { sink instanceof UrlRedirectSink }
22-
}
23-
24-
module UrlRedirectLocalFlow = TaintTracking::Global<UrlRedirectLocalConfig>;
25-
15+
import semmle.code.java.security.UrlRedirectLocalQuery
2616
import UrlRedirectLocalFlow::PathGraph
2717

2818
from UrlRedirectLocalFlow::PathNode source, UrlRedirectLocalFlow::PathNode sink

0 commit comments

Comments
 (0)