subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
system_name = platform.system().lower() if system_name == "windows": command = _build_windows_command(location, recursive) output = subprocess.run( command, capture_output=True, text=True,- Confidence
- 98% confidence
- Finding
- This subprocess invocation reaches PowerShell with a dynamically constructed command string that embeds the user-supplied directory path inside single quotes. On Windows, a path containing a single quote or PowerShell metacharacters can break out of the intended literal and cause command injection, giving an attacker arbitrary command execution. In the context of a skill that accepts local paths from conversation input, this is more dangerous because the input is likely user-controlled.
