mirror of
https://github.com/github/codeql.git
synced 2026-05-03 12:45:27 +02:00
JS: ErrorConstructorTaintStep
This commit is contained in:
@@ -699,9 +699,13 @@ module TaintTracking {
|
||||
/**
|
||||
* A taint step through an exception constructor, such as `x` to `new Error(x)`.
|
||||
*/
|
||||
class ErrorConstructorTaintStep extends AdditionalTaintStep, DataFlow::InvokeNode {
|
||||
ErrorConstructorTaintStep() {
|
||||
exists(string name | this = DataFlow::globalVarRef(name).getAnInvocation() |
|
||||
class ErrorConstructorTaintStep extends SharedTaintStep {
|
||||
override predicate step(DataFlow::Node pred, DataFlow::Node succ) {
|
||||
exists(DataFlow::NewNode invoke, string name |
|
||||
invoke = DataFlow::globalVarRef(name).getAnInvocation() and
|
||||
pred = invoke.getArgument(0) and
|
||||
succ = invoke
|
||||
|
|
||||
name = "Error" or
|
||||
name = "EvalError" or
|
||||
name = "RangeError" or
|
||||
@@ -711,11 +715,6 @@ module TaintTracking {
|
||||
name = "URIError"
|
||||
)
|
||||
}
|
||||
|
||||
override predicate step(DataFlow::Node pred, DataFlow::Node succ) {
|
||||
pred = getArgument(0) and
|
||||
succ = this
|
||||
}
|
||||
}
|
||||
|
||||
private module RegExpCaptureSteps {
|
||||
|
||||
Reference in New Issue
Block a user