subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
else: print("[INFO] First deployment via deploy hook...") cmd = shlex.split(deploy_cmd) + [str(out)] r = subprocess.run(cmd, capture_output=True, text=True, env=env) if r.returncode == 0: output_text = r.stdout.strip() print(output_text)- Confidence
- 93% confidence
- Finding
- The code executes an external program via subprocess.run based on SKILL_INTRO_DEPLOY_CMD, an environment variable. Although shell injection is reduced by shlex.split and shell=False behavior, this still permits arbitrary code execution within the user's context if the environment is influenced by an attacker or untrusted wrapper, which is dangerous for a documentation-generation skill.
