subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
def _compile_pdf(self, tex_file): try: for _ in range(2): subprocess.run( ['pdflatex', '-interaction=nonstopmode', str(tex_file)], cwd=str(tex_file.parent), capture_output=True,- Confidence
- 90% confidence
- Finding
- The code executes a local LaTeX compiler on a generated .tex file that incorporates untrusted external content from arXiv paper titles, abstracts, authors, and categories without LaTeX escaping or sandboxing. Even though subprocess.run is invoked without shell=True, pdflatex itself interprets the document, so crafted TeX content can trigger file reads, resource exhaustion, or command execution depending on the TeX configuration and enabled features.
