diff --git a/checks/raw/dangerous_workflow.go b/checks/raw/dangerous_workflow.go index 1d8f5ca794f..6dfb232a68f 100644 --- a/checks/raw/dangerous_workflow.go +++ b/checks/raw/dangerous_workflow.go @@ -45,8 +45,12 @@ func containsUntrustedContextPattern(variable string) bool { `head_commit\.message|` + `head_commit\.author\.email|` + `head_commit\.author\.name|` + + `head_commit\.committer\.email|` + + `head_commit\.committer\.name|` + `commits.*\.author\.email|` + `commits.*\.author\.name|` + + `commits.*\.committer\.email|` + + `commits.*\.committer\.name|` + `blocked_user\.name|` + `blocked_user\.email|` + `pull_request\.head\.ref|` + diff --git a/checks/raw/dangerous_workflow_test.go b/checks/raw/dangerous_workflow_test.go index c6431b7b127..d1ad4a16c16 100644 --- a/checks/raw/dangerous_workflow_test.go +++ b/checks/raw/dangerous_workflow_test.go @@ -85,6 +85,26 @@ func TestUntrustedContextVariables(t *testing.T) { variable: "github.event.commits[2].author.email", expected: true, }, + { + name: "head_commit committer name", + variable: "github.event.head_commit.committer.name", + expected: true, + }, + { + name: "head_commit committer email", + variable: "github.event.head_commit.committer.email", + expected: true, + }, + { + name: "commits committer name", + variable: "github.event.commits[0].committer.name", + expected: true, + }, + { + name: "commits committer email", + variable: "github.event.commits[0].committer.email", + expected: true, + }, { name: "blocked_user name", variable: "github.event.pull_request.organization.blocked_user.name",