Skip to content

Commit caf5f4d

Browse files
committed
modified comment
1 parent a0cd551 commit caf5f4d

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

java/ql/src/experimental/Security/CWE/CWE-601/SpringUrlRedirect.ql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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

java/ql/src/experimental/Security/CWE/CWE-601/SpringUrlRedirect.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import semmle.code.java.dataflow.DataFlow2
55
import semmle.code.java.dataflow.TaintTracking
66
import 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

0 commit comments

Comments
 (0)