mirror of
https://github.com/github/codeql.git
synced 2026-05-04 05:05:12 +02:00
Merge rc/1.18 into master.
This commit is contained in:
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user