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

Critical security issue with preview deployments #765

Open
hugolgst opened this issue May 16, 2022 · 5 comments
Open

Critical security issue with preview deployments #765

hugolgst opened this issue May 16, 2022 · 5 comments

Comments

@hugolgst
Copy link

hugolgst commented May 16, 2022

Hello,

Using this GitHub action is extremely dangerous, as you are using Personal access tokens.
Netlify does not have any granularity on permissions personal access tokens provide. This means that you are essentially deploying previews with access to the production environment.
If you are running previews on external PRs, anybody can modify the GH action workflow file and deploy it to your production website.

This cannot be solved unless Netlify provides permission selection on tokens.

@nwtgck
Copy link
Owner

nwtgck commented May 16, 2022

Hi,

Thank you so much for your reporting. I'd like to confirm the following things.

Does personal access tokens mean NETLIFY_AUTH_TOKEN in this action?

If you are running previews on external PRs, anybody can just modify the GH action workflow file and deploy it to your production website.

Does "external PRs" mean pull requests created from forked repositories?

A PR from a forked repo should be like the following when you use on: pull_request not on: pull_request_target. This means that the modification is executed after repository owner approved the modification.

image

@hugolgst
Copy link
Author

hugolgst commented May 16, 2022

Does personal access tokens mean NETLIFY_AUTH_TOKEN in this action?

Yes

Does "external PRs" mean pull requests created from forked repositories?

It is dangerous with every PR but less when the owner applies changes because we assume he knows what he is doing.
But even though, if you have a large organisation or that a maintainer makes a mistake, it can deploy to production.

Your solution to have the approval of a maintainer before running can be a temporary solution. However, as described before, mistakes can happen.

@nwtgck
Copy link
Owner

nwtgck commented May 16, 2022

I also beleaive Murphy's law.

As you said Netlify does not provided permission selection on tokens, we should use the solution provided by GitHub as a safety net for now.

@hugolgst
Copy link
Author

If you know how to and wish to, you can make a feature request to Netlify.

@charlesrocket
Copy link

@hugolgst how is this different from Netlify’s approach? You have to approve deploys from new contributors as well (one would assume this is done for the exact same reason (?)).

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

No branches or pull requests

3 participants