From 615f2a573b8165d79b00493a8d64fb9d65375dae Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Fri, 2 Jun 2023 16:57:24 -0400 Subject: [PATCH] Java/C#/Go/Swift: remove commented-out code --- .../semmle/code/csharp/dataflow/ExternalFlow.qll | 6 ------ go/ql/lib/semmle/go/dataflow/ExternalFlow.qll | 1 - .../lib/semmle/code/java/dataflow/ExternalFlow.qll | 13 ------------- swift/ql/lib/codeql/swift/dataflow/ExternalFlow.qll | 1 - 4 files changed, 21 deletions(-) diff --git a/csharp/ql/lib/semmle/code/csharp/dataflow/ExternalFlow.qll b/csharp/ql/lib/semmle/code/csharp/dataflow/ExternalFlow.qll index 902d6f246c9..32c143c6636 100644 --- a/csharp/ql/lib/semmle/code/csharp/dataflow/ExternalFlow.qll +++ b/csharp/ql/lib/semmle/code/csharp/dataflow/ExternalFlow.qll @@ -208,27 +208,21 @@ module ModelValidation { private string getInvalidModelKind() { exists(string kind | summaryModel(_, _, _, _, _, _, _, _, kind, _) | not kind instanceof ValidSummaryKind and - //not kind = ["taint", "value"] and result = "Invalid kind \"" + kind + "\" in summary model." ) or exists(string kind | sinkModel(_, _, _, _, _, _, _, kind, _) | not kind instanceof ValidSinkKind and - // not kind = - // ["code-injection", "sql-injection", "js-injection", "html-injection", "file-content-store"] and - not kind.matches("encryption-%") and result = "Invalid kind \"" + kind + "\" in sink model." ) or exists(string kind | sourceModel(_, _, _, _, _, _, _, kind, _) | not kind instanceof ValidSourceKind and - //not kind = ["local", "remote", "file", "file-write"] and result = "Invalid kind \"" + kind + "\" in source model." ) or exists(string kind | neutralModel(_, _, _, _, kind, _) | not kind instanceof ValidNeutralKind and - //not kind = ["summary", "source", "sink"] and result = "Invalid kind \"" + kind + "\" in neutral model." ) } diff --git a/go/ql/lib/semmle/go/dataflow/ExternalFlow.qll b/go/ql/lib/semmle/go/dataflow/ExternalFlow.qll index 05818ab68c7..9b12d3a2b38 100644 --- a/go/ql/lib/semmle/go/dataflow/ExternalFlow.qll +++ b/go/ql/lib/semmle/go/dataflow/ExternalFlow.qll @@ -192,7 +192,6 @@ module ModelValidation { private string getInvalidModelKind() { exists(string kind | summaryModel(_, _, _, _, _, _, _, _, kind, _) | not kind instanceof ValidSummaryKind and - //not kind = ["taint", "value"] and result = "Invalid kind \"" + kind + "\" in summary model." ) } diff --git a/java/ql/lib/semmle/code/java/dataflow/ExternalFlow.qll b/java/ql/lib/semmle/code/java/dataflow/ExternalFlow.qll index b3a128fb4e1..3004910dc3f 100644 --- a/java/ql/lib/semmle/code/java/dataflow/ExternalFlow.qll +++ b/java/ql/lib/semmle/code/java/dataflow/ExternalFlow.qll @@ -313,22 +313,11 @@ module ModelValidation { private string getInvalidModelKind() { exists(string kind | summaryModel(_, _, _, _, _, _, _, _, kind, _) | not kind instanceof ValidSummaryKind and - //not kind = ["taint", "value"] and result = "Invalid kind \"" + kind + "\" in summary model." ) or exists(string kind, string msg | sinkModel(_, _, _, _, _, _, _, kind, _) | not kind instanceof ValidSinkKind and - // not kind = - // [ - // "request-forgery", "jndi-injection", "ldap-injection", "sql-injection", "log-injection", - // "mvel-injection", "xpath-injection", "groovy-injection", "html-injection", "js-injection", - // "ognl-injection", "intent-redirection", "pending-intents", "url-redirection", - // "path-injection", "file-content-store", "hostname-verification", "response-splitting", - // "information-leak", "xslt-injection", "jexl-injection", "bean-validation", - // "template-injection", "fragment-injection", "command-injection" - // ] and - not kind.matches("regex-use%") and not kind.matches("qltest%") and msg = "Invalid kind \"" + kind + "\" in sink model." and // The part of this message that refers to outdated sink kinds can be deleted after June 1st, 2024. @@ -339,14 +328,12 @@ module ModelValidation { or exists(string kind | sourceModel(_, _, _, _, _, _, _, kind, _) | not kind instanceof ValidSourceKind and - // not kind = ["remote", "contentprovider", "android-widget", "android-external-storage-dir"] and not kind.matches("qltest%") and result = "Invalid kind \"" + kind + "\" in source model." ) or exists(string kind | neutralModel(_, _, _, _, kind, _) | not kind instanceof ValidNeutralKind and - //not kind = ["summary", "source", "sink"] and result = "Invalid kind \"" + kind + "\" in neutral model." ) } diff --git a/swift/ql/lib/codeql/swift/dataflow/ExternalFlow.qll b/swift/ql/lib/codeql/swift/dataflow/ExternalFlow.qll index 0adc9be7373..62e785ebf31 100644 --- a/swift/ql/lib/codeql/swift/dataflow/ExternalFlow.qll +++ b/swift/ql/lib/codeql/swift/dataflow/ExternalFlow.qll @@ -268,7 +268,6 @@ module CsvValidation { exists(string row, string kind | summaryModel(row) | kind = row.splitAt(";", 8) and not kind instanceof ValidSummaryKind and - //not kind = ["taint", "value"] and result = "Invalid kind \"" + kind + "\" in summary model." ) }