FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: github workflow vulnerable to script injection by diogoteles08 · Pull Request #2600 · googleapis/java-bigquerystorage · GitHub

This repository was archived by the owner on Feb 24, 2026. It is now read-only.

fix: github workflow vulnerable to script injection - #2600

Merged
diegomarquezp merged 5 commits into
googleapis:mainfrom
diogoteles08:main
Aug 20, 2024
Merged

fix: github workflow vulnerable to script injection#2600
diegomarquezp merged 5 commits into
googleapis:mainfrom
diogoteles08:main

Conversation

Copy link
Copy Markdown
Contributor

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. This mitigates the script injection risks and also keeps your workflow running exactly as before.

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

Cheers!

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>
diogoteles08 requested review from a team and leahecole August 12, 2024 16:03
product-auto-label Bot added size: xs Pull request size is extra small. api: bigquerystorage Issues related to the googleapis/java-bigquerystorage API. labels Aug 12, 2024

Copy link
Copy Markdown
Contributor

@diogoteles08 , lgtm but can you take a look also. There might be other instances elsewhere where this might be useful.

diegomarquezp commented Aug 16, 2024
edited
Loading

Copy link
Copy Markdown
Contributor

cc: @JoeWang1127 @blakeli0

Copy link
Copy Markdown
Contributor

@PhongChuong we have this script in other hw repos.

Copy link
Copy Markdown
Contributor

I did a similar change in google-cloud-java: googleapis/google-cloud-java#10881

Copy link
Copy Markdown
Contributor Author

@diogoteles08 , lgtm but can you take a look also. There might be other instances elsewhere where this might be useful.

Hi! I did realize this very same workflow was used in other repositories of this org. I grouped some and pointed them in this comment: googleapis/java-storage#2663 (comment)

Copy link
Copy Markdown
Contributor

/gcbrun

PhongChuong added kokoro:force-run Add this label to force Kokoro to re-run the tests. kokoro:run Add this label to force Kokoro to re-run the tests. labels Aug 19, 2024
yoshi-kokoro removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Aug 19, 2024
PhongChuong added kokoro:force-run Add this label to force Kokoro to re-run the tests. kokoro:run Add this label to force Kokoro to re-run the tests. labels Aug 19, 2024
yoshi-kokoro removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Aug 19, 2024
product-auto-label Bot added size: s Pull request size is small. and removed size: xs Pull request size is extra small. labels Aug 19, 2024

Copy link
Copy Markdown
Contributor

@diogoteles08 just testing a few commits to confirm if we can also inline an env var in the if statement in this yaml.

diegomarquezp added the automerge Merge the pull request once unit tests and other checks pass. label Aug 19, 2024

Copy link
Copy Markdown
Contributor

/gcbrun

diegomarquezp merged commit 9ce25b6 into googleapis:main Aug 20, 2024
gcf-merge-on-green Bot removed the automerge Merge the pull request once unit tests and other checks pass. label Aug 20, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: bigquerystorage Issues related to the googleapis/java-bigquerystorage API. size: s Pull request size is small.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL