File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
semmle/code/java/security Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,10 @@ class XSSConfig extends TaintTracking::Configuration {
2323 override predicate isSink ( DataFlow:: Node sink ) { sink instanceof XssSink }
2424
2525 override predicate isSanitizer ( DataFlow:: Node node ) { node instanceof XssSanitizer }
26+
27+ override predicate isAdditionalTaintStep ( DataFlow:: Node node1 , DataFlow:: Node node2 ) {
28+ any ( XssAdditionalTaintStep s ) .step ( node1 , node2 )
29+ }
2630}
2731
2832from DataFlow:: PathNode source , DataFlow:: PathNode sink , XSSConfig conf
Original file line number Diff line number Diff line change @@ -14,6 +14,20 @@ abstract class XssSink extends DataFlow::Node { }
1414
1515abstract class XssSanitizer extends DataFlow:: Node { }
1616
17+ /**
18+ * A unit class for adding additional taint steps.
19+ *
20+ * Extend this class to add additional taint steps that should apply to the XSS
21+ * taint configuration.
22+ */
23+ abstract class XssAdditionalTaintStep extends TaintTracking2:: Unit {
24+ /**
25+ * Holds if the step from `node1` to `node2` should be considered a taint
26+ * step for all configurations.
27+ */
28+ abstract predicate step ( DataFlow:: Node node1 , DataFlow:: Node node2 ) ;
29+ }
30+
1731private class DefaultXssSink extends XssSink {
1832 DefaultXssSink ( ) {
1933 exists ( HttpServletResponseSendErrorMethod m , MethodAccess ma |
You can’t perform that action at this time.
0 commit comments