fix: prevent command injection vulnerabilities in install_dependencie…#18
Open
123mutouren321414 wants to merge 1 commit intobazinga012:masterfrom
Open
fix: prevent command injection vulnerabilities in install_dependencie…#18123mutouren321414 wants to merge 1 commit intobazinga012:masterfrom
123mutouren321414 wants to merge 1 commit intobazinga012:masterfrom
Conversation
…s tool This change replaces the unsafe use of child_process.execAsync in the install_dependencies tool with execFileAsync and passes command arguments as arrays instead of constructing shell command strings. Previously, the install_dependencies tool built package installation commands by concatenating user-controlled packages into shell command strings such as conda install, pip install, or uv pip install, and then executed them via child_process.execAsync. Because exec invokes commands through a system shell, specially crafted package names could potentially be interpreted as additional commands, leading to command injection. This update: replaces child_process.execAsync with execFileAsync passes installation arguments as arrays instead of interpolated shell command strings removes shell-based package list construction in install_dependencies preserves the existing dependency installation behavior across supported environment types By avoiding shell interpretation of user-controlled package names, this change prevents potential command injection vulnerabilities while maintaining the original functionality of the install_dependencies tool.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…s tool
This change replaces the unsafe use of child_process.execAsync in the install_dependencies tool with execFileAsync and passes command arguments as arrays instead of constructing shell command strings. Previously, the install_dependencies tool built package installation commands by concatenating user-controlled packages into shell command strings such as conda install, pip install, or uv pip install, and then executed them via child_process.execAsync. Because exec invokes commands through a system shell, specially crafted package names could potentially be interpreted as additional commands, leading to command injection.
This update:
replaces child_process.execAsync with execFileAsync
passes installation arguments as arrays instead of interpolated shell command strings
removes shell-based package list construction in install_dependencies
preserves the existing dependency installation behavior across supported environment types
By avoiding shell interpretation of user-controlled package names, this change prevents potential command injection vulnerabilities while maintaining the original functionality of the install_dependencies tool.