Skip to content

Commit 9977b1c

Browse files
committed
Include parameters when quoting extensible predicate name
1 parent f384611 commit 9977b1c

File tree

4 files changed

+54
-54
lines changed

4 files changed

+54
-54
lines changed

docs/codeql/codeql-language-guides/customizing-library-models-for-cpp.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ This example shows how the CPP query pack models the return value from the ``rea
7777
7878
boost::asio::read_until(socket, recv_buffer, '\0', error);
7979
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.
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.
8181

8282
.. code-block:: yaml
8383
@@ -113,7 +113,7 @@ This example shows how the CPP query pack models the second argument of the ``bo
113113
114114
boost::asio::write(socket, send_buffer, error);
115115
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.
117117

118118
.. code-block:: yaml
119119
@@ -149,7 +149,7 @@ This example shows how the CPP query pack models flow through a function for a s
149149
150150
boost::asio::write(socket, boost::asio::buffer(send_str), error);
151151
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:
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:
153153

154154
.. code-block:: yaml
155155
@@ -192,7 +192,7 @@ This function escapes special characters in a string for use in an SQL statement
192192
mysql_real_escape_string(mysql, escaped_name, name, strlen(name)); // The escaped_name is safe for SQL injection.
193193
sprintf(query_buffer, query, escaped_name);
194194
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.
196196

197197
.. code-block:: yaml
198198
@@ -232,7 +232,7 @@ Consider a function called ``is_safe`` which returns ``true`` when the data is c
232232
mysql_query(user_input); // This is safe.
233233
}
234234
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.
236236

237237
.. code-block:: yaml
238238

docs/codeql/codeql-language-guides/customizing-library-models-for-csharp.rst

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ This is the constructor of the ``SqlCommand`` class, which is located in the ``S
8282
...
8383
}
8484
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.
8686

8787
.. code-block:: yaml
8888
@@ -103,9 +103,9 @@ The first five values identify the callable (in this case a method) to be modele
103103
- The fifth value ``(System.String,System.Data.SqlClient.SqlConnection)`` is the method input type signature. The type names must be fully qualified.
104104

105105
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.
107107

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.
109109
- 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.
110110
- The ninth value ``manual`` is the provenance of the sink, which is used to identify the origin of the sink.
111111

@@ -121,7 +121,7 @@ This is the ``GetStream`` method in the ``TcpClient`` class, which is located in
121121
...
122122
}
123123
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.
125125

126126
.. code-block:: yaml
127127
@@ -143,7 +143,7 @@ The first five values identify the callable (in this case a method) to be modele
143143
- The fifth value ``()`` is the method input type signature.
144144

145145
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.
147147

148148
- 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.
149149
- 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
161161
...
162162
}
163163
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:
165165

166166
.. code-block:: yaml
167167
@@ -187,7 +187,7 @@ These are the same for both of the rows above as we are adding two summaries for
187187
- The fifth value ``(System.Object,System.Object)`` is the method input type signature.
188188

189189
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.
191191

192192
- 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).
193193
- 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
218218
...
219219
}
220220
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:
222222

223223
.. code-block:: yaml
224224
@@ -243,7 +243,7 @@ These are the same for both of the rows above as we are adding two summaries for
243243
- The fifth value ``()`` is the method input type signature.
244244

245245
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.
247247

248248
- 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).
249249
- 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
262262
...
263263
}
264264
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:
266266

267267
.. code-block:: yaml
268268
@@ -287,7 +287,7 @@ These are the same for both of the rows above as we are adding two summaries for
287287
- 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.
288288

289289
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.
291291

292292
- The seventh value is the access path to the ``input`` (where data flows from).
293293
- 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
323323
Response.Redirect(url); // This is not a URL redirection vulnerability.
324324
}
325325
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.
327327

328328
.. code-block:: yaml
329329
@@ -344,7 +344,7 @@ The first five values identify the callable (in this case the getter of a proper
344344
- The fifth value ``()`` is the method input type signature.
345345

346346
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.
348348

349349
- 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.
350350
- 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
365365
}
366366
}
367367
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.
369369

370370
.. code-block:: yaml
371371
@@ -386,7 +386,7 @@ The first five values identify the callable (in this case the getter of a proper
386386
- The fifth value ``()`` is the method input type signature.
387387

388388
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.
390390

391391
- 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).
392392
- 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.
405405
...
406406
}
407407
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.
409409

410410
.. code-block:: yaml
411411

0 commit comments

Comments
 (0)