don't have a MembershipTestBarrierGuard in Configuration.qll

This commit is contained in:
Erik Krogh Kristensen
2020-06-04 16:13:49 +02:00
parent b7a3c4a3d6
commit ed4e1bbbdf
2 changed files with 7 additions and 18 deletions

View File

@@ -1814,19 +1814,3 @@ class VarAccessBarrier extends DataFlow::Node {
)
}
}
/**
* A check of the form `whitelist.includes(x)` or equivalent, which sanitizes `x` in its "then" branch.
*
* Can be added to `isBarrierGuard` in a data-flow configuration to block flow through such checks.
*/
class MembershipTestBarrierGuard extends BarrierGuardNode {
MembershipCandidate candidate;
MembershipTestBarrierGuard() { this = candidate.getTest() }
override predicate blocks(boolean outcome, Expr e) {
candidate = e.flow() and
candidate.getTestPolarity() = outcome
}
}

View File

@@ -373,9 +373,14 @@ module TaintedPath {
/**
* A check of the form `whitelist.includes(x)` or equivalent, which sanitizes `x` in its "then" branch.
*/
class MembershipTestBarrierGuard extends BarrierGuardNode, DataFlow::MembershipTestBarrierGuard {
class MembershipTestBarrierGuard extends BarrierGuardNode {
MembershipCandidate candidate;
MembershipTestBarrierGuard() { this = candidate.getTest() }
override predicate blocks(boolean outcome, Expr e) {
DataFlow::MembershipTestBarrierGuard.super.blocks(outcome, e)
candidate = e.flow() and
candidate.getTestPolarity() = outcome
}
}