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 potential security issue with variable interpolation in the run step #64

Closed
coderabbitai bot opened this issue May 16, 2024 · 2 comments
Closed

Comments

@coderabbitai
Copy link

coderabbitai bot commented May 16, 2024

There is a potential security issue with variable interpolation in the run: step in the GitHub Actions workflow file .github/workflows/publish-central.yml.

Using variable interpolation ${{...}} with github context data in a run: step could allow an attacker to inject their own code into the runner. Instead, use an intermediate environment variable with env: to store the data and use the environment variable in the run: script. Be sure to use double-quotes for the environment variable, like this: "$ENVVAR".

Suggested change:

- run: mvn versions:set -B -DnewVersion=\${{ github.event.inputs.tag }}
+ env:
+   NEW_VERSION: \${{ github.event.inputs.tag }}
+ run: mvn versions:set -B -DnewVersion="$NEW_VERSION"

Relevant PR: #63
Comment URL: here

Requested by overheadhunter.

@infeo
Copy link
Member

infeo commented May 16, 2024

Fixed in 83a9097

@infeo infeo closed this as completed May 16, 2024
infeo added a commit that referenced this issue May 16, 2024
@overheadhunter
Copy link
Member

Fixed the fix in 75c56b7

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

No branches or pull requests

2 participants