Merge rc/1.18 into master.

This commit is contained in:
Aditya Sharad
2018-09-05 15:32:30 +01:00
145 changed files with 620 additions and 373 deletions

View File

@@ -208,6 +208,11 @@ class TopLevel extends @toplevel, StmtContainer {
override string toString() {
result = "<toplevel>"
}
override predicate isAmbient() {
getFile().getFileType().isTypeScript() and
getFile().getBaseName().matches("%.d.ts")
}
}
/**

View File

@@ -214,6 +214,9 @@ module TaintTracking {
m.getMethodName() = "map" and
m.getArgument(0) = f and // Require the argument to be a closure to avoid spurious call/return flow
pred = f.getAReturnedExpr().flow())
or
// `array.push(e)`: if `e` is tainted, then so is `array`
succ.(DataFlow::SourceNode).getAMethodCall("push").getAnArgument() = pred
)
or
// reading from a tainted object yields a tainted result
@@ -508,6 +511,19 @@ module TaintTracking {
}
}
/**
* A taint propagating data flow edge arising from sorting.
*/
private class SortTaintStep extends AdditionalTaintStep, DataFlow::MethodCallNode {
SortTaintStep() {
getMethodName() = "sort"
}
override predicate step(DataFlow::Node pred, DataFlow::Node succ) {
pred = getReceiver() and succ = this
}
}
/**
* A conditional checking a tainted string against a regular expression, which is
* considered to be a sanitizer for all configurations.