subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
$doc.Close($false); $word.Quit() ''' subprocess.run(['powershell', '-Command', cmd], capture_output=True) print(f" 已转换: {pdf_path}")- Confidence
- 96% confidence
- Finding
- The code invokes PowerShell to execute a dynamically constructed script that embeds file paths directly into the command string. If an attacker can influence docx_path or pdf_path, they may be able to break out of the quoted PowerShell strings and trigger unintended PowerShell/COM actions, turning document conversion into command/script injection.
