T08 · Insecure Dependencies
- Location
- install.py:14
- Finding
- Unpinned Dependencies Are Installed from the Active Package Index<![CDATA[ ## Vulnerability Details **File Location**: `install.py`, lines 14-23 **Vulnerability Type**: Unpinned third-party dependency installation **Risk Level**: Medium ### Vulnerable Code ```python dependencies = [ 'requests', 'dateparser', 'beautifulsoup4', ] for dep in dependencies: print(f" Installing {dep}...") try: subprocess.check_call([sys.executable, '-m', 'pip', 'install', dep]) ``` ### Technical Analysis The installation script invokes pip using package names without version constraints, cryptographic hashes, a lockfile, or an explicitly trusted package index. Consequently, the precise code installed and executed can change between installations without any modification to the audited Skill package. Python package installation may execute package build logic and installs packages into the active Python environment. The source used by pip is determined by the user's environment and pip configuration. This can include an internal or attacker-controlled index. The package names shown are established public packages rather than obvious typosquatting attempts. Nevertheless, the absence of reproducible dependency controls creates a supply-chain exposure if: - A package or one of its transitive dependencies is compromised. - A malicious release is published under an existing dependency name. - The user's pip configuration points to an untrusted package index. - Dependency resolution selects an unexpected or vulnerable version. ### Attack Path 1. The user follows the documented installation process and runs `python3 install.py`. 2. `install.py` invokes the active Python interpreter with `pip install` for each unpinned package. 3. pip resolves the latest compatible package and transitive dependencies from its configured indexes. 4. A compromised package artifact or malicious index returns attacker-controlled installation content. 5. pip executes applicable build or installation logic with the privileges of the user run ...[truncated 832 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Create a reviewed dependency lock file containing exact versions. 2. Add cryptographic hashes for every direct and transitive package. 3. Install dependencies with hash verification: ```bash python3 -m pip install --require-hashes -r requirements.txt ``` 4. Document and enforce the expected trusted package index, for example: ```bash python3 -m pip install \ --index-url https://pypi.org/simple \ --require-hashes \ -r requirements.txt ``` 5. Use a dedicated virtual environment rather than modifying an arbitrary active Python environment. 6. Review and update pinned dependencies through a controlled dependency-update process. 7. Generate and retain a software bill of materials for released Skill versions. 8. Consider removing automatic dependency installation and instead report missing dependencies with explicit, reproducible installation instructions. ]]>
