-
Notifications
You must be signed in to change notification settings - Fork 545
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
Don't concatenate shell arguments. #1974
Conversation
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like the tests are failing for a weird reason.
It's a buffer: '{"token":{"accessToken":"token"}}'
and it seems like the leading and trailing '
are responsible.
I've pushed a commit which fixes one of the failing tests.
I did not look to deep into it, but the "fix" seems hacky and weird to me.
Just want to save you some time if you have a look later, feel free to drop/change that commit in any way you want.
@mstruebing I added a fix which I think is more correct, removing leading/trailing quote marks for each arg. |
ad46117
to
bc4faeb
Compare
Keywords which can automatically close issues and at(@) or hashtag(#) mentions are not allowed in commit messages. The list of commits with invalid commit messages:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
/lgtm Thanks 🚀 |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: brendandburns, mstruebing The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Fixes https://github.com/kubernetes-client/javascript/security/code-scanning/17
To fix the problem, we should avoid using
proc.execSync
with a dynamically constructed command string. Instead, we can usechild_process.execFileSync
, which takes the command and its arguments as separate parameters, thus avoiding shell interpretation of the arguments. This change will ensure that the arguments are passed safely to the command without the risk of command injection.Steps to fix:
proc.execSync
withproc.execFileSync
.execFileSync
.Suggested fixes powered by Copilot Autofix. Review carefully before merging.