-
Notifications
You must be signed in to change notification settings - Fork 64.7k
Description
Code of Conduct
- I have read and agree to the GitHub Docs project's Code of Conduct
What article on docs.github.com is affected?
What part(s) of the article would you like to see updated?
The current "recommended" mitigation to script injections in GitHub workflows is to use a GitHub Action, see https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-action-instead-of-an-inline-script-recommended
I think this is mis-leading. All this recommendation is doing is tell users to use an action, basically moving the vulnerability inside the action instead of the workflow itself.
As a user, I may create a local Action and introduce the exact same vulnerability using a script, which is not going to mitigate the problem. If the intention is to say "don't use a script and use javascript, possibly inside an Action", I think that would be fine. But the way it's phrased right now is mis-leading. Using an Action does not mitigate script injections.
A drawback of GHA is that it's yet another dependency to maintain and another attack surface.
The right way to fix this vulnerability is to declare an env variable, which is given as a second option. Users worried about script injection in their script are unlikely to move to an Action, which takes additional work. Users use inline scripts because it's the easy option, so I think we should meet them where they're at.
Additional information
Content Plan
Content plan here
No response