@@ -4,6 +4,9 @@ import advanced_security.javascript.frameworks.cap.CQL
44import advanced_security.javascript.frameworks.cap.RemoteFlowSources
55import advanced_security.javascript.frameworks.cap.dataflow.FlowSteps
66
7+ /**
8+ * A CQL clause parameterized with a string concatentation expression.
9+ */
710class CqlClauseWithStringConcatParameter instanceof CqlClause {
811 CqlClauseWithStringConcatParameter ( ) {
912 exists ( DataFlow:: Node queryParameter |
@@ -23,6 +26,10 @@ class CqlClauseWithStringConcatParameter instanceof CqlClause {
2326 string toString ( ) { result = super .toString ( ) }
2427}
2528
29+ /**
30+ * A CQL shortcut method call (`read`, `create`, ...) parameterized with a string
31+ * concatenation expression.
32+ */
2633class CqlShortcutMethodCallWithStringConcat instanceof CqlShortcutMethodCall {
2734 CqlShortcutMethodCallWithStringConcat ( ) {
2835 exists ( StringConcatenation:: getAnOperand ( super .getAQueryParameter ( ) ) )
@@ -33,6 +40,10 @@ class CqlShortcutMethodCallWithStringConcat instanceof CqlShortcutMethodCall {
3340 string toString ( ) { result = super .toString ( ) }
3441}
3542
43+ /**
44+ * A CQL parser call (cds.ql, cds.parse.cql, ...) parameterized with a string
45+ * conatenation expression.
46+ */
3647class CqlClauseParserCallWithStringConcat instanceof CqlClauseParserCall {
3748 CqlClauseParserCallWithStringConcat ( ) {
3849 exists ( StringConcatenation:: getAnOperand ( super .getCdlString ( ) ) )
@@ -57,6 +68,7 @@ class CqlInjectionConfiguration extends TaintTracking::Configuration {
5768 node = queryRunnerCall .( CqlQueryRunnerCall ) .getAQueryParameter ( )
5869 )
5970 or
71+ /* 3. An await expression that */
6072 exists ( AwaitExpr await , CqlClauseWithStringConcatParameter cqlClauseWithStringConcat |
6173 node = await .flow ( ) and
6274 await .getOperand ( ) = cqlClauseWithStringConcat .( CqlClause ) .asExpr ( )
@@ -67,12 +79,12 @@ class CqlInjectionConfiguration extends TaintTracking::Configuration {
6779
6880 override predicate isAdditionalTaintStep ( DataFlow:: Node start , DataFlow:: Node end ) {
6981 /*
70- * 1.
82+ * 1. Given a call to a CQL parser, jump from the argument to the parser call itself.
7183 */
7284
73- exists ( CqlClauseParserCallWithStringConcat cqlParseCallWithStringConcat |
74- start = cqlParseCallWithStringConcat .( CqlClauseParserCall ) .getAnArgument ( ) and
75- end = cqlParseCallWithStringConcat
85+ exists ( CqlClauseParserCall cqlParserCall |
86+ start = cqlParserCall .( CqlClauseParserCall ) .getAnArgument ( ) and
87+ end = cqlParserCall
7688 )
7789 or
7890 /*
@@ -111,4 +123,3 @@ class CqlInjectionConfiguration extends TaintTracking::Configuration {
111123 )
112124 }
113125}
114-
0 commit comments