subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
"""检查依赖""" if not HAS_REQUESTS: print("⚠️ 缺少 requests 库,正在安装...") subprocess.run([sys.executable, "-m", "pip", "install", "requests", "-q"], check=True) global HAS_REQUESTS HAS_REQUESTS = True print("✅ requests 安装完成\n")- Confidence
- 94% confidence
- Finding
- The script automatically invokes pip to install a package at runtime, which modifies the host environment and executes package-installation logic without an explicit opt-in from the user. In an agent/skill context, this is risky because running the tool can trigger unintended dependency changes or package-supply-chain exposure on the system where the skill executes.
