This commit is contained in:
Jami Cogswell 2023-06-05 12:16:08 -04:00
Родитель 3f1dc8e5c7
Коммит 9d5972acc2
14 изменённых файлов: 35 добавлений и 7 удалений

Просмотреть файл

@ -205,6 +205,7 @@ module ModelValidation {
)
}
/** Gets an error message relating to an invalid kind in a model. */
private string getInvalidModelKind() {
exists(string kind | summaryModel(_, _, _, _, _, _, _, _, kind, _) |
not kind instanceof ValidSummaryKind and

Просмотреть файл

@ -1,7 +1,7 @@
/**
* INTERNAL: Do not use.
*
* Provides classes for validating kinds in models as data rows.
* Provides classes and predicates related to validating models as data rows.
* Such that we can share this logic across our CodeQL analysis of different languages.
*/
@ -40,6 +40,7 @@ class ValidSinkKind extends string {
}
}
/** An outdated models-as-data sink kind. */
class OutdatedSinkKind extends string {
OutdatedSinkKind() {
this =
@ -51,6 +52,7 @@ class OutdatedSinkKind extends string {
]
}
/** Gets a replacement kind for an outdated sink kind. */
private string replacementKind() {
this = ["sql", "xpath", "groovy", "jexl", "mvel", "xslt", "ldap", "code", "html"] and
result = this + "-injection"
@ -84,6 +86,7 @@ class OutdatedSinkKind extends string {
this = "uncontrolled-format-string" and result = "format-string"
}
/** Gets an error message for an outdated sink kind. */
string outdatedMessage() {
result =
"The kind \"" + this + "\" is outdated. Use \"" + this.replacementKind() + "\" instead."

Просмотреть файл

@ -189,6 +189,7 @@ module ModelValidation {
)
}
/** Gets an error message relating to an invalid kind in a model. */
private string getInvalidModelKind() {
exists(string kind | summaryModel(_, _, _, _, _, _, _, _, kind, _) |
not kind instanceof ValidSummaryKind and

Просмотреть файл

@ -1,7 +1,7 @@
/**
* INTERNAL: Do not use.
*
* Provides classes for validating kinds in models as data rows.
* Provides classes and predicates related to validating models as data rows.
* Such that we can share this logic across our CodeQL analysis of different languages.
*/
@ -40,6 +40,7 @@ class ValidSinkKind extends string {
}
}
/** An outdated models-as-data sink kind. */
class OutdatedSinkKind extends string {
OutdatedSinkKind() {
this =
@ -51,6 +52,7 @@ class OutdatedSinkKind extends string {
]
}
/** Gets a replacement kind for an outdated sink kind. */
private string replacementKind() {
this = ["sql", "xpath", "groovy", "jexl", "mvel", "xslt", "ldap", "code", "html"] and
result = this + "-injection"
@ -84,6 +86,7 @@ class OutdatedSinkKind extends string {
this = "uncontrolled-format-string" and result = "format-string"
}
/** Gets an error message for an outdated sink kind. */
string outdatedMessage() {
result =
"The kind \"" + this + "\" is outdated. Use \"" + this.replacementKind() + "\" instead."

Просмотреть файл

@ -266,6 +266,7 @@ module ModelValidation {
)
}
/** Gets an error message relating to an invalid kind in a model. */
private string getInvalidModelKind() {
exists(string kind | summaryModel(_, _, _, _, _, _, _, _, kind, _) |
not kind instanceof ValidSummaryKind and

Просмотреть файл

@ -1,7 +1,7 @@
/**
* INTERNAL: Do not use.
*
* Provides classes for validating kinds in models as data rows.
* Provides classes and predicates related to validating models as data rows.
* Such that we can share this logic across our CodeQL analysis of different languages.
*/
@ -40,6 +40,7 @@ class ValidSinkKind extends string {
}
}
/** An outdated models-as-data sink kind. */
class OutdatedSinkKind extends string {
OutdatedSinkKind() {
this =
@ -51,6 +52,7 @@ class OutdatedSinkKind extends string {
]
}
/** Gets a replacement kind for an outdated sink kind. */
private string replacementKind() {
this = ["sql", "xpath", "groovy", "jexl", "mvel", "xslt", "ldap", "code", "html"] and
result = this + "-injection"
@ -84,6 +86,7 @@ class OutdatedSinkKind extends string {
this = "uncontrolled-format-string" and result = "format-string"
}
/** Gets an error message for an outdated sink kind. */
string outdatedMessage() {
result =
"The kind \"" + this + "\" is outdated. Use \"" + this.replacementKind() + "\" instead."

Просмотреть файл

@ -655,6 +655,7 @@ module ModelOutput {
import Specific::ModelOutputSpecific
private import SharedModelValidation
/** Gets an error message relating to an invalid kind in a model. */
private string getInvalidModelKind() {
exists(string kind | summaryModel(_, _, _, _, kind) |
not kind instanceof ValidSummaryKind and

Просмотреть файл

@ -1,7 +1,7 @@
/**
* INTERNAL: Do not use.
*
* Provides classes for validating kinds in models as data rows.
* Provides classes and predicates related to validating models as data rows.
* Such that we can share this logic across our CodeQL analysis of different languages.
*/
@ -40,6 +40,7 @@ class ValidSinkKind extends string {
}
}
/** An outdated models-as-data sink kind. */
class OutdatedSinkKind extends string {
OutdatedSinkKind() {
this =
@ -51,6 +52,7 @@ class OutdatedSinkKind extends string {
]
}
/** Gets a replacement kind for an outdated sink kind. */
private string replacementKind() {
this = ["sql", "xpath", "groovy", "jexl", "mvel", "xslt", "ldap", "code", "html"] and
result = this + "-injection"
@ -84,6 +86,7 @@ class OutdatedSinkKind extends string {
this = "uncontrolled-format-string" and result = "format-string"
}
/** Gets an error message for an outdated sink kind. */
string outdatedMessage() {
result =
"The kind \"" + this + "\" is outdated. Use \"" + this.replacementKind() + "\" instead."

Просмотреть файл

@ -655,6 +655,7 @@ module ModelOutput {
import Specific::ModelOutputSpecific
private import SharedModelValidation
/** Gets an error message relating to an invalid kind in a model. */
private string getInvalidModelKind() {
exists(string kind | summaryModel(_, _, _, _, kind) |
not kind instanceof ValidSummaryKind and

Просмотреть файл

@ -1,7 +1,7 @@
/**
* INTERNAL: Do not use.
*
* Provides classes for validating kinds in models as data rows.
* Provides classes and predicates related to validating models as data rows.
* Such that we can share this logic across our CodeQL analysis of different languages.
*/
@ -40,6 +40,7 @@ class ValidSinkKind extends string {
}
}
/** An outdated models-as-data sink kind. */
class OutdatedSinkKind extends string {
OutdatedSinkKind() {
this =
@ -51,6 +52,7 @@ class OutdatedSinkKind extends string {
]
}
/** Gets a replacement kind for an outdated sink kind. */
private string replacementKind() {
this = ["sql", "xpath", "groovy", "jexl", "mvel", "xslt", "ldap", "code", "html"] and
result = this + "-injection"
@ -84,6 +86,7 @@ class OutdatedSinkKind extends string {
this = "uncontrolled-format-string" and result = "format-string"
}
/** Gets an error message for an outdated sink kind. */
string outdatedMessage() {
result =
"The kind \"" + this + "\" is outdated. Use \"" + this.replacementKind() + "\" instead."

Просмотреть файл

@ -655,6 +655,7 @@ module ModelOutput {
import Specific::ModelOutputSpecific
private import SharedModelValidation
/** Gets an error message relating to an invalid kind in a model. */
private string getInvalidModelKind() {
exists(string kind | summaryModel(_, _, _, _, kind) |
not kind instanceof ValidSummaryKind and

Просмотреть файл

@ -1,7 +1,7 @@
/**
* INTERNAL: Do not use.
*
* Provides classes for validating kinds in models as data rows.
* Provides classes and predicates related to validating models as data rows.
* Such that we can share this logic across our CodeQL analysis of different languages.
*/
@ -40,6 +40,7 @@ class ValidSinkKind extends string {
}
}
/** An outdated models-as-data sink kind. */
class OutdatedSinkKind extends string {
OutdatedSinkKind() {
this =
@ -51,6 +52,7 @@ class OutdatedSinkKind extends string {
]
}
/** Gets a replacement kind for an outdated sink kind. */
private string replacementKind() {
this = ["sql", "xpath", "groovy", "jexl", "mvel", "xslt", "ldap", "code", "html"] and
result = this + "-injection"
@ -84,6 +86,7 @@ class OutdatedSinkKind extends string {
this = "uncontrolled-format-string" and result = "format-string"
}
/** Gets an error message for an outdated sink kind. */
string outdatedMessage() {
result =
"The kind \"" + this + "\" is outdated. Use \"" + this.replacementKind() + "\" instead."

Просмотреть файл

@ -264,6 +264,7 @@ module CsvValidation {
)
}
/** Gets an error message relating to an invalid kind in a model. */
private string getInvalidModelKind() {
exists(string row, string kind | summaryModel(row) |
kind = row.splitAt(";", 8) and

Просмотреть файл

@ -1,7 +1,7 @@
/**
* INTERNAL: Do not use.
*
* Provides classes for validating kinds in models as data rows.
* Provides classes and predicates related to validating models as data rows.
* Such that we can share this logic across our CodeQL analysis of different languages.
*/
@ -40,6 +40,7 @@ class ValidSinkKind extends string {
}
}
/** An outdated models-as-data sink kind. */
class OutdatedSinkKind extends string {
OutdatedSinkKind() {
this =
@ -51,6 +52,7 @@ class OutdatedSinkKind extends string {
]
}
/** Gets a replacement kind for an outdated sink kind. */
private string replacementKind() {
this = ["sql", "xpath", "groovy", "jexl", "mvel", "xslt", "ldap", "code", "html"] and
result = this + "-injection"
@ -84,6 +86,7 @@ class OutdatedSinkKind extends string {
this = "uncontrolled-format-string" and result = "format-string"
}
/** Gets an error message for an outdated sink kind. */
string outdatedMessage() {
result =
"The kind \"" + this + "\" is outdated. Use \"" + this.replacementKind() + "\" instead."