Skip to content

Security: Command Injection via shell=True in with_server.py#67

Open
tuanaiseo wants to merge 1 commit into
ComposioHQ:masterfrom
tuanaiseo:contribai/fix/security/command-injection-via-shell-true-in-with
Open

Security: Command Injection via shell=True in with_server.py#67
tuanaiseo wants to merge 1 commit into
ComposioHQ:masterfrom
tuanaiseo:contribai/fix/security/command-injection-via-shell-true-in-with

Conversation

@tuanaiseo
Copy link
Copy Markdown

Problem

The script uses shell=True in subprocess.Popen which allows shell injection attacks. User-controlled server commands could execute arbitrary shell commands.

Severity: critical
File: webapp-testing/scripts/with_server.py

Solution

Replace shell=True with shell=False and pass command as a list of arguments instead of a string. Use shlex.split() if shell is required, or better yet, avoid shell=True entirely.

Changes

  • webapp-testing/scripts/with_server.py (modified)

Testing

  • Existing tests pass
  • Manual review completed
  • No new warnings/errors introduced

The script uses `shell=True` in subprocess.Popen which allows shell injection attacks. User-controlled server commands could execute arbitrary shell commands.

Affected files: with_server.py

Signed-off-by: tuanaiseo <221258316+tuanaiseo@users.noreply.github.com>
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