subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
env["RKM_WORD_OUTPUT"] = str(output_path) env["RKM_WORD_FORMAT"] = str(file_format) creationflags = getattr(subprocess, "CREATE_NO_WINDOW", 0) result = subprocess.run( [powershell, "-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-Command", script], capture_output=True, text=True,- Confidence
- 91% confidence
- Finding
- This code launches PowerShell to automate Word COM for .doc/.docx conversion. Although it uses an argument list rather than shell string concatenation, invoking an external interpreter with ExecutionPolicy Bypass and processing untrusted document paths expands the attack surface and can trigger risky behavior in local Office automation or document parsing components.
