File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
lib/semmle/javascript/internal/flow_summaries
test/library-tests/TripleDot Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -486,6 +486,11 @@ class Shift extends SummarizedCallable {
486486 preservesValue = true and
487487 input = "Argument[this].ArrayElement[0]" and
488488 output = "ReturnValue"
489+ or
490+ // ArrayElement[0] is not automatically converted to a taint step, so add it manually
491+ preservesValue = false and
492+ input = "Argument[this]" and
493+ output = "ReturnValue"
489494 }
490495}
491496
Original file line number Diff line number Diff line change @@ -13,3 +13,10 @@ function shiftUnknown() {
1313 sink ( array . shift ( ) ) ; // $ hasValueFlow=shift.unkn
1414 sink ( array . shift ( ) ) ; // $ hasValueFlow=shift.unkn
1515}
16+
17+ function shiftTaint ( ) {
18+ const array = source ( 'shift.directly-tainted' ) ;
19+ sink ( array . shift ( ) ) ; // $ hasTaintFlow=shift.directly-tainted
20+ sink ( array . shift ( ) ) ; // $ hasTaintFlow=shift.directly-tainted
21+ sink ( array . shift ( ) ) ; // $ hasTaintFlow=shift.directly-tainted
22+ }
You can’t perform that action at this time.
0 commit comments