You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need to add a tuple to the ``sourceModel``\(namespace, type, subtypes, name, signature, ext, output, kind, provenance) extensible predicate by updating a data extension file.
80
+
We need to add a tuple to the ``sourceModel(namespace, type, subtypes, name, signature, ext, output, kind, provenance)`` extensible predicate by updating a data extension file.
81
81
82
82
.. code-block:: yaml
83
83
@@ -113,7 +113,7 @@ This example shows how the CPP query pack models the second argument of the ``bo
113
113
114
114
boost::asio::write(socket, send_buffer, error);
115
115
116
-
We need to add a tuple to the ``sinkModel``\(namespace, type, subtypes, name, signature, ext, input, kind, provenance) extensible predicate by updating a data extension file.
116
+
We need to add a tuple to the ``sinkModel(namespace, type, subtypes, name, signature, ext, input, kind, provenance)`` extensible predicate by updating a data extension file.
117
117
118
118
.. code-block:: yaml
119
119
@@ -149,7 +149,7 @@ This example shows how the CPP query pack models flow through a function for a s
We need to add tuples to the ``summaryModel``\(namespace, type, subtypes, name, signature, ext, input, output, kind, provenance) extensible predicate by updating a data extension file:
152
+
We need to add tuples to the ``summaryModel(namespace, type, subtypes, name, signature, ext, input, output, kind, provenance)`` extensible predicate by updating a data extension file:
153
153
154
154
.. code-block:: yaml
155
155
@@ -192,7 +192,7 @@ This function escapes special characters in a string for use in an SQL statement
192
192
mysql_real_escape_string(mysql, escaped_name, name, strlen(name)); // The escaped_name is safe for SQL injection.
193
193
sprintf(query_buffer, query, escaped_name);
194
194
195
-
We need to add a tuple to the ``barrierModel``\(namespace, type, subtypes, name, signature, ext, output, kind, provenance) extensible predicate by updating a data extension file.
195
+
We need to add a tuple to the ``barrierModel(namespace, type, subtypes, name, signature, ext, output, kind, provenance)`` extensible predicate by updating a data extension file.
196
196
197
197
.. code-block:: yaml
198
198
@@ -232,7 +232,7 @@ Consider a function called ``is_safe`` which returns ``true`` when the data is c
232
232
mysql_query(user_input); // This is safe.
233
233
}
234
234
235
-
We need to add a tuple to the ``barrierGuardModel``\(namespace, type, subtypes, name, signature, ext, input, acceptingvalue, kind, provenance) extensible predicate by updating a data extension file.
235
+
We need to add a tuple to the ``barrierGuardModel(namespace, type, subtypes, name, signature, ext, input, acceptingvalue, kind, provenance)`` extensible predicate by updating a data extension file.
Copy file name to clipboardExpand all lines: docs/codeql/codeql-language-guides/customizing-library-models-for-csharp.rst
+16-16Lines changed: 16 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -82,7 +82,7 @@ This is the constructor of the ``SqlCommand`` class, which is located in the ``S
82
82
...
83
83
}
84
84
85
-
We need to add a tuple to the ``sinkModel``\(namespace, type, subtypes, name, signature, ext, input, kind, provenance) extensible predicate by updating a data extension file.
85
+
We need to add a tuple to the ``sinkModel(namespace, type, subtypes, name, signature, ext, input, kind, provenance)`` extensible predicate by updating a data extension file.
86
86
87
87
.. code-block:: yaml
88
88
@@ -103,9 +103,9 @@ The first five values identify the callable (in this case a method) to be modele
103
103
- The fifth value ``(System.String,System.Data.SqlClient.SqlConnection)`` is the method input type signature. The type names must be fully qualified.
104
104
105
105
The sixth value should be left empty and is out of scope for this documentation.
106
-
The remaining values are used to define the ``access path``, the ``kind``, and the ``provenance`` (origin) of the sink.
106
+
The remaining values are used to define the access path, the ``kind``, and the ``provenance`` (origin) of the sink.
107
107
108
-
- The seventh value ``Argument[0]`` is the ``access path`` to the first argument passed to the method, which means that this is the location of the sink.
108
+
- The seventh value ``Argument[0]`` is the access path to the first argument passed to the method, which means that this is the location of the sink.
109
109
- The eighth value ``sql-injection`` is the kind of the sink. The sink kind is used to define the queries where the sink is in scope. In this case - the SQL injection queries.
110
110
- The ninth value ``manual`` is the provenance of the sink, which is used to identify the origin of the sink.
111
111
@@ -121,7 +121,7 @@ This is the ``GetStream`` method in the ``TcpClient`` class, which is located in
121
121
...
122
122
}
123
123
124
-
We need to add a tuple to the ``sourceModel``\(namespace, type, subtypes, name, signature, ext, output, kind, provenance) extensible predicate by updating a data extension file.
124
+
We need to add a tuple to the ``sourceModel(namespace, type, subtypes, name, signature, ext, output, kind, provenance)`` extensible predicate by updating a data extension file.
125
125
126
126
.. code-block:: yaml
127
127
@@ -143,7 +143,7 @@ The first five values identify the callable (in this case a method) to be modele
143
143
- The fifth value ``()`` is the method input type signature.
144
144
145
145
The sixth value should be left empty and is out of scope for this documentation.
146
-
The remaining values are used to define the ``access path``, the ``kind``, and the ``provenance`` (origin) of the source.
146
+
The remaining values are used to define the access path, the ``kind``, and the ``provenance`` (origin) of the source.
147
147
148
148
- The seventh value ``ReturnValue`` is the access path to the return of the method, which means that it is the return value that should be considered a source of tainted input.
149
149
- The eighth value ``remote`` is the kind of the source. The source kind is used to define the threat model where the source is in scope. ``remote`` applies to many of the security related queries as it means a remote source of untrusted data. As an example the SQL injection query uses ``remote`` sources. For more information, see ":ref:`Threat models <threat-models-csharp>`."
@@ -161,7 +161,7 @@ This pattern covers many of the cases where we need to summarize flow through a
161
161
...
162
162
}
163
163
164
-
We need to add tuples to the ``summaryModel``\(namespace, type, subtypes, name, signature, ext, input, output, kind, provenance) extensible predicate by updating a data extension file:
164
+
We need to add tuples to the ``summaryModel(namespace, type, subtypes, name, signature, ext, input, output, kind, provenance)`` extensible predicate by updating a data extension file:
165
165
166
166
.. code-block:: yaml
167
167
@@ -187,7 +187,7 @@ These are the same for both of the rows above as we are adding two summaries for
187
187
- The fifth value ``(System.Object,System.Object)`` is the method input type signature.
188
188
189
189
The sixth value should be left empty and is out of scope for this documentation.
190
-
The remaining values are used to define the ``access path``, the ``kind``, and the ``provenance`` (origin) of the summary.
190
+
The remaining values are used to define the access path, the ``kind``, and the ``provenance`` (origin) of the summary.
191
191
192
192
- The seventh value is the access path to the input (where data flows from). ``Argument[0]`` is the access path to the first argument (``s1`` in the example) and ``Argument[1]`` is the access path to the second argument (``s2`` in the example).
193
193
- The eighth value ``ReturnValue`` is the access path to the output (where data flows to), in this case ``ReturnValue``, which means that the input flows to the return value.
@@ -218,7 +218,7 @@ This example shows how the C# query pack models flow through a method for a simp
218
218
...
219
219
}
220
220
221
-
We need to add a tuple to the ``summaryModel``\(namespace, type, subtypes, name, signature, ext, input, output, kind, provenance) extensible predicate by updating a data extension file:
221
+
We need to add a tuple to the ``summaryModel(namespace, type, subtypes, name, signature, ext, input, output, kind, provenance)`` extensible predicate by updating a data extension file:
222
222
223
223
.. code-block:: yaml
224
224
@@ -243,7 +243,7 @@ These are the same for both of the rows above as we are adding two summaries for
243
243
- The fifth value ``()`` is the method input type signature.
244
244
245
245
The sixth value should be left empty and is out of scope for this documentation.
246
-
The remaining values are used to define the ``access path``, the ``kind``, and the ``provenance`` (origin) of the summary.
246
+
The remaining values are used to define the access path, the ``kind``, and the ``provenance`` (origin) of the summary.
247
247
248
248
- The seventh value is the access path to the input (where data flows from). ``Argument[this]`` is the access path to the qualifier (``s`` in the example).
249
249
- The eighth value ``ReturnValue`` is the access path to the output (where data flows to), in this case ``ReturnValue``, which means that the input flows to the return value.
@@ -262,7 +262,7 @@ Here we model flow through higher order methods and collection types, as well as
262
262
...
263
263
}
264
264
265
-
We need to add tuples to the ``summaryModel``\(namespace, type, subtypes, name, signature, ext, input, output, kind, provenance) extensible predicate by updating a data extension file:
265
+
We need to add tuples to the ``summaryModel(namespace, type, subtypes, name, signature, ext, input, output, kind, provenance)`` extensible predicate by updating a data extension file:
266
266
267
267
.. code-block:: yaml
268
268
@@ -287,7 +287,7 @@ These are the same for both of the rows above as we are adding two summaries for
287
287
- The fifth value ``(System.Collections.Generic.IEnumerable<TSource>,System.Func<TSource,TResult>)`` is the method input type signature. The generics in the signature must match the generics in the method signature in the source code.
288
288
289
289
The sixth value should be left empty and is out of scope for this documentation.
290
-
The remaining values are used to define the ``access path``, the ``kind``, and the ``provenance`` (origin) of the summary definition.
290
+
The remaining values are used to define the access path, the ``kind``, and the ``provenance`` (origin) of the summary definition.
291
291
292
292
- The seventh value is the access path to the ``input`` (where data flows from).
293
293
- The eighth value is the access path to the ``output`` (where data flows to).
@@ -323,7 +323,7 @@ The ``RawUrl`` property returns the raw URL of the current request, which is con
323
323
Response.Redirect(url); // This is not a URL redirection vulnerability.
324
324
}
325
325
326
-
We need to add a tuple to the ``barrierModel``\(namespace, type, subtypes, name, signature, ext, output, kind, provenance) extensible predicate by updating a data extension file.
326
+
We need to add a tuple to the ``barrierModel(namespace, type, subtypes, name, signature, ext, output, kind, provenance)`` extensible predicate by updating a data extension file.
327
327
328
328
.. code-block:: yaml
329
329
@@ -344,7 +344,7 @@ The first five values identify the callable (in this case the getter of a proper
344
344
- The fifth value ``()`` is the method input type signature.
345
345
346
346
The sixth value should be left empty and is out of scope for this documentation.
347
-
The remaining values are used to define the ``access path``, the ``kind``, and the ``provenance`` (origin) of the barrier.
347
+
The remaining values are used to define the access path, the ``kind``, and the ``provenance`` (origin) of the barrier.
348
348
349
349
- The seventh value ``ReturnValue`` is the access path to the return value of the property getter, which means that the return value is considered safe.
350
350
- The eighth value ``url-redirection`` is the kind of the barrier. The barrier kind is used to define the queries where the barrier is in scope. In this case - the URL redirection queries.
@@ -365,7 +365,7 @@ When the ``IsAbsoluteUri`` property returns ``false``, the URL is relative and t
365
365
}
366
366
}
367
367
368
-
We need to add a tuple to the ``barrierGuardModel``\(namespace, type, subtypes, name, signature, ext, input, acceptingvalue, kind, provenance) extensible predicate by updating a data extension file.
368
+
We need to add a tuple to the ``barrierGuardModel(namespace, type, subtypes, name, signature, ext, input, acceptingvalue, kind, provenance)`` extensible predicate by updating a data extension file.
369
369
370
370
.. code-block:: yaml
371
371
@@ -386,7 +386,7 @@ The first five values identify the callable (in this case the getter of a proper
386
386
- The fifth value ``()`` is the method input type signature.
387
387
388
388
The sixth value should be left empty and is out of scope for this documentation.
389
-
The remaining values are used to define the ``access path``, the ``accepting value``, the ``kind``, and the ``provenance`` (origin) of the barrier guard.
389
+
The remaining values are used to define the access path, the ``accepting value``, the ``kind``, and the ``provenance`` (origin) of the barrier guard.
390
390
391
391
- The seventh value ``Argument[this]`` is the access path to the input whose flow is blocked. In this case, the qualifier of the property access (``uri`` in the example).
392
392
- The eighth value ``false`` is the accepting value of the barrier guard. This is the value that the conditional check must return for the barrier to apply. In this case, when ``IsAbsoluteUri`` is ``false``, the URL is relative and considered safe.
@@ -405,7 +405,7 @@ A neutral model is used to define that there is no flow through a method.
405
405
...
406
406
}
407
407
408
-
We need to add a tuple to the ``neutralModel``\(namespace, type, name, signature, kind, provenance) extensible predicate by updating a data extension file.
408
+
We need to add a tuple to the ``neutralModel(namespace, type, name, signature, kind, provenance)`` extensible predicate by updating a data extension file.
0 commit comments