File tree Expand file tree Collapse file tree 2 files changed +158
-132
lines changed
javascript/frameworks/cap
lib/advanced_security/javascript/frameworks/cap
test/queries/cqlinjection/srv Expand file tree Collapse file tree 2 files changed +158
-132
lines changed Original file line number Diff line number Diff line change @@ -159,6 +159,26 @@ class CqlClauseParserCallWithStringConcat instanceof CqlClauseParserCall {
159
159
string toString ( ) { result = super .toString ( ) }
160
160
}
161
161
162
+ /**
163
+ * A data flow configuration from a remote flow source to a handful of sinks that run a CQL
164
+ * query, either directly or indirectly by assembling one under the hood.
165
+ *
166
+ * The CQL injection happens if a fluent API builder (`SELECT`, `INSERT`, ...) or a
167
+ * shortcut method call (`srv.read`, `srv.create`, ...) are called with a string
168
+ * concatentation as one of its argument, which in practice can take one of its
169
+ * following forms:
170
+ *
171
+ * 1. Concatentation with a string value with the `+` operator:
172
+ * - Concatenation with a string: `"ID=" + expr`
173
+ * - Concatenation with a template literal: `` `ID=` + expr ``
174
+ * 2. Template literal that interpolates an expression in it but is not a tagged
175
+ * template literal: `` SELECT.from`Entity`.where(`ID=${expr}`) ``
176
+ *
177
+ * The second case should be distinguished from the ones that have tagged template literals
178
+ * for all of its builder calls: if the example were `` SELECT.from`Entity`.where`ID=${expr}` ``
179
+ * instead (notice the lack of parentheses around the template literal), then the `where` call
180
+ * becomes a parser call of the template literal following it and thus acts as a sanitizer.
181
+ */
162
182
class CqlInjectionConfiguration extends TaintTracking:: Configuration {
163
183
CqlInjectionConfiguration ( ) { this = "CQL injection from untrusted data" }
164
184
You can’t perform that action at this time.
0 commit comments