Skip to content

Commit 645177c

Browse files
author
Alvaro Muñoz
committed
Account for github.event.label check as a sanitizer for untrusted checkout
1 parent 1458434 commit 645177c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ class ActorCheckStmt extends IfStmt {
2525
* An If node that contains a `label` check
2626
*/
2727
class LabelCheckStmt extends IfStmt {
28-
LabelCheckStmt() { this.getCondition().regexpMatch(".*github\\.event\\.pull_request\\.labels.*") }
28+
LabelCheckStmt() {
29+
this.getCondition().regexpMatch(".*github\\.event\\.pull_request\\.labels.*") or
30+
this.getCondition().regexpMatch(".*github\\.event\\.label\\.name.*")
31+
}
2932
}
3033

3134
from WorkflowStmt w, JobStmt job, StepUsesExpr checkoutStep

0 commit comments

Comments
 (0)