subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
import subprocess, shlex msg_safe = message.replace("\\", "\\\\").replace('"', '\\"') title_safe = title.replace("\\", "\\\\").replace('"', '\\"') subprocess.run([ "osascript", "-e", f'display notification "{msg_safe}" with title "Bambu Studio AI" subtitle "{title_safe}"' ], timeout=5, capture_output=True)- Confidence
- 83% confidence
- Finding
- Although subprocess.run is called safely without a shell, untrusted title/message content is embedded into an AppleScript expression passed to osascript. Escaping only backslashes and double quotes is incomplete for AppleScript contexts, so crafted input may break script semantics or trigger unintended behavior on the host running the skill.
