From 8e25cac6535b4ee23d8fcdabe8a7465f0d454027 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Mon, 14 Nov 2022 13:00:29 +0100 Subject: [PATCH] Java: Add extensible predicates. --- .../code/java/dataflow/ExternalFlow.qll | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/java/ql/lib/semmle/code/java/dataflow/ExternalFlow.qll b/java/ql/lib/semmle/code/java/dataflow/ExternalFlow.qll index 4d1d93c062c..6bd13135c1b 100644 --- a/java/ql/lib/semmle/code/java/dataflow/ExternalFlow.qll +++ b/java/ql/lib/semmle/code/java/dataflow/ExternalFlow.qll @@ -432,6 +432,14 @@ predicate summaryModel(string row) { any(SummaryModelCsv s).row(row) } /** Holds if `row` is negative summary model. */ predicate negativeSummaryModel(string row) { any(NegativeSummaryModelCsv s).row(row) } +/** + * Holds if a source model exists for the given parameters. + */ +extensible predicate extSourceModel( + string package, string type, boolean subtypes, string name, string signature, string ext, + string output, string kind, string provenance +); + /** Holds if a source model exists for the given parameters. */ predicate sourceModel( string package, string type, boolean subtypes, string name, string signature, string ext, @@ -452,6 +460,12 @@ predicate sourceModel( ) } +/** Holds if a sink model exists for the given parameters. */ +extensible predicate extSinkModel( + string package, string type, boolean subtypes, string name, string signature, string ext, + string input, string kind, string provenance +); + /** Holds if a sink model exists for the given parameters. */ predicate sinkModel( string package, string type, boolean subtypes, string name, string signature, string ext, @@ -472,6 +486,12 @@ predicate sinkModel( ) } +/** Holds if a summary model exists for the given parameters. */ +extensible predicate extSummaryModel( + string package, string type, boolean subtypes, string name, string signature, string ext, + string input, string output, string kind, string provenance +); + /** Holds if a summary model exists for the given parameters. */ predicate summaryModel( string package, string type, boolean subtypes, string name, string signature, string ext, @@ -499,6 +519,11 @@ predicate summaryModel( row.splitAt(";", 9) = provenance } +/** Holds if a summary model exists indicating there is no flow for the given parameters. */ +extensible predicate extNegativeSummaryModel( + string package, string type, string name, string signature, string provenance +); + /** Holds if a summary model exists indicating there is no flow for the given parameters. */ predicate negativeSummaryModel( string package, string type, string name, string signature, string provenance