mirror of
https://github.com/github/codeql.git
synced 2026-04-26 09:15:12 +02:00
JS: Fix: Now Array.prototype.with is properly flagged as taint step
This commit is contained in:
@@ -477,7 +477,7 @@ private module ArrayLibraries {
|
||||
private class ImmutableArrayTransformStep extends TaintTracking::SharedTaintStep {
|
||||
override predicate heapStep(DataFlow::Node pred, DataFlow::Node succ) {
|
||||
exists(DataFlow::MethodCallNode call |
|
||||
call.getMethodName() in ["toSorted", "toReversed"] and
|
||||
call.getMethodName() in ["toSorted", "toReversed", "with"] and
|
||||
pred = call.getReceiver() and
|
||||
succ = call
|
||||
)
|
||||
|
||||
@@ -244,6 +244,8 @@ typeInferenceMismatch
|
||||
| tst.js:2:13:2:20 | source() | tst.js:66:10:66:16 | xSorted |
|
||||
| tst.js:2:13:2:20 | source() | tst.js:68:10:68:23 | x.toReversed() |
|
||||
| tst.js:2:13:2:20 | source() | tst.js:70:10:70:18 | xReversed |
|
||||
| tst.js:2:13:2:20 | source() | tst.js:72:10:72:17 | x.with() |
|
||||
| tst.js:2:13:2:20 | source() | tst.js:74:10:74:14 | xWith |
|
||||
| xml.js:5:18:5:25 | source() | xml.js:8:14:8:17 | text |
|
||||
| xml.js:12:17:12:24 | source() | xml.js:13:14:13:19 | result |
|
||||
| xml.js:23:18:23:25 | source() | xml.js:20:14:20:17 | attr |
|
||||
|
||||
@@ -69,7 +69,7 @@ function test() {
|
||||
const xReversed = x.toReversed();
|
||||
sink(xReversed) // NOT OK
|
||||
|
||||
sink(x.with()) // NOT OK -- Should be flagged as a taint sink, but it is not
|
||||
sink(x.with()) // NOT OK
|
||||
const xWith = x.with();
|
||||
sink(xWith) // NOT OK -- Should be flagged as a taint sink, but it is not
|
||||
sink(xWith) // NOT OK
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user