subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
return print(f"开始安装飞书 CLI:npm install -g {LARK_CLI_PACKAGE}") completed = subprocess.run(["npm", "install", "-g", LARK_CLI_PACKAGE], text=True) if completed.returncode != 0: print("安装失败。可以手动执行:") print(f"npm install -g {LARK_CLI_PACKAGE}")- Confidence
- 85% confidence
- Finding
- The script can automatically install and execute an external package globally via npm, which expands the trust boundary to the npm ecosystem and the current registry configuration. If the package, dependency chain, or npm configuration is compromised, a user running the doctor command with --install-cli could execute untrusted code on their machine.
