subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
try: import platform if platform.system() == "Windows": subprocess.run( ["powershell", "-Command", f"Set-Clipboard -Value '{snippet}'"], check=True, capture_output=True )- Confidence
- 97% confidence
- Finding
- The code interpolates untrusted persona content directly into a PowerShell command string passed to `powershell -Command`. If `system_prompt_snippet` contains quotes or PowerShell metacharacters, an attacker who can influence persona files can break out of the clipboard assignment and execute arbitrary commands on Windows. In this skill, persona data is explicitly derived from chat records and editable by users, which makes command injection materially more dangerous.
