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) {
6565 context .regexpMatch ( "\\bgithub\\s*\\.\\s*head_ref\\b" )
6666}
6767
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+
6874from Actions:: Run run , string context , Actions:: On on
6975where
7076 run .getAReferencedExpression ( ) = context and
8793 or
8894 exists ( on .getNode ( "pull_request_target" ) ) and
8995 isExternalUserControlledCommit ( context )
96+ or
97+ ( exists ( on .getNode ( "discussion" ) ) or exists ( on .getNode ( "discussion_comment" ) ) ) and
98+ isExternalUserControlledDiscussion ( context )
9099 )
91100select run ,
92101 "Potential injection from the " + context +
You can’t perform that action at this time.
0 commit comments