From 3dfd93dbafe2ebdc3ad5465845c6d5e2efdff18e Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Mon, 1 May 2023 15:00:38 +0200 Subject: [PATCH] Java: Re-introduce the source model kind validation and allow sql kind as well. --- .../lib/semmle/code/java/dataflow/ExternalFlow.qll | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/java/ql/lib/semmle/code/java/dataflow/ExternalFlow.qll b/java/ql/lib/semmle/code/java/dataflow/ExternalFlow.qll index 30e07043837..2a430cf5707 100644 --- a/java/ql/lib/semmle/code/java/dataflow/ExternalFlow.qll +++ b/java/ql/lib/semmle/code/java/dataflow/ExternalFlow.qll @@ -286,13 +286,13 @@ module ModelValidation { not kind.matches("qltest%") and result = "Invalid kind \"" + kind + "\" in sink model." ) - // All source kinds are supported, but some may not be used in this query. - // or - // exists(string kind | sourceModel(_, _, _, _, _, _, _, kind, _) | - // not ConfiguredExtensions::supportedSourceKind(kind) and - // not kind.matches("qltest%") and - // result = "Invalid kind \"" + kind + "\" in source model." - // ) + or + exists(string kind | sourceModel(_, _, _, _, _, _, _, kind, _) | + not kind = + ["remote", "sql", "contentprovider", "android-widget", "android-external-storage-dir"] and + not kind.matches("qltest%") and + result = "Invalid kind \"" + kind + "\" in source model." + ) } private string getInvalidModelSignature() {