Skip to content
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

Fix command injection vulnerability in Github workflow #9542

Merged
merged 1 commit into from
Sep 2, 2023

Conversation

arunstar
Copy link
Contributor

@arunstar arunstar commented Sep 2, 2023

github.event.issue.body is potentially untrusted. Avoid using it directly in inline scripts. instead, pass it through an environment variable.

See https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions for more details

@github-actions
Copy link
Contributor

github-actions bot commented Sep 2, 2023

Messages
📖 ✨ Thanks for your contribution to Shields, @arunstar!

Generated by 🚫 dangerJS against deae2e3

Copy link
Collaborator

@jNullj jNullj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, tested this in my fork, i was able to inject before this change and was not able to do so after them.

I am sorry that i missed this when introducing this new feature.

@jNullj jNullj added security Refer to our SECURITY.md policy before opening pull requests that address a security vulnerability developer-experience Dev tooling, test framework, and CI labels Sep 2, 2023
@jNullj
Copy link
Collaborator

jNullj commented Sep 2, 2023

@chris48s @calebcartwright Sorry to ping you but this seems to require a quick response

I think its best to report those type of things at security@shields.io and not publicly.
Please notice that SECURITY.md does not directly refer to Github actions/workflow

@arunstar
Copy link
Contributor Author

arunstar commented Sep 2, 2023

Sorry for the oversight. I thought it's a small patch that I could do it myself. will be careful next time.

@jNullj
Copy link
Collaborator

jNullj commented Sep 2, 2023

To try and estimate the damage made so far i went to the action log at https://github.com/badges/shields/actions/workflows/test-bug-run-badge.yml and checked all runs.
So far it seems no attack was performed. You can see in the logs how the issue appears

Copy link
Member

@PyvesB PyvesB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for discovering and fixing this issue @arunstar! I'll second @jNullj on how it would have been best to report his, but if you missed it, it may simply be that the policy is not discoverable enough, and that's on us/GitHub. As a quick win, I'll point to the policy in the security label, this will help surface it a little.

Thanks for checking impact @jNullj!

@PyvesB PyvesB added this pull request to the merge queue Sep 2, 2023
Merged via the queue into badges:master with commit 7e762e7 Sep 2, 2023
20 checks passed
@PyvesB
Copy link
Member

PyvesB commented Sep 2, 2023

As a quick win, I'll point to the policy in the security label, this will help surface it a little.

Another small thing that may help: #9544

@chris48s
Copy link
Member

chris48s commented Sep 4, 2023

Thanks all 👍 I've raised #9547 as a follow up to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
developer-experience Dev tooling, test framework, and CI security Refer to our SECURITY.md policy before opening pull requests that address a security vulnerability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants