-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Can I pass untrusted data to @actions/core commands? #702
Comments
Hey @wagoid, thanks for reaching out. This CVE has been resolved. Unless an workflow author explicitly opts into
That being said, I prefer to validate input from users whenever possible! I'm going to close this out, but if you have any other follow up questions, feel free to reach out and we can reopen this! |
Hey @thboop, thanks a lot for the detailed explanation! Your answer was very helpful 🌟 |
As mentioned on actions/toolkit#702 (comment), we are safe to execute commands on our side. This reverts commit 58072cd, reversing changes made to 1788ebd.
As mentioned on actions/toolkit#702 (comment), we are safe to execute commands on our side. This reverts commit 58072cd, reversing changes made to 1788ebd.
Hi there! I've got an action that uses the toolkit, called commitlint-github-action. BTW thanks for the amazing work! ❤️
This action used to call 2 features of this package:
core.setFailed
andcore.setOutput
. We logged commit messages information on these 2 commands.After this announcement regarding CVE-2020-15228, I needed to disable command execution because I log untrusted data to the STDOUT, as they advised:
I see that support for
set-env
andadd-path
through commands has been removed from runners, so I was tempted to update my action to issue commands again. But then I noticed this feature was not completely removed from runners as people can set theACTIONS_ALLOW_UNSECURE_COMMANDS
env var at the job level. So if someone enables the commitlint action on forked PRs, there's still a vulnerability on my action since people can add the env var on forked PRs.All this bases on the assumption that the toolkit can't guarantee that the commands done through
@actions/core
are safe. But is that assumption correct? I see that there is some logic to escape data, would that be enough to callcore.setFailed
andcore.setOutput
without worrying that I'm passing untrusted information to it?Or if you confirm that I can't use commands even through
@actions/core
functions, do you think there's an alternative solution that doesn't involve disabling workflow commands? 🙌The text was updated successfully, but these errors were encountered: