Skip to content

fix: github workflow vulnerable to script injection#9331

Merged
max-sixty merged 1 commit intopydata:mainfrom
diogoteles08:main
Aug 12, 2024
Merged

fix: github workflow vulnerable to script injection#9331
max-sixty merged 1 commit intopydata:mainfrom
diogoteles08:main

Conversation

@diogoteles08
Copy link
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>
@welcome
Copy link

welcome bot commented Aug 12, 2024

Thank you for opening this pull request! It may take us a few days to respond here, so thank you for being patient.
If you have questions, some answers may be found in our contributing guidelines.

@max-sixty
Copy link
Collaborator

Thanks a lot @diogoteles08 !

@max-sixty max-sixty merged commit ce5130f into pydata:main Aug 12, 2024
@welcome
Copy link

welcome bot commented Aug 12, 2024

Congratulations on completing your first pull request! Welcome to Xarray! We are proud of you, and hope to see you again! celebration gif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants