subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
env['PATH'] = extra_path + ':' + env.get('PATH', '') def xelatex(): result = subprocess.run( ['xelatex', '-interaction=nonstopmode', 'thesis.tex'], cwd=latex_dir, env=env, capture_output=True, text=True- Confidence
- 89% confidence
- Finding
- This code compiles a generated `thesis.tex` using `xelatex` on content derived from user-supplied documents and AI-produced structure. TeX compilation can process dangerous directives or escape into external commands depending on engine/configuration, so invoking it on untrusted input can lead to arbitrary file reads, command execution, or hostile side effects during build.
