@@ -25,10 +25,8 @@ abstract class RemoteFlowSource extends SourceNode {
25
25
26
26
bindingset [ context]
27
27
private 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 ) )
32
30
)
33
31
}
34
32
@@ -37,38 +35,38 @@ private predicate isExternalUserControlledPullRequest(string context) {
37
35
exists ( string reg |
38
36
reg =
39
37
[
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"
46
44
]
47
45
|
48
- Utils:: normalizeExpr ( context ) .regexpMatch ( reg )
46
+ Utils:: normalizeExpr ( context ) .regexpMatch ( Utils :: wrapRegexp ( reg ) )
49
47
)
50
48
}
51
49
52
50
bindingset [ context]
53
51
private 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" ) )
55
53
}
56
54
57
55
bindingset [ context]
58
56
private 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" ) )
60
58
}
61
59
62
60
bindingset [ context]
63
61
private predicate isExternalUserControlledGollum ( string context ) {
64
62
exists ( string reg |
65
63
reg =
66
64
[
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"
69
67
]
70
68
|
71
- Utils:: normalizeExpr ( context ) .regexpMatch ( reg )
69
+ Utils:: normalizeExpr ( context ) .regexpMatch ( Utils :: wrapRegexp ( reg ) )
72
70
)
73
71
}
74
72
@@ -77,28 +75,27 @@ private predicate isExternalUserControlledCommit(string context) {
77
75
exists ( string reg |
78
76
reg =
79
77
[
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" ,
90
87
]
91
88
|
92
- Utils:: normalizeExpr ( context ) .regexpMatch ( reg )
89
+ Utils:: normalizeExpr ( context ) .regexpMatch ( Utils :: wrapRegexp ( reg ) )
93
90
)
94
91
}
95
92
96
93
bindingset [ context]
97
94
private predicate isExternalUserControlledDiscussion ( string context ) {
98
95
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" ]
100
97
|
101
- Utils:: normalizeExpr ( context ) .regexpMatch ( reg )
98
+ Utils:: normalizeExpr ( context ) .regexpMatch ( Utils :: wrapRegexp ( reg ) )
102
99
)
103
100
}
104
101
@@ -107,18 +104,17 @@ private predicate isExternalUserControlledWorkflowRun(string context) {
107
104
exists ( string reg |
108
105
reg =
109
106
[
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" ,
119
115
]
120
116
|
121
- Utils:: normalizeExpr ( context ) .regexpMatch ( reg )
117
+ Utils:: normalizeExpr ( context ) .regexpMatch ( Utils :: wrapRegexp ( reg ) )
122
118
)
123
119
}
124
120
0 commit comments