mirror of
https://github.com/github/codeql.git
synced 2026-04-27 09:45:15 +02:00
JS: Fix: Ensure toSpliced is flagged by taint tracking in test suite (ed44358143)
This commit is contained in:
@@ -81,6 +81,11 @@ module ArrayTaintTracking {
|
||||
pred = call.getArgument(any(int i | i >= 2)) and
|
||||
succ.(DataFlow::SourceNode).getAMethodCall("splice") = call
|
||||
or
|
||||
// `array.toSpliced(x, y, source())`: if `source()` is tainted, then so is the result of `toSpliced`, but not the original array.
|
||||
call.(DataFlow::MethodCallNode).getMethodName() = "toSpliced" and
|
||||
pred = call.getArgument(any(int i | i >= 2)) and
|
||||
succ = call
|
||||
or
|
||||
// `array.splice(i, del, ...e)`: if `e` is tainted, then so is `array`.
|
||||
pred = call.getASpreadArgument() and
|
||||
succ.(DataFlow::SourceNode).getAMethodCall("splice") = call
|
||||
|
||||
Reference in New Issue
Block a user