subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
for path in possible_paths: try: result = subprocess.run([path, "--version"], capture_output=True, text=True, timeout=10) if result.returncode == 0: print(f"✓ Found Calibre ebook-convert: {path}") return path- Confidence
- 84% confidence
- Finding
- The code falls back to executing "ebook-convert" via PATH lookup if fixed locations are not found. In environments where PATH can be influenced, an attacker could plant a malicious executable named ebook-convert and have this script run it, resulting in arbitrary code execution under the script's privileges.
