subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
else: import subprocess try: subprocess.run( ["powershell", "-Command", f"Set-Clipboard -Value '{text}'"], capture_output=True, timeout=3 )- Confidence
- 98% confidence
- Finding
- The code interpolates raw clipboard text into a PowerShell `-Command` string: `Set-Clipboard -Value '{text}'`. If clipboard content contains quotes or PowerShell metacharacters, it can break out of the quoted string and execute arbitrary PowerShell commands, turning untrusted clipboard data into code execution.
