@@ -25,10 +25,8 @@ abstract class RemoteFlowSource extends SourceNode {
2525
2626bindingset [ context]
2727private predicate isExternalUserControlledIssue ( string context ) {
28- exists ( string reg |
29- reg = [ "\\bgithub\\.event\\.issue\\.title\\b" , "\\bgithub\\.event\\.issue\\.body\\b" ]
30- |
31- Utils:: normalizeExpr ( context ) .regexpMatch ( reg )
28+ exists ( string reg | reg = [ "github\\.event\\.issue\\.title" , "github\\.event\\.issue\\.body" ] |
29+ Utils:: normalizeExpr ( context ) .regexpMatch ( Utils:: wrapRegexp ( reg ) )
3230 )
3331}
3432
@@ -37,38 +35,38 @@ private predicate isExternalUserControlledPullRequest(string context) {
3735 exists ( string reg |
3836 reg =
3937 [
40- "\\bgithub\\ .event\\.pull_request\\.title\\b " , "\\bgithub\\ .event\\.pull_request\\.body\\b " ,
41- "\\bgithub\\ .event\\.pull_request\\.head\\.label\\b " ,
42- "\\bgithub\\ .event\\.pull_request\\.head\\.repo\\.default_branch\\b " ,
43- "\\bgithub\\ .event\\.pull_request\\.head\\.repo\\.description\\b " ,
44- "\\bgithub\\ .event\\.pull_request\\.head\\.repo\\.homepage\\b " ,
45- "\\bgithub\\ .event\\.pull_request\\.head\\.ref\\b " , "\\bgithub\\ .head_ref\\b "
38+ "github\\ .event\\.pull_request\\.title" , "github\\ .event\\.pull_request\\.body" ,
39+ "github\\ .event\\.pull_request\\.head\\.label" ,
40+ "github\\ .event\\.pull_request\\.head\\.repo\\.default_branch" ,
41+ "github\\ .event\\.pull_request\\.head\\.repo\\.description" ,
42+ "github\\ .event\\.pull_request\\.head\\.repo\\.homepage" ,
43+ "github\\ .event\\.pull_request\\.head\\.ref" , "github\\ .head_ref"
4644 ]
4745 |
48- Utils:: normalizeExpr ( context ) .regexpMatch ( reg )
46+ Utils:: normalizeExpr ( context ) .regexpMatch ( Utils :: wrapRegexp ( reg ) )
4947 )
5048}
5149
5250bindingset [ context]
5351private predicate isExternalUserControlledReview ( string context ) {
54- Utils:: normalizeExpr ( context ) .regexpMatch ( "\\bgithub\\ .event\\.review\\.body\\b" )
52+ Utils:: normalizeExpr ( context ) .regexpMatch ( Utils :: wrapRegexp ( "github\\ .event\\.review\\.body" ) )
5553}
5654
5755bindingset [ context]
5856private predicate isExternalUserControlledComment ( string context ) {
59- Utils:: normalizeExpr ( context ) .regexpMatch ( "\\bgithub\\ .event\\.comment\\.body\\b" )
57+ Utils:: normalizeExpr ( context ) .regexpMatch ( Utils :: wrapRegexp ( "github\\ .event\\.comment\\.body" ) )
6058}
6159
6260bindingset [ context]
6361private predicate isExternalUserControlledGollum ( string context ) {
6462 exists ( string reg |
6563 reg =
6664 [
67- "\\bgithub\\ .event\\.pages\\[[0-9]+\\]\\.page_name\\b " ,
68- "\\bgithub\\ .event\\.pages\\[[0-9]+\\]\\.title\\b "
65+ "github\\ .event\\.pages\\[[0-9]+\\]\\.page_name" ,
66+ "github\\ .event\\.pages\\[[0-9]+\\]\\.title"
6967 ]
7068 |
71- Utils:: normalizeExpr ( context ) .regexpMatch ( reg )
69+ Utils:: normalizeExpr ( context ) .regexpMatch ( Utils :: wrapRegexp ( reg ) )
7270 )
7371}
7472
@@ -77,28 +75,27 @@ private predicate isExternalUserControlledCommit(string context) {
7775 exists ( string reg |
7876 reg =
7977 [
80- "\\bgithub\\.event\\.commits\\[[0-9]+\\]\\.message\\b" ,
81- "\\bgithub\\.event\\.head_commit\\.message\\b" ,
82- "\\bgithub\\.event\\.head_commit\\.author\\.email\\b" ,
83- "\\bgithub\\.event\\.head_commit\\.author\\.name\\b" ,
84- "\\bgithub\\.event\\.head_commit\\.committer\\.email\\b" ,
85- "\\bgithub\\.event\\.head_commit\\.committer\\.name\\b" ,
86- "\\bgithub\\.event\\.commits\\[[0-9]+\\]\\.author\\.email\\b" ,
87- "\\bgithub\\.event\\.commits\\[[0-9]+\\]\\.author\\.name\\b" ,
88- "\\bgithub\\.event\\.commits\\[[0-9]+\\]\\.committer\\.email\\b" ,
89- "\\bgithub\\.event\\.commits\\[[0-9]+\\]\\.committer\\.name\\b" ,
78+ "github\\.event\\.commits\\[[0-9]+\\]\\.message" , "github\\.event\\.head_commit\\.message" ,
79+ "github\\.event\\.head_commit\\.author\\.email" ,
80+ "github\\.event\\.head_commit\\.author\\.name" ,
81+ "github\\.event\\.head_commit\\.committer\\.email" ,
82+ "github\\.event\\.head_commit\\.committer\\.name" ,
83+ "github\\.event\\.commits\\[[0-9]+\\]\\.author\\.email" ,
84+ "github\\.event\\.commits\\[[0-9]+\\]\\.author\\.name" ,
85+ "github\\.event\\.commits\\[[0-9]+\\]\\.committer\\.email" ,
86+ "github\\.event\\.commits\\[[0-9]+\\]\\.committer\\.name" ,
9087 ]
9188 |
92- Utils:: normalizeExpr ( context ) .regexpMatch ( reg )
89+ Utils:: normalizeExpr ( context ) .regexpMatch ( Utils :: wrapRegexp ( reg ) )
9390 )
9491}
9592
9693bindingset [ context]
9794private predicate isExternalUserControlledDiscussion ( string context ) {
9895 exists ( string reg |
99- reg = [ "\\bgithub\\ .event\\.discussion\\.title\\b " , "\\bgithub\\ .event\\.discussion\\.body\\b " ]
96+ reg = [ "github\\ .event\\.discussion\\.title" , "github\\ .event\\.discussion\\.body" ]
10097 |
101- Utils:: normalizeExpr ( context ) .regexpMatch ( reg )
98+ Utils:: normalizeExpr ( context ) .regexpMatch ( Utils :: wrapRegexp ( reg ) )
10299 )
103100}
104101
@@ -107,18 +104,17 @@ private predicate isExternalUserControlledWorkflowRun(string context) {
107104 exists ( string reg |
108105 reg =
109106 [
110- "\\bgithub\\.event\\.workflow\\.path\\b" ,
111- "\\bgithub\\.event\\.workflow_run\\.head_branch\\b" ,
112- "\\bgithub\\.event\\.workflow_run\\.display_title\\b" ,
113- "\\bgithub\\.event\\.workflow_run\\.head_repository\\.description\\b" ,
114- "\\bgithub\\.event\\.workflow_run\\.head_commit\\.message\\b" ,
115- "\\bgithub\\.event\\.workflow_run\\.head_commit\\.author\\.email\\b" ,
116- "\\bgithub\\.event\\.workflow_run\\.head_commit\\.author\\.name\\b" ,
117- "\\bgithub\\.event\\.workflow_run\\.head_commit\\.committer\\.email\\b" ,
118- "\\bgithub\\.event\\.workflow_run\\.head_commit\\.committer\\.name\\b" ,
107+ "github\\.event\\.workflow\\.path" , "github\\.event\\.workflow_run\\.head_branch" ,
108+ "github\\.event\\.workflow_run\\.display_title" ,
109+ "github\\.event\\.workflow_run\\.head_repository\\.description" ,
110+ "github\\.event\\.workflow_run\\.head_commit\\.message" ,
111+ "github\\.event\\.workflow_run\\.head_commit\\.author\\.email" ,
112+ "github\\.event\\.workflow_run\\.head_commit\\.author\\.name" ,
113+ "github\\.event\\.workflow_run\\.head_commit\\.committer\\.email" ,
114+ "github\\.event\\.workflow_run\\.head_commit\\.committer\\.name" ,
119115 ]
120116 |
121- Utils:: normalizeExpr ( context ) .regexpMatch ( reg )
117+ Utils:: normalizeExpr ( context ) .regexpMatch ( Utils :: wrapRegexp ( reg ) )
122118 )
123119}
124120
0 commit comments