Skip to content

Commit c0226e4

Browse files
authored
Harden PR Builder Dependabot PR builder check (#769)
The PR builder checks the `github.actor` to determine if it's a Dependabot PR, and if so allows execution. This check is flawed - the `actor` is the user triggering the event, not necessarily the author of the PR - as such it's possible to create an event where the triggering actor is `dependabot` but the codebase is not. Instead, we should check if `dependabot` _authored_ the PR. References: - https://www.synacktiv.com/publications/github-actions-exploitation-dependabot - https://docs.zizmor.sh/audits/#bot-conditions# - [GitHub first-party usage](https://github.com/github/docs/blob/7cbca58400edbc80b22512947ec96563bc984bf1/.github/workflows/triage-unallowed-contributions.yml#L17-L22)
1 parent 0e20f99 commit c0226e4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

.github/workflows/builder.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
needs: check_for_membership
2525
steps:
2626
- name: Detect untrusted community PR
27-
if: ${{ needs.check_for_membership.outputs.check-result == 'false' && github.actor != 'dependabot[bot]' }}
27+
if: ${{ needs.check_for_membership.outputs.check-result == 'false' && github.event.pull_request.user.login != 'dependabot[bot]' }}
2828
run: |
2929
echo "::error::ERROR: Untrusted external PR. Must be reviewed and executed by Hazelcast" 1>&2;
3030
exit 1

0 commit comments

Comments
 (0)