Skip to content

Commit 9ec3d77

Browse files
committed
Add option for default taint sanitizer guard
This allows languages to specify A sanitizer guard in all global taint flow configurations but not in local taint.
1 parent 4d797d6 commit 9ec3d77

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
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
@@ -113,6 +113,13 @@ private module Cached {
113113
node.getEnclosingCallable().getDeclaringType() instanceof NonSecurityTestClass or
114114
node.asExpr() instanceof ValidatedVariableAccess
115115
}
116+
117+
/**
118+
* Holds if `guard` should be a sanitizer guard in all global taint flow configurations
119+
* but not in local taint.
120+
*/
121+
cached
122+
predicate defaultTaintSanitizerGuard(DataFlow::BarrierGuard guard) { none() }
116123
}
117124

118125
import Cached

java/ql/lib/semmle/code/java/dataflow/internal/tainttracking1/TaintTrackingImpl.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ abstract class Configuration extends DataFlow::Configuration {
9393
predicate isSanitizerGuard(DataFlow::BarrierGuard guard) { none() }
9494

9595
final override predicate isBarrierGuard(DataFlow::BarrierGuard guard) {
96-
this.isSanitizerGuard(guard)
96+
this.isSanitizerGuard(guard) or defaultTaintSanitizerGuard(guard)
9797
}
9898

9999
/**

0 commit comments

Comments
 (0)