3 ms·
> No one in their right mind would leave a Jenkins server open for anyone to trigger some workflows. Open source projects have been doing exactly that for ages
by oefrha 6y ago
> No one in their right mind would leave a Jenkins server open for anyone to trigger some workflows.
Open source projects have been doing exactly that for ages.
Homebrew in particular had a Jenkins server hosted at bot.brew.sh running arbitrary pull requests since 2013 before finally fully migrating to GitHub Actions in 2020.
- alfiedotwtf 6y agoNot only this, but public Jenkins often have their shell open to the public!
- capableweb 6y ago> Open source projects have been doing exactly that for ages. I'm not sure it's that common. What's common is to allow people to browse the Jenkins instance, but disable anything to run PRs that changes the workflow/build itself from people who are not part of the organization/team that manages Jenkins.
- oefrha 6y agoYou don’t need to make changes to workflows to run arbitrary code. Projects usually run tests, and you can just put whatever you want to execute in the code being tested, or exploit other holes in the existing workflow. TFA does not make any changes to existing workflows, for instance. Also, you can disable workflow changes in GitHub Actions with the pull_request_target event, in which case it uses the workflow definition from the target branch.
- Master_Odin 6y agoThe pull_request_target event however allows for read/write access to the base repo and access to all of its secrets. It's not the event type you'd want to use whenever dealing with code that's incoming in a PR. See the big warning at https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request_target https://docs.github.com/en/actions/reference/events-that-tri....
- oefrha 6y agoThat’s not true at all. Unless you expose the token or secrets in steps where you run untrusted code, the token and secrets are safe. This is explicitly designed for untrusted pull requests on public repos, solving the problem of, say, adding labels with the write token, or deploying a preview build to Netlify, while keeping the secrets safe from arbitrary code execution.
- sneak 6y agoRunning arbitrary code from users in CI is one thing. Automatically merging code is another, which is what this bug exploited. The former can be made somewhat/reasonably safe. The latter probably can't.
- oefrha 6y agoYes, but that is not what this thread (GitHub Actions is somehow more vulnerable than Jenkins because no one exposes Jenkins?) is about.