Skip to content

Commit e5c1c07

Browse files
committed
Create DefaultTaintSanitizer
1 parent 88b3d1f commit e5c1c07

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

java/ql/lib/semmle/code/java/dataflow/internal/TaintTrackingUtil.qll

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,19 @@ private module Cached {
155155
any(AdditionalTaintStep a).step(src, sink) and model = "AdditionalTaintStep"
156156
}
157157

158+
/**
159+
* A sanitizer in all global taint flow configurations but not in local taint.
160+
*/
161+
cached
162+
abstract class DefaultTaintSanitizer extends DataFlow::Node { }
163+
158164
/**
159165
* Holds if `node` should be a sanitizer in all global taint flow configurations
160166
* but not in local taint.
161167
*/
162168
cached
163169
predicate defaultTaintSanitizer(DataFlow::Node node) {
170+
node instanceof DefaultTaintSanitizer or
164171
// Ignore paths through test code.
165172
node.getEnclosingCallable().getDeclaringType() instanceof NonSecurityTestClass or
166173
node.asExpr() instanceof ValidatedVariableAccess

0 commit comments

Comments
 (0)