subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
try: print(f"Generating PDF: {output_pdf}") print(f"Command: {' '.join(cmd)}") result = subprocess.run(cmd, capture_output=True, text=True, check=True) print(f"✓ PDF generated successfully: {output_pdf}") return True except subprocess.CalledProcessError as e:- Confidence
- 88% confidence
- Finding
- The script executes an external binary (pandoc/xelatex) on attacker-influenced inputs such as the markdown file, bibliography, template, and CSL path. Although shell injection is mitigated by passing a list to subprocess.run, processing untrusted document content through pandoc/LaTeX can trigger risky file reads, network fetches, or exploitation of vulnerabilities in those external tools, which is more dangerous in an agent skill that may handle arbitrary user-supplied literature content.
