subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
f.write(summary) # 清理 subprocess.run(["rm", "-rf", str(TEMP_DIR)], check=True) print(f"\n✅ 完成!") print(f" 成功:{len(results)}/{len(PDF_FILES)}")- Confidence
- 95% confidence
- Finding
- The script recursively deletes TEMP_DIR using rm -rf, and TEMP_DIR is derived from WORKSPACE, which comes from an environment variable. If WORKSPACE is misconfigured or maliciously set, cleanup could remove unintended directories, causing destructive data loss beyond the intended temp folder.
