Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
category: minorAnalysis
---
* The `java/trust-boundary-violation` query now recognizes regular expression checks (including `String.matches()` guards and `@javax.validation.constraints.Pattern` annotations) as sanitizers, consistent with the existing treatment of ESAPI validators. This reduces false positives when input is validated against a pattern before being stored in a session.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ module TrustBoundaryConfig implements DataFlow::ConfigSig {
predicate isBarrier(DataFlow::Node node) {
node instanceof TrustBoundaryValidationSanitizer or
node.getType() instanceof HttpServletSession or
node instanceof SimpleTypeSanitizer
node instanceof SimpleTypeSanitizer or
node instanceof RegexpCheckBarrier
}

predicate isSink(DataFlow::Node sink) { sink instanceof TrustBoundaryViolationSink }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,11 @@ public void doGet(HttpServletRequest request, HttpServletResponse response) {
}
} catch (Exception e) {
}

// GOOD: Bean Validation @Pattern annotation constrains the input via regex.
String input4 = request.getParameter("input4");
if (input4.matches("[a-zA-Z0-9]+")) {
request.getSession().setAttribute("input4", input4);
}
}
}
Loading