mirror of
https://github.com/github/codeql.git
synced 2026-04-28 18:25:24 +02:00
don't have a MembershipTestBarrierGuard in Configuration.qll
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user