Skip to content

Commit fe1bf58

Browse files
Alvaro MuñozJarLob
andauthored
Apply suggestions from code review
Co-authored-by: Jaroslav Lobačevski <[email protected]>
1 parent 872b1f8 commit fe1bf58

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ql/src/Security/CWE-829/UntrustedCheckout.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ predicate containsHeadRef(string s) {
3737
Utils::normalizeExpr(s)
3838
.regexpFind([
3939
"\\bgithub\\.event\\.number\\b", // The pull request number.
40+
"\\bgithub\\.event\\.issue\\.number\\b", // The pull request number on issue_comment.
4041
"\\bgithub\\.event\\.pull_request\\.head\\.ref\\b", // The ref name of head.
4142
"\\bgithub\\.event\\.pull_request\\.head\\.sha\\b", // The commit SHA of head.
4243
"\\bgithub\\.event\\.pull_request\\.id\\b", // The pull request ID.
@@ -82,7 +83,7 @@ class GitCheckout extends PRHeadCheckoutStep instanceof Run {
8283

8384
from Workflow w, PRHeadCheckoutStep checkout
8485
where
85-
w.hasTriggerEvent(["pull_request_target", "issue_comment", "workflow_run"]) and
86+
w.hasTriggerEvent(["pull_request_target", "issue_comment", "pull_request_review_comment", "pull_request_review", "workflow_run", "check_run", "check_suite", "workflow_call"]) and
8687
w.getAJob().(LocalJob).getAStep() = checkout and
8788
not exists(ControlCheck check |
8889
checkout.getIf() = check or checkout.getEnclosingJob().getIf() = check

0 commit comments

Comments
 (0)