mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
JS: Port experimental queries
This commit is contained in:
@@ -53,11 +53,17 @@ class TaintedPathAtmConfig extends AtmConfig {
|
||||
*/
|
||||
private class BarrierGuardNodeAsSanitizerGuardNode extends TaintTracking::LabeledSanitizerGuardNode instanceof TaintedPath::BarrierGuardNode
|
||||
{
|
||||
override predicate sanitizes(boolean outcome, Expr e) {
|
||||
override predicate sanitizes(boolean outcome, Expr e) { this.blocksExpr(outcome, e) }
|
||||
|
||||
predicate blocksExpr(boolean outcome, Expr e) {
|
||||
this.blocks(outcome, e) or this.blocks(outcome, e, _)
|
||||
}
|
||||
|
||||
override predicate sanitizes(boolean outcome, Expr e, DataFlow::FlowLabel label) {
|
||||
override predicate sanitizes(boolean outcome, Expr e, DataFlow::FlowLabel lbl) {
|
||||
this.blocksExpr(outcome, e, lbl)
|
||||
}
|
||||
|
||||
predicate blocksExpr(boolean outcome, Expr e, DataFlow::FlowLabel label) {
|
||||
this.sanitizes(outcome, e) and exists(label)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,9 @@ class TypeTestGuard extends TaintTracking::SanitizerGuardNode, DataFlow::ValueNo
|
||||
)
|
||||
}
|
||||
|
||||
override predicate sanitizes(boolean outcome, Expr e) {
|
||||
override predicate sanitizes(boolean outcome, Expr e) { this.blocksExpr(outcome, e) }
|
||||
|
||||
predicate blocksExpr(boolean outcome, Expr e) {
|
||||
polarity = outcome and
|
||||
e = operand
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user