Skip to content

Commit 6707e34

Browse files
committed
JS: Prevent bad join ordering
1 parent 06dd3ab commit 6707e34

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

javascript/ql/src/semmle/javascript/dataflow/TaintTracking.qll

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -737,12 +737,17 @@ module TaintTracking {
737737
read = getAStaticCaptureRef()
738738
or
739739
exists(ControlFlowNode mid |
740-
mid = getANodeReachingCaptureRef(read) and
741-
not mid = getACaptureSetter(_) and
742-
result = mid.getAPredecessor()
740+
result = getANodeReachingCaptureRefAux(read, mid) and
741+
not mid = getACaptureSetter(_)
743742
)
744743
}
745744

745+
pragma[nomagic]
746+
private ControlFlowNode getANodeReachingCaptureRefAux(DataFlow::PropRead read, ControlFlowNode mid) {
747+
mid = getANodeReachingCaptureRef(read) and
748+
result = mid.getAPredecessor()
749+
}
750+
746751
/**
747752
* Holds if there is a step `pred -> succ` from the input of a RegExp match to
748753
* a static property of `RegExp` defined.

0 commit comments

Comments
 (0)