@@ -18,8 +18,6 @@ abstract class RemoteFlowSource extends SourceNode {
1818 /** Gets a string that describes the type of this remote flow source. */
1919 abstract string getSourceType ( ) ;
2020
21- abstract string getATriggerEvent ( ) ;
22-
2321 override string getThreatModel ( ) { result = "remote" }
2422}
2523
@@ -122,47 +120,31 @@ private predicate isExternalUserControlledWorkflowRun(string context) {
122120}
123121
124122private class EventSource extends RemoteFlowSource {
125- string trigger ;
126-
127123 EventSource ( ) {
128124 exists ( Expression e , string context | this .asExpr ( ) = e and context = e .getExpression ( ) |
129- trigger = [ "issues" , "issue_comment" ] and isExternalUserControlledIssue ( context )
130- or
131- trigger = [ "pull_request_target" , "pull_request_review" , "pull_request_review_comment" ] and
132- isExternalUserControlledPullRequest ( context )
133- or
134- trigger = [ "pull_request_review" ] and isExternalUserControlledReview ( context )
135- or
136- trigger = [ "pull_request_review_comment" , "issue_comment" , "discussion_comment" ] and
137- isExternalUserControlledComment ( context )
138- or
139- trigger = [ "gollum" ] and isExternalUserControlledGollum ( context )
140- or
141- trigger = [ "push" ] and isExternalUserControlledCommit ( context )
142- or
143- trigger = [ "discussion" , "discussion_comment" ] and isExternalUserControlledDiscussion ( context )
144- or
145- trigger = [ "workflow_run" ] and isExternalUserControlledWorkflowRun ( context )
125+ isExternalUserControlledIssue ( context ) or
126+ isExternalUserControlledPullRequest ( context ) or
127+ isExternalUserControlledReview ( context ) or
128+ isExternalUserControlledComment ( context ) or
129+ isExternalUserControlledGollum ( context ) or
130+ isExternalUserControlledCommit ( context ) or
131+ isExternalUserControlledDiscussion ( context ) or
132+ isExternalUserControlledWorkflowRun ( context )
146133 )
147134 }
148135
149136 override string getSourceType ( ) { result = "User-controlled events" }
150-
151- override string getATriggerEvent ( ) { result = trigger }
152137}
153138
154139/**
155140 * A Source of untrusted data defined in a MaD specification
156141 */
157142private class ExternallyDefinedSource extends RemoteFlowSource {
158143 string sourceType ;
159- string trigger ;
160144
161- ExternallyDefinedSource ( ) { externallyDefinedSource ( this , sourceType , _, trigger ) }
145+ ExternallyDefinedSource ( ) { externallyDefinedSource ( this , sourceType , _) }
162146
163147 override string getSourceType ( ) { result = sourceType }
164-
165- override string getATriggerEvent ( ) { result = trigger }
166148}
167149
168150/**
@@ -174,6 +156,4 @@ private class CompositeActionInputSource extends RemoteFlowSource {
174156 CompositeActionInputSource ( ) { c .getAnInput ( ) = this .asExpr ( ) }
175157
176158 override string getSourceType ( ) { result = "Composite action input" }
177-
178- override string getATriggerEvent ( ) { result = "*" }
179159}
0 commit comments