File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed
java/ql/src/experimental/Security/CWE/CWE-601 Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,8 @@ class SpringUrlRedirectFlowConfig extends TaintTracking::Configuration {
29
29
override predicate isSanitizer ( DataFlow:: Node node ) {
30
30
// Exclude the case where the left side of the concatenated string is not `redirect:`.
31
31
// E.g: `String url = "/path?token=" + request.getParameter("token");`
32
+ // Note this is quite a broad sanitizer (it will also sanitize the right-hand side of `url = "http://" + request.getParameter("token")`);
33
+ // Consider making this stricter in future.
32
34
exists ( AddExpr ae |
33
35
ae .getRightOperand ( ) = node .asExpr ( ) and
34
36
not ae instanceof RedirectBuilderExpr
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import semmle.code.java.dataflow.DataFlow2
5
5
import semmle.code.java.dataflow.TaintTracking
6
6
import semmle.code.java.frameworks.spring.SpringController
7
7
8
- class StartsWithSanitizer extends DataFlow:: BarrierGuard {
8
+ private class StartsWithSanitizer extends DataFlow:: BarrierGuard {
9
9
StartsWithSanitizer ( ) {
10
10
this .( MethodAccess ) .getMethod ( ) .hasName ( "startsWith" ) and
11
11
this .( MethodAccess ) .getMethod ( ) .getDeclaringType ( ) instanceof TypeString and
You can’t perform that action at this time.
0 commit comments