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 {
2929 override predicate isSanitizer ( DataFlow:: Node node ) {
3030 // Exclude the case where the left side of the concatenated string is not `redirect:`.
3131 // 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.
3234 exists ( AddExpr ae |
3335 ae .getRightOperand ( ) = node .asExpr ( ) and
3436 not ae instanceof RedirectBuilderExpr
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import semmle.code.java.dataflow.DataFlow2
55import semmle.code.java.dataflow.TaintTracking
66import semmle.code.java.frameworks.spring.SpringController
77
8- class StartsWithSanitizer extends DataFlow:: BarrierGuard {
8+ private class StartsWithSanitizer extends DataFlow:: BarrierGuard {
99 StartsWithSanitizer ( ) {
1010 this .( MethodAccess ) .getMethod ( ) .hasName ( "startsWith" ) and
1111 this .( MethodAccess ) .getMethod ( ) .getDeclaringType ( ) instanceof TypeString and
You can’t perform that action at this time.
0 commit comments