-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
How can 'github.ref_name' be attacker controlled? #85
Comments
(Great tool, by the way. Workflow security is such an interesting topic to me) |
Hi @ecnepsnai, thanks for the report and the kind words! We currently flag (More generally however, it's also difficult to prove that a tag ref can't be attacker controlled -- a user could theoretically allow external tag creation through a workflow or other automation, and subsequent expansions in a template context would then be attacker controlled.) TL;DR: we consider it potentially attacker controllable since it can in theory expand to something besides a SHA ref, even if in typical scenarios a dangerous expansion is unlikely. With that being said, I'm curious if you think this is too sensitive -- one possibility would be lowering the severity for this particular context access, or potentially gating it behind |
Ahh I see, I forgot that the ref name could be a branch, and yeah I see how that is attacker controlled. As for being too sensitive, in my specific example I would say it is, but my example isn't a good representation, I wonder if perhaps zizmor could look at the triggers and determine if its likely to be a risk, and use that to determine if it should or shouldn't flag it? |
I think this is a great idea, but I don't have a good sense yet for how to make the divisions here 😅 -- one option would be to distinguish between "safe" and "unsafe" workflows (e.g. I'll leave this open to see if other folks have thoughts on addressing this more generally -- at full generality this looks a lot like the big picture problem of zizmor doing the equivalent of whole program dataflow/control flow, but for GitHub Actions 🙂 |
Given the following example workflow:
The use of
github.ref_name
will be flagged as being possibly attacker controlled, but I'm genuinely curious how?My understanding is that this value will only refer to either a commit SHA, or a tag name. People without commit rights can't commit tags, so wouldn't that only leave a commit SHA?
The text was updated successfully, but these errors were encountered: