subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
if password: cmd += [f"--password={password}"] cmd += [path, tmp_path] result = subprocess.run(cmd, capture_output=True, text=True, timeout=30) if result.returncode == 0: reader = PdfReader(tmp_path) print(f"[open_pdf_smart] Decrypted with qpdf subprocess -> temp file '{tmp_path}'")- Confidence
- 86% confidence
- Finding
- The code invokes an external `qpdf` binary on user-supplied PDF paths and optional passwords, which expands the attack surface beyond the Python libraries used by the skill. Although the command is passed safely as a list and is not shell-injectable, processing attacker-controlled PDFs with an external parser plus writing decrypted output to disk can expose the host to parser exploits, sensitive-data leakage, or unsafe handling of untrusted files.
