subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
html_tmp = Path(tempfile.mktemp(suffix=".html")) try: write_html(content, html_tmp, title) result = subprocess.run( [ chrome, "--headless", "--disable-gpu", "--no-sandbox",- Confidence
- 93% confidence
- Finding
- The PDF export path launches a locally installed browser with attacker-controlled content written to a temporary HTML file and explicitly passes the dangerous '--no-sandbox' flag. Even though subprocess.run is used without a shell, rendering untrusted HTML in a browser can still trigger network fetches, local file access attempts, or browser-engine exploitation, which is unnecessary risk for a local export utility.
