Skip to content

Commit 3ccdaa9

Browse files
committed
JS: Expose argumentPassing as DataFlow::argumentPassingStep
1 parent c185ced commit 3ccdaa9

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

javascript/ql/src/Security/CWE-400/PrototypePollutionUtility.ql

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ predicate dynamicPropReadStep(Node base, Node key, SourceNode output) {
180180
keyParam.flowsTo(innerKey) and
181181
innerOutput.flowsTo(callee.getAReturnedExpr().flow()) and
182182
call.getACallee() = callee and
183-
argumentPassing(call, base, callee, baseParam) and
184-
argumentPassing(call, key, callee, keyParam) and
183+
argumentPassingStep(call, base, callee, baseParam) and
184+
argumentPassingStep(call, key, callee, keyParam) and
185185
output = call
186186
)
187187
}
@@ -198,12 +198,12 @@ predicate isEnumeratedPropName(Node node) {
198198
|
199199
node = pred.getASuccessor()
200200
or
201-
argumentPassing(_, pred, _, node)
201+
argumentPassingStep(_, pred, _, node)
202202
or
203203
// Handle one level of callbacks
204204
exists(FunctionNode function, ParameterNode callback, int i |
205205
pred = callback.getAnInvocation().getArgument(i) and
206-
argumentPassing(_, function, _, callback) and
206+
argumentPassingStep(_, function, _, callback) and
207207
node = function.getParameter(i)
208208
)
209209
)
@@ -223,7 +223,7 @@ predicate isPotentiallyObjectPrototype(SourceNode node) {
223223
exists(Node use |
224224
isPotentiallyObjectPrototype(use.getALocalSource())
225225
|
226-
argumentPassing(_, use, _, node)
226+
argumentPassingStep(_, use, _, node)
227227
)
228228
}
229229

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
import javascript
2222
private import internal.CallGraphs
23+
private import internal.FlowSteps as FlowSteps
2324

2425
module DataFlow {
2526
cached
@@ -1470,6 +1471,8 @@ module DataFlow {
14701471
)
14711472
}
14721473

1474+
predicate argumentPassingStep = FlowSteps::argumentPassing/4;
1475+
14731476
/**
14741477
* Gets the data flow node representing the source of definition `def`, taking
14751478
* flow through IIFE calls into account.

0 commit comments

Comments
 (0)