os.system() or os exec-family call
High
- Category
- Dangerous Code Execution
- Content
"""使用 Chrome 将 HTML 转换为 PDF""" log(f"转换 PDF: {html_path} -> {pdf_path}") cmd = f'google-chrome --headless --disable-gpu --print-to-pdf={pdf_path} --print-to-pdf-no-header --paper-size=A4 {html_path}' os.system(cmd) def upload_to_feishu(file_path: str) -> bool: """上传文件到飞书云空间"""- Confidence
- 95% confidence
- Finding
- The script builds a shell command with f-string interpolation and executes it via os.system(), which is unsafe because file paths are inserted without shell escaping. If WORKSPACE, html_path, or pdf_path contain shell metacharacters, an attacker could trigger arbitrary command execution under the script's privileges.
