Skip to content

Commit a0c9e5d

Browse files
authored
bugfix: add github.event.pull_request.head.sha as a safe context (#636)
* bugfix: add `github.event.pull_request.head.sha` as a safe context Signed-off-by: William Woodruff <[email protected]> * release-notes: record changes Signed-off-by: William Woodruff <[email protected]> --------- Signed-off-by: William Woodruff <[email protected]>
1 parent ae47960 commit a0c9e5d

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

docs/release-notes.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ of `zizmor`.
1414
* The SARIF output format now marks each rule as a "security" rule,
1515
which helps GitHub's presentation of the results (#631)
1616

17+
### Bug Fixes 🐛
18+
19+
* The [template-injection] audit no longer considers
20+
`github.event.pull_request.head.sha` dangerous (#636)
21+
1722
## v1.5.2
1823

1924
### Bug Fixes 🐛

src/audit/template_injection.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,15 @@ const SAFE_CONTEXTS: &[&str] = &[
3939
// The GitHub event name (i.e. trigger) is itself safe.
4040
"github.event_name",
4141
// Safe keys within the otherwise generally unsafe github.event context.
42-
"github.event.after", // hexadecimal SHA ref
43-
"github.event.before", // hexadecimal SHA ref
44-
"github.event.issue.number",
45-
"github.event.merge_group.base_sha",
42+
"github.event.after", // hexadecimal SHA ref
43+
"github.event.before", // hexadecimal SHA ref
44+
"github.event.issue.number", // the issue's own number
45+
"github.event.merge_group.base_sha", // hexadecimal SHA ref
4646
"github.event.number",
47-
"github.event.pull_request.base.sha",
48-
"github.event.pull_request.commits", // number of commits in PR
49-
"github.event.pull_request.number", // the PR's own number
47+
"github.event.pull_request.base.sha", // hexadecimal SHA ref
48+
"github.event.pull_request.head.sha", // hexadecimal SHA ref
49+
"github.event.pull_request.commits", // number of commits in PR
50+
"github.event.pull_request.number", // the PR's own number
5051
"github.event.workflow_run.id",
5152
// Information about the GitHub repository
5253
"github.repository",

0 commit comments

Comments
 (0)