Skip to content

Commit f2935ca

Browse files
authored
Merge pull request github#15732 from github/max-schaefer/more-sink-types
Automodel: Add four more sink types.
2 parents 9f84653 + 75f66c2 commit f2935ca

File tree

2 files changed

+21
-14
lines changed

2 files changed

+21
-14
lines changed

java/ql/automodel/src/AutomodelEndpointTypes.qll

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,26 @@ class CommandInjectionSinkType extends SinkType {
5050
CommandInjectionSinkType() { this = "command-injection" }
5151
}
5252

53+
/** A sink relevant to file storage. */
54+
class FileContentStoreSinkType extends SinkType {
55+
FileContentStoreSinkType() { this = "file-content-store" }
56+
}
57+
58+
/** A sink relevant to HTML injection. */
59+
class HtmlInjectionSinkType extends SinkType {
60+
HtmlInjectionSinkType() { this = "html-injection" }
61+
}
62+
63+
/** A sink relevant to LDAP injection. */
64+
class LdapInjectionSinkType extends SinkType {
65+
LdapInjectionSinkType() { this = "ldap-injection" }
66+
}
67+
68+
/** A sink relevant to URL redirection. */
69+
class UrlRedirectionSinkType extends SinkType {
70+
UrlRedirectionSinkType() { this = "url-redirection" }
71+
}
72+
5373
/** A class for source types that can be predicted by a classifier. */
5474
abstract class SourceType extends EndpointType {
5575
bindingset[this]

java/ql/automodel/src/AutomodelJavaUtil.qll

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,7 @@ class DollarAtString extends string {
2828
* descriptions.
2929
*/
3030
predicate isKnownKind(string kind, AutomodelEndpointTypes::EndpointType type) {
31-
kind = "path-injection" and
32-
type instanceof AutomodelEndpointTypes::PathInjectionSinkType
33-
or
34-
kind = "sql-injection" and
35-
type instanceof AutomodelEndpointTypes::SqlInjectionSinkType
36-
or
37-
kind = "request-forgery" and
38-
type instanceof AutomodelEndpointTypes::RequestForgerySinkType
39-
or
40-
kind = "command-injection" and
41-
type instanceof AutomodelEndpointTypes::CommandInjectionSinkType
42-
or
43-
kind = "remote" and
44-
type instanceof AutomodelEndpointTypes::RemoteSourceType
31+
kind = type.getKind()
4532
}
4633

4734
/**

0 commit comments

Comments
 (0)