Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use pull request user login to detect "dependabot[bot]" #4997

Merged
merged 2 commits into from
Sep 4, 2024

Conversation

jwhitlock
Copy link
Member

According to a recent article by synacktiv, the Dependabot credentials can be hijacked and used to create new jobs with:

github.actor == 'dependabot[bot]'

A way to check if dependabot is the real origin is to instead check:

github.event.pull_request.user.login == 'dependabot[bot]'

This check is repeated by the "dependabot/fetch-metadata@v2" code, so Relay has a partial mitigation:

https://github.com/dependabot/fetch-metadata/blob/efb8718212b9b67ae628ffc209cccb93af694cd7/src/dependabot/verified_commits.ts#L26-L30

This PR will more completely mitigate the issue.

According to a recent article by synacktiv, the Dependabot credentials
can be hijacked and used to create new jobs with:
`github.actor == 'dependabot[bot]'`
A way to check if dependabot is the real origin is to instead check:
`github.event.pull_request.user.login == 'dependabot[bot]'`

This check is repeated by the "dependabot/fetch-metadata@v2" code, so
Relay has a partial mitigation. This change will more completely
mitigate the issue.
@jwhitlock jwhitlock requested a review from say-yawn September 4, 2024 18:20
This was for debugging the action while it was being developed.
@jwhitlock
Copy link
Member Author

Non-prod code, self-reviewing.

@jwhitlock jwhitlock enabled auto-merge September 4, 2024 18:41
@jwhitlock jwhitlock disabled auto-merge September 4, 2024 18:41
@jwhitlock jwhitlock merged commit 1d26fd4 into main Sep 4, 2024
29 checks passed
@jwhitlock jwhitlock deleted the dependabot-login-instead-of-actor branch September 4, 2024 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant