Skip to content

Commit da69681

Browse files
committed
JS: Convert 'split' taint step to legacy taint step
1 parent 133b016 commit da69681

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

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

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,16 @@ module TaintTracking {
356356
}
357357
}
358358

359+
private class LegacySplitTaintStep extends LegacyTaintStep {
360+
override predicate stringManipulationStep(DataFlow::Node pred, DataFlow::Node target) {
361+
exists(DataFlow::MethodCallNode call |
362+
call.getMethodName() = "split" and
363+
pred = call.getReceiver() and
364+
target = call
365+
)
366+
}
367+
}
368+
359369
/**
360370
* A taint propagating data flow edge arising from string manipulation
361371
* functions defined in the standard library.
@@ -372,9 +382,8 @@ module TaintTracking {
372382
[
373383
"anchor", "big", "blink", "bold", "concat", "fixed", "fontcolor", "fontsize",
374384
"italics", "link", "padEnd", "padStart", "repeat", "replace", "replaceAll", "slice",
375-
"small", "split", "strike", "sub", "substr", "substring", "sup",
376-
"toLocaleLowerCase", "toLocaleUpperCase", "toLowerCase", "toUpperCase", "trim",
377-
"trimLeft", "trimRight"
385+
"small", "strike", "sub", "substr", "substring", "sup", "toLocaleLowerCase",
386+
"toLocaleUpperCase", "toLowerCase", "toUpperCase", "trim", "trimLeft", "trimRight"
378387
]
379388
or
380389
// sorted, interesting, properties of Object.prototype

0 commit comments

Comments
 (0)