subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
custom_cmd = os.environ.get("IMPROVE_LLM_CMD") if custom_cmd: try: result = subprocess.run(custom_cmd.split(), input=prompt, capture_output=True, text=True, timeout=timeout) if result.returncode == 0 and result.stdout.strip(): return result.stdout.strip()- Confidence
- 97% confidence
- Finding
- The fallback executes a command taken from the IMPROVE_LLM_CMD environment variable, which gives whoever controls the environment the ability to make the skill invoke an arbitrary executable with attacker-controlled prompt data on stdin. Although split() and shell=False avoid classic shell metacharacter injection, this still materially broadens execution to arbitrary programs and can be used for data exfiltration or unexpected side effects.
