mirror of
https://github.com/github/codeql.git
synced 2026-02-11 12:41:06 +01:00
JsonpInjectionExpr updated to JsonpBuilderExpr
This commit is contained in:
@@ -99,7 +99,7 @@ class SpringControllerRequestMappingGetMethod extends SpringControllerGetMethod
|
||||
|
||||
/** A concatenate expression using `(` and `)` or `);`. */
|
||||
class JsonpBuilderExpr extends AddExpr {
|
||||
JsonpInjectionExpr() {
|
||||
JsonpBuilderExpr() {
|
||||
getRightOperand().toString().regexpMatch("\"\\);?\"") and
|
||||
getLeftOperand()
|
||||
.(AddExpr)
|
||||
@@ -126,7 +126,7 @@ class RemoteFlowConfig extends DataFlow2::Configuration {
|
||||
override predicate isSource(DataFlow::Node src) { src instanceof RemoteFlowSource }
|
||||
|
||||
override predicate isSink(DataFlow::Node sink) {
|
||||
exists(JsonpInjectionExpr jhe | jhe.getFunctionName() = sink.asExpr())
|
||||
exists(JsonpBuilderExpr jhe | jhe.getFunctionName() = sink.asExpr())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@ class JsonDataFlowConfig extends DataFlow2::Configuration {
|
||||
override predicate isSource(DataFlow::Node src) { src instanceof JsonpStringSource }
|
||||
|
||||
override predicate isSink(DataFlow::Node sink) {
|
||||
exists(JsonpInjectionExpr jhe | jhe.getJsonExpr() = sink.asExpr())
|
||||
exists(JsonpBuilderExpr jhe | jhe.getJsonExpr() = sink.asExpr())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ class JsonpInjectionFlowConfig extends TaintTracking::Configuration {
|
||||
JsonpInjectionFlowConfig() { this = "JsonpInjectionFlowConfig" }
|
||||
|
||||
override predicate isSource(DataFlow::Node src) {
|
||||
exists(JsonpInjectionExpr jhe, JsonDataFlowConfig jdfc, RemoteFlowConfig rfc |
|
||||
exists(JsonpBuilderExpr jhe, JsonDataFlowConfig jdfc, RemoteFlowConfig rfc |
|
||||
jhe = src.asExpr() and
|
||||
jdfc.hasFlowTo(DataFlow::exprNode(jhe.getJsonExpr())) and
|
||||
rfc.hasFlowTo(DataFlow::exprNode(jhe.getFunctionName()))
|
||||
|
||||
Reference in New Issue
Block a user