Skip to content

fix(security): replace shell=True with shlex.split() to prevent shell injection#2113

Open
Jah-yee wants to merge 1 commit intoTEN-framework:mainfrom
Jah-yee:fix/shell-injection-security
Open

fix(security): replace shell=True with shlex.split() to prevent shell injection#2113
Jah-yee wants to merge 1 commit intoTEN-framework:mainfrom
Jah-yee:fix/shell-injection-security

Conversation

@Jah-yee
Copy link

@Jah-yee Jah-yee commented Mar 17, 2026

Fixes #2107 and #2106

This change addresses security vulnerabilities where subprocess.run() was called with shell=True, which allows shell injection attacks.

Replaced with shlex.split() to properly parse commands without invoking a shell interpreter.

Files modified:

  • ai_agents/agents/examples/voice-assistant-nodejs/tenapp/ten_packages/extension/main_nodejs/tools/run_script.py
  • packages/core_apps/default_app_cpp/tools/run_script.py
  • packages/core_extensions/default_extension_nodejs/tools/run_script.py
  • packages/example_apps/transcriber_demo/ten_packages/extension/vtt_nodejs/tools/run_script.py

… injection

Fixes TEN-framework#2107 and TEN-framework#2106

This change addresses security vulnerabilities where subprocess.run()
was called with shell=True, which allows shell injection attacks.
Replaced with shlex.split() to properly parse commands without invoking
a shell interpreter.
Jah-yee pushed a commit to Jah-yee/ten-framework that referenced this pull request Mar 18, 2026
…njection

Replaces dangerous shell=True in subprocess.run with shell=False +
shlex.split() to prevent shell injection vulnerabilities in 5 files:
- ai_agents/agents/examples/voice-assistant-nodejs/.../run_script.py
- packages/core_apps/default_app_cpp/tools/run_script.py
- packages/core_extensions/default_extension_cpp/tools/run_script.py
- packages/core_extensions/default_extension_nodejs/tools/run_script.py
- packages/example_apps/transcriber_demo/.../run_script.py

Fixes issues TEN-framework#2107, TEN-framework#2106, TEN-framework#2111, TEN-framework#2113, TEN-framework#2114
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant