subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
return "Command not allowed" try: result = subprocess.getoutput(command) return result[:4000] # Telegram limit safe except Exception as e: return str(e)- Confidence
- 98% confidence
- Finding
- The function passes a user-controlled string directly to subprocess.getoutput(), which executes through the shell. The startswith check is not a safe allowlist because inputs like 'clawhub; cat /etc/passwd' or 'clawhub && curl ...' still pass and enable arbitrary command chaining. In an agent skill context, this is especially dangerous because remote users may be able to trigger OS command execution on the host running the skill.
