Skip to content

Commit d90527b

Browse files
committed
JsonpInjectionExpr updated to JsonpBuilderExpr
1 parent eeae91e commit d90527b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

java/ql/src/experimental/Security/CWE/CWE-352/JsonpInjectionLib.qll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class SpringControllerRequestMappingGetMethod extends SpringControllerGetMethod
9999

100100
/** A concatenate expression using `(` and `)` or `);`. */
101101
class JsonpBuilderExpr extends AddExpr {
102-
JsonpInjectionExpr() {
102+
JsonpBuilderExpr() {
103103
getRightOperand().toString().regexpMatch("\"\\);?\"") and
104104
getLeftOperand()
105105
.(AddExpr)
@@ -126,7 +126,7 @@ class RemoteFlowConfig extends DataFlow2::Configuration {
126126
override predicate isSource(DataFlow::Node src) { src instanceof RemoteFlowSource }
127127

128128
override predicate isSink(DataFlow::Node sink) {
129-
exists(JsonpInjectionExpr jhe | jhe.getFunctionName() = sink.asExpr())
129+
exists(JsonpBuilderExpr jhe | jhe.getFunctionName() = sink.asExpr())
130130
}
131131
}
132132

@@ -137,7 +137,7 @@ class JsonDataFlowConfig extends DataFlow2::Configuration {
137137
override predicate isSource(DataFlow::Node src) { src instanceof JsonpStringSource }
138138

139139
override predicate isSink(DataFlow::Node sink) {
140-
exists(JsonpInjectionExpr jhe | jhe.getJsonExpr() = sink.asExpr())
140+
exists(JsonpBuilderExpr jhe | jhe.getJsonExpr() = sink.asExpr())
141141
}
142142
}
143143

@@ -146,7 +146,7 @@ class JsonpInjectionFlowConfig extends TaintTracking::Configuration {
146146
JsonpInjectionFlowConfig() { this = "JsonpInjectionFlowConfig" }
147147

148148
override predicate isSource(DataFlow::Node src) {
149-
exists(JsonpInjectionExpr jhe, JsonDataFlowConfig jdfc, RemoteFlowConfig rfc |
149+
exists(JsonpBuilderExpr jhe, JsonDataFlowConfig jdfc, RemoteFlowConfig rfc |
150150
jhe = src.asExpr() and
151151
jdfc.hasFlowTo(DataFlow::exprNode(jhe.getJsonExpr())) and
152152
rfc.hasFlowTo(DataFlow::exprNode(jhe.getFunctionName()))

0 commit comments

Comments
 (0)