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 code scanning alert no. 13: Shell command built from environment values #4698

Merged
merged 1 commit into from
Dec 10, 2024

Conversation

vrubezhny
Copy link
Contributor

Fixes https://github.com/redhat-developer/vscode-openshift-tools/security/code-scanning/13

To fix the problem, we should avoid constructing the shell command as a single string and instead use cp.execFileSync to pass the command and its arguments separately. This approach ensures that the shell does not misinterpret any special characters in the environment values.

Specifically, we need to:

  1. Replace the use of cp.execSync with cp.execFileSync.
  2. Separate the command and its arguments to avoid shell interpretation issues.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…values

Fixes: https://github.com/redhat-developer/vscode-openshift-tools/security/code-scanning/13

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@vrubezhny vrubezhny marked this pull request as ready for review December 10, 2024 17:03
@vrubezhny vrubezhny merged commit c6166d2 into main Dec 10, 2024
6 checks passed
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.

1 participant