T08 · Insecure Dependencies
- Location
simple_fix.py:21- Finding
Unpinned Runtime Installation of Third-Party Packages
- Content
View full analysis
Vulnerability Details
File Location:
simple_fix.py:21-37
Vulnerability Type: Unsafe dependency installation and supply-chain exposure
Risk Level: MediumVulnerable Code
python def install_dependencies(): """安装依赖""" print("📦 安装必要依赖...") dependencies = [ "akshare", "pandas", "numpy", "tqdm" ] for dep in dependencies: print(f" 安装 {dep}...") try: subprocess.check_call([sys.executable, "-m", "pip", "install", dep, "--quiet"]) print(f" ✅ {dep} 安装成功") except subprocess.CalledProcessError: print(f" ⚠️ {dep} 安装失败,尝试继续...")The same unsafe installation practice is recommended in
SKILL.md:15-18and embedded in generated documentation atregister_with_openclaw.py:125-128:bash pip install akshare pandas numpyTechnical Analysis
The environment-repair utility installs packages from the default pip package index without exact version constraints, integrity hashes, a lock file, or an explicitly approved repository. Package versions and transitive dependencies can therefore change after the Skill has been reviewed.
Python packages may execute installation or build logic, and imported packages execute module initialization code. Consequently, an upstream package compromise, malicious transitive dependency, or unexpectedly changed release could introduce arbitrary code into the environment.
The package names shown are not demonstrated to be malicious; the vulnerability is the mutable and unauthenticated dependency-resolution process.
Attack Path
- An attacker compromises a listed package, one of its transitive dependencies, or the package-distribution account.
- A malicious package release becomes eligible for normal pip resolution.
- A user follows the documentation or runs
simple_fix.py. - The script invokes pip using the current Python interpreter.
- pip downloads and installs the mutable ...[truncated 651 chars]
- Remediation
View remediation
Remediation Suggestions
- Pin every direct dependency to a reviewed exact version.
- Generate and commit a lock file that records transitive dependencies.
- Require cryptographic hashes, such as through
pip install --require-hashes. - Configure an explicitly approved package index or internal mirror.
- Review dependency updates before modifying the lock file.
- Move package installation out of the general environment-repair script and require explicit user approval.
- Run installation in an isolated virtual environment with minimal filesystem and network privileges.
- Add automated dependency vulnerability and provenance scanning.
