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: github workflow vulnerable to script injection #1700

Closed
wants to merge 4 commits into from

Conversation

diogoteles08
Copy link

Hi! I'm Diogo from Google's Open Source Security Team(GOSST) and I'm dropping by to suggest this small change that will enhance the security of your repository by preventing script injection attacks through your GitHub workflows.

In the piece of code I changed, you were directly using the value of a variable that comes from a user's input, so a malicious user could exploit that input and use it to run arbitrary code. By using an intermediate environment variable, the value of the expression is stored in memory, used as a variable and doesn't interact with the script generation process.

I understand your job already prevents runs from external PRs, but this simple change would provide additional security and keep the code immune to any script injection attempt.

You can find more information about this on this github documentation or in this gitguardian blogpost.

Cheers!

@diogoteles08 diogoteles08 requested review from a team as code owners August 14, 2024 17:25
@product-auto-label product-auto-label bot added the api: pubsublite Issues related to the googleapis/java-pubsublite API. label Aug 15, 2024
@product-auto-label product-auto-label bot added the size: s Pull request size is small. label Aug 19, 2024
@diegomarquezp diegomarquezp removed the request for review from davidtorres August 19, 2024 20:43
@diegomarquezp
Copy link
Contributor

/gcbrun

@diegomarquezp
Copy link
Contributor

Hermetic Library Generation check failed with:

Error: Input required and not supplied: token

This is expected since the fork needs a token that can be used by actions/checkout.

Copy link
Contributor

@bcol-google bcol-google left a comment

Choose a reason for hiding this comment

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

LGTM

@bcol-google
Copy link
Contributor

Confirmed with Diogo that this PR is ok to close

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsublite Issues related to the googleapis/java-pubsublite API. size: s Pull request size is small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants