GHA: set persist-credentials: false#15746
Conversation
|
zizmor cannot load It's barking at And this: Which looks like a false positive? We can move that expression within single quotes to mitigate |
|
FWIW this matter came up via the Ultralytics supply chain injection: |
That looks like a false positive indeed -- I believe (I can fix these upstream in Edit: zizmorcore/zizmor#309 |
|
@woodruffw Nice, thanks! As for /cc @mback2k |
Yes, that looks like it! I missed that, thank you! |
|
Yes, the webhook documentation is the right place for that event payload. Have you tested the quotation changes successfully? |
|
FWIW, quoting within the shell won't mitigate the injection risk: The only way to prevent code injection via a template in a shell body (like |
They did run this evening after merging pending PR's dated back |
Yes, it's what I meant by not covering all values. I found it odd that
I've seen it done in other projects' PRs, but couldn't I think we don't have variables controllable by an attacker.
As for |
Apologies for the misunderstanding!
Internally within GHA, all template expansions evaluate to strings (regardless of actual expansion/context value type). So doing something like:
Ah yeah, those look like more false positives: right now we flag Edit: zizmorcore/zizmor#313
Hmm, that's an interesting case -- you could hush that with |
No worries at all!
Thanks for these details. This sounds good indeed. Though somewhat impractical to use for all variables, but
Excellent, thanks!
Indeed! I automatically prefer single-quoted strings to avoid expansion, Commit landed: |
|
I found that attack on ultralytics interesting, I had no idea it was possible. See ultralytics/ultralytics#18018 for example. You can see the PR branch name is set to Does anyone else think GitHub has some responsibility here? There should be some way to default sanitize for any ${{something}} in our actions that the user can modify. |
Yes, I think allowing all these special characters in GitHub branches A generic solution might be non-trivial given the number of variable A way to apply "more secure" GHA defaults to a workflow, project or |
Suggested by zizmor GHA analysis tool. Also: - Move GH variables within single-quotes. - Prefer single-quotes in shell code. (tidy-up) Ref: actions/checkout#485 Ref: actions/checkout#1687 Ref: https://woodruffw.github.io/zizmor/ Closes curl#15746
Suggested by zizmor GHA analysis tool.
Also:
Ref: actions/checkout#485
Ref: actions/checkout#1687
Ref: https://woodruffw.github.io/zizmor/