T08 · Insecure Dependencies
- Location
scripts/convert_epub.py:37- Finding
Automatic Installation of Unpinned Python Dependencies
- Content
View full analysis
Vulnerability Details
File Location:
scripts/convert_epub.py:37-38
Vulnerability Type:T08: Insecure Dependencies
Risk Level: Mediumpython # Install dependencies pip_path = venv_path / "bin" / "pip" subprocess.run( [str(pip_path), "install", "ebooklib", "opencc-python-reimplemented"], check=True )Technical Analysis
When required modules are unavailable, the script automatically invokes
pipto installebooklibandopencc-python-reimplemented. Neither package is pinned to a reviewed version, and no lockfile, package hashes, trusted index restriction, or integrity verification is used.Consequently, the code installed during each initial setup depends on the mutable state of the configured Python package index and its transitive dependency graph. The virtual environment is retained at
~/.openclaw/epub_venv, and itssite-packagesdirectory is subsequently inserted at the beginning ofsys.path. Installed package code is therefore imported and executed with the privileges of the user running the converter.The same unpinned installation command is also recommended in
SKILL.md:78andREADME.md:81, reinforcing the unsafe installation practice.Attack Path
- An attacker compromises a direct dependency, one of its transitive dependencies, or the package index configured in the execution environment.
- A user runs the EPUB converter on a system where the required modules or virtual environment are absent.
check_dependencies()creates or reuses~/.openclaw/epub_venv.- The script invokes
pip installwithout version or hash constraints. pipresolves and installs the attacker-controlled package release.- The installed package is imported by the converter, causing attacker-controlled Python initialization code to execute.
- The compromised package remains in the persistent virtual environment and can execute again during subsequent conversions.
...[truncated 714 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove automatic dependency installation from the normal EPUB conversion path. Provide a separate, explicit installation step requiring user approval.
- Pin all direct and transitive dependencies to reviewed versions in a lockfile.
- Record and verify package hashes, and install with
pip install --require-hashes. - Configure an explicitly trusted package index rather than relying on ambient user or system
pipconfiguration. - Build and distribute a reviewed environment or reproducible package artifact where practical.
- Before reusing
~/.openclaw/epub_venv, verify that the directory and its contents are owned by the expected user and are not writable by untrusted principals. - Do not prepend an unverified environment to
sys.path; validate the environment before importing from it. - Update
SKILL.mdandREADME.mdso their manual installation instructions use the same pinned, hash-verified dependency set. - Periodically review dependency advisories and regenerate the lockfile through a controlled update process.
