subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
print(f" 安装 TeX Live:https://tug.org/texlive/") print(f" 或将 {args.engine} 所在目录加入系统 PATH 环境变量") sys.exit(1) result = subprocess.run( [engine_path, "--interaction=nonstopmode", out_path], capture_output=True, text=True )- Confidence
- 96% confidence
- Finding
- When --validate is used, the script executes a user-selected LaTeX engine on a generated .tex file assembled from manifest-controlled component files. LaTeX engines are powerful interpreters that can read/write files and, depending on configuration and TeX features, may enable command execution or unsafe file access, so compiling untrusted content is a real code-execution/trust-boundary risk.
