fix(security): harden subprocess calls against shell injection - #2750
Closed
nidhi-singh02 wants to merge 2 commits into
Closed
fix(security): harden subprocess calls against shell injection#2750nidhi-singh02 wants to merge 2 commits into
nidhi-singh02 wants to merge 2 commits into
Conversation
- Replace shell=True with shlex.split() in transcription_tools.py - Use list-based subprocess in mini-swe-agent docker cleanup - Replace assert with RuntimeError in docker environment check
After hardening against shell injection (shlex.split instead of shell=True), both ffmpeg and whisper commands arrive as lists. Distinguish them by checking the binary name rather than the argument type.
Contributor
|
This is now fixed via PR #5629 (merged), which sanitizes workdir with tilde-aware shlex.quote + an allowlist validator. Thanks for flagging the vulnerability! |
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.
Summary
shell=Truewithshlex.split()intools/transcription_tools.pymini-swe-agentdocker cleanup to prevent injection via container_idassertwithRuntimeErrorintools/environments/docker.py(assertions stripped bypython -O)Closes #2743
Test Plan
shlex.split()changepython -Odoesn't bypass the container_id checkPlatforms Tested