@@ -49,23 +49,6 @@ private import codeql.rust.dataflow.FlowSource
4949private import codeql.rust.dataflow.FlowSink
5050private import codeql.rust.elements.internal.CallExprBaseImpl:: Impl as CallExprBaseImpl
5151
52- /**
53- * DEPRECATED: Do not use.
54- *
55- * Holds if in a call to the function with canonical path `path`, defined in the
56- * crate `crate`, the value referred to by `output` is a flow source of the given
57- * `kind`.
58- *
59- * `output = "ReturnValue"` simply means the result of the call itself.
60- *
61- * For more information on the `kind` parameter, see
62- * https://github.com/github/codeql/blob/main/docs/codeql/reusables/threat-model-description.rst.
63- */
64- extensible predicate sourceModelDeprecated (
65- string crate , string path , string output , string kind , string provenance ,
66- QlBuiltins:: ExtensionId madId
67- ) ;
68-
6952/**
7053 * Holds if in a call to the function with canonical path `path`, the value referred
7154 * to by `output` is a flow source of the given `kind`.
@@ -79,24 +62,6 @@ extensible predicate sourceModel(
7962 string path , string output , string kind , string provenance , QlBuiltins:: ExtensionId madId
8063) ;
8164
82- /**
83- * DEPRECATED: Do not use.
84- *
85- * Holds if in a call to the function with canonical path `path`, defined in the
86- * crate `crate`, the value referred to by `input` is a flow sink of the given
87- * `kind`.
88- *
89- * For example, `input = Argument[0]` means the first argument of the call.
90- *
91- * The following kinds are supported:
92- *
93- * - `sql-injection`: a flow sink for SQL injection.
94- */
95- extensible predicate sinkModelDeprecated (
96- string crate , string path , string input , string kind , string provenance ,
97- QlBuiltins:: ExtensionId madId
98- ) ;
99-
10065/**
10166 * Holds if in a call to the function with canonical path `path`, the value referred
10267 * to by `input` is a flow sink of the given `kind`.
@@ -111,21 +76,6 @@ extensible predicate sinkModel(
11176 string path , string input , string kind , string provenance , QlBuiltins:: ExtensionId madId
11277) ;
11378
114- /**
115- * DEPRECATED: Do not use.
116- *
117- * Holds if in a call to the function with canonical path `path`, defined in the
118- * crate `crate`, the value referred to by `input` can flow to the value referred
119- * to by `output`.
120- *
121- * `kind` should be either `value` or `taint`, for value-preserving or taint-preserving
122- * steps, respectively.
123- */
124- extensible predicate summaryModelDeprecated (
125- string crate , string path , string input , string output , string kind , string provenance ,
126- QlBuiltins:: ExtensionId madId
127- ) ;
128-
12979/**
13080 * Holds if in a call to the function with canonical path `path`, the value referred
13181 * to by `input` can flow to the value referred to by `output`.
@@ -144,67 +94,22 @@ extensible predicate summaryModel(
14494 * This predicate should only be used in tests.
14595 */
14696predicate interpretModelForTest ( QlBuiltins:: ExtensionId madId , string model ) {
147- exists ( string crate , string path , string output , string kind |
148- sourceModelDeprecated ( crate , path , output , kind , _, madId ) and
149- model = "Source: " + crate + "; " + path + "; " + output + "; " + kind
150- )
151- or
15297 exists ( string path , string output , string kind |
15398 sourceModel ( path , output , kind , _, madId ) and
15499 model = "Source: " + path + "; " + output + "; " + kind
155100 )
156101 or
157- exists ( string crate , string path , string input , string kind |
158- sinkModelDeprecated ( crate , path , input , kind , _, madId ) and
159- model = "Sink: " + crate + "; " + path + "; " + input + "; " + kind
160- )
161- or
162102 exists ( string path , string input , string kind |
163103 sinkModel ( path , input , kind , _, madId ) and
164104 model = "Sink: " + path + "; " + input + "; " + kind
165105 )
166106 or
167- exists ( string type , string path , string input , string output , string kind |
168- summaryModelDeprecated ( type , path , input , output , kind , _, madId ) and
169- model = "Summary: " + type + "; " + path + "; " + input + "; " + output + "; " + kind
170- )
171- or
172107 exists ( string path , string input , string output , string kind |
173108 summaryModel ( path , input , output , kind , _, madId ) and
174109 model = "Summary: " + path + "; " + input + "; " + output + "; " + kind
175110 )
176111}
177112
178- private class SummarizedCallableFromModelDeprecated extends SummarizedCallable:: Range {
179- private string crate ;
180- private string path ;
181-
182- SummarizedCallableFromModelDeprecated ( ) {
183- summaryModelDeprecated ( crate , path , _, _, _, _, _) and
184- exists ( CallExprBase call , Resolvable r |
185- call .getStaticTarget ( ) = this and
186- r = CallExprBaseImpl:: getCallResolvable ( call ) and
187- r .getResolvedPath ( ) = path and
188- r .getResolvedCrateOrigin ( ) = crate
189- )
190- }
191-
192- override predicate propagatesFlow (
193- string input , string output , boolean preservesValue , string model
194- ) {
195- exists ( string kind , QlBuiltins:: ExtensionId madId |
196- summaryModelDeprecated ( crate , path , input , output , kind , _, madId ) and
197- model = "MaD:" + madId .toString ( )
198- |
199- kind = "value" and
200- preservesValue = true
201- or
202- kind = "taint" and
203- preservesValue = false
204- )
205- }
206- }
207-
208113private class SummarizedCallableFromModel extends SummarizedCallable:: Range {
209114 private string path ;
210115
@@ -233,23 +138,6 @@ private class SummarizedCallableFromModel extends SummarizedCallable::Range {
233138 }
234139}
235140
236- private class FlowSourceFromModelDeprecated extends FlowSource:: Range {
237- private string crate ;
238- private string path ;
239-
240- FlowSourceFromModelDeprecated ( ) {
241- sourceModelDeprecated ( crate , path , _, _, _, _) and
242- this .callResolvesTo ( crate , path )
243- }
244-
245- override predicate isSource ( string output , string kind , Provenance provenance , string model ) {
246- exists ( QlBuiltins:: ExtensionId madId |
247- sourceModelDeprecated ( crate , path , output , kind , provenance , madId ) and
248- model = "MaD:" + madId .toString ( )
249- )
250- }
251- }
252-
253141private class FlowSourceFromModel extends FlowSource:: Range {
254142 private string path ;
255143
@@ -266,23 +154,6 @@ private class FlowSourceFromModel extends FlowSource::Range {
266154 }
267155}
268156
269- private class FlowSinkFromModelDeprecated extends FlowSink:: Range {
270- private string crate ;
271- private string path ;
272-
273- FlowSinkFromModelDeprecated ( ) {
274- sinkModelDeprecated ( crate , path , _, _, _, _) and
275- this .callResolvesTo ( crate , path )
276- }
277-
278- override predicate isSink ( string input , string kind , Provenance provenance , string model ) {
279- exists ( QlBuiltins:: ExtensionId madId |
280- sinkModelDeprecated ( crate , path , input , kind , provenance , madId ) and
281- model = "MaD:" + madId .toString ( )
282- )
283- }
284- }
285-
286157private class FlowSinkFromModel extends FlowSink:: Range {
287158 private string path ;
288159
0 commit comments