File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
javascript/ql/src/experimental/Security/CWE-094 Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,12 @@ private predicate isExternalUserControlledCommit(string context) {
65
65
context .regexpMatch ( "\\bgithub\\s*\\.\\s*head_ref\\b" )
66
66
}
67
67
68
+ bindingset [ context]
69
+ private predicate isExternalUserControlledDiscussion ( string context ) {
70
+ context .regexpMatch ( "\\bgithub\\s*\\.\\s*event\\s*\\.\\s*discussion\\s*\\.\\s*title\\b" ) or
71
+ context .regexpMatch ( "\\bgithub\\s*\\.\\s*event\\s*\\.\\s*discussion\\s*\\.\\s*body\\b" )
72
+ }
73
+
68
74
from Actions:: Run run , string context , Actions:: On on
69
75
where
70
76
run .getAReferencedExpression ( ) = context and
87
93
or
88
94
exists ( on .getNode ( "pull_request_target" ) ) and
89
95
isExternalUserControlledCommit ( context )
96
+ or
97
+ ( exists ( on .getNode ( "discussion" ) ) or exists ( on .getNode ( "discussion_comment" ) ) ) and
98
+ isExternalUserControlledDiscussion ( context )
90
99
)
91
100
select run ,
92
101
"Potential injection from the " + context +
You can’t perform that action at this time.
0 commit comments