subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
if system == 'windows': # PowerShell Set-Clipboard is faster than clip.exe for Unicode try: subprocess.run( ['powershell', '-NoProfile', '-Command', f'Set-Clipboard -Value "{text.replace(chr(34), "`" + chr(34))}"'], check=True, capture_output=True, timeout=5)- Confidence
- 83% confidence
- Finding
- The Windows clipboard path builds a PowerShell command string by embedding user-controlled text directly inside -Command. Only double quotes are escaped; PowerShell metacharacters and subexpressions can still alter command behavior, enabling command injection when crafted text is passed to the type operation.
