Account for github.event.label check as a sanitizer for untrusted checkout

This commit is contained in:
Alvaro Muñoz
2024-02-26 09:39:42 +01:00
parent 1458434504
commit 645177cc80

View File

@@ -25,7 +25,10 @@ class ActorCheckStmt extends IfStmt {
* An If node that contains a `label` check
*/
class LabelCheckStmt extends IfStmt {
LabelCheckStmt() { this.getCondition().regexpMatch(".*github\\.event\\.pull_request\\.labels.*") }
LabelCheckStmt() {
this.getCondition().regexpMatch(".*github\\.event\\.pull_request\\.labels.*") or
this.getCondition().regexpMatch(".*github\\.event\\.label\\.name.*")
}
}
from WorkflowStmt w, JobStmt job, StepUsesExpr checkoutStep