subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
# 使用powershell设置剪贴板 print('设置剪贴板内容...') ps_cmd = f'Get-Content -Path "{tmp_path}" -Encoding UTF8 -Raw | Set-Clipboard' result = subprocess.run(['powershell', '-Command', ps_cmd], capture_output=True, text=True) if result.returncode != 0: print(f'PowerShell错误: {result.stderr}')- Confidence
- 89% confidence
- Finding
- The script launches PowerShell to manipulate the clipboard using data derived from a file path assembled at runtime. Although the current path is locally controlled, invoking an external interpreter increases attack surface, can behave unexpectedly on different environments, and is unnecessary for a clipboard operation that could be done in-process. In an automation skill, this is more dangerous because it combines OS command execution with blind UI automation and file handling.
