Skip to content

Commit 689e00a

Browse files
committed
Refine the start and end of the second and third steps
1. The second step should jump from a argument of a CQN object *only if the argument originates from a string concatentation*. Note that this new version identifies the end point using a successive application of `getAPredecessor`; it overapproximates and might accidentally include code that's not necessarily what we want. 2. The third is a specialization of the second step, and concerns itself only to the property writes to the object to be passed as an argument to the CQN query builder for INSERT and UPSERT.
1 parent 378436a commit 689e00a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

javascript/frameworks/cap/lib/advanced_security/javascript/frameworks/cap/CAPCqlInjectionQuery.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ class CqlInjectionConfiguration extends TaintTracking::Configuration {
189189
*/
190190

191191
exists(CqlClause cqlClause |
192-
start = cqlClause.getArgument().flow() and
192+
start = cqlClause.getArgument().flow().getAPredecessor*().(StringOps::Concatenation) and
193193
end = cqlClause.flow()
194194
)
195195
or
@@ -209,8 +209,8 @@ class CqlInjectionConfiguration extends TaintTracking::Configuration {
209209
exists(CqlClause cqlClause, PropWrite propWrite |
210210
(cqlClause instanceof CqlInsertClause or cqlClause instanceof CqlUpsertClause) and
211211
cqlClause.getArgument().flow() = propWrite.getBase() and
212-
start = propWrite.getRhs() and
213-
end = propWrite.getBase()
212+
start = propWrite.getRhs().getAPredecessor*().(StringOps::Concatenation) and
213+
end = cqlClause.flow()
214214
)
215215
}
216216
}

0 commit comments

Comments
 (0)