T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:18
- Finding
- Unpinned PyMilvus Installation Creates a Supply-Chain Risk<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, line 18 **Vulnerability Type**: Unpinned third-party dependency installation **Risk Level**: Medium ### Vulnerable Code ```bash python -m pip install --upgrade pymilvus ``` ### Technical Analysis The installation instructions retrieve and install the latest available `pymilvus` package without a version constraint, lock file, or cryptographic hash. The `--upgrade` option further causes an existing reviewed version to be replaced by whatever release is currently available from the configured Python package index. Consequently, the dependency installed at execution time may differ from the version that was present during the skill audit. Python packages can execute code during installation and whenever imported. The quickstart script imports this dependency directly: ```python from pymilvus import MilvusClient ``` This does not establish that the current PyMilvus package is malicious. It creates a conditional supply-chain attack path if the package, a maintainer account, the package index, or the user's configured index is compromised. ### Attack Path 1. An attacker compromises a PyMilvus release channel, maintainer account, package repository, or package-index configuration accessible to the user. 2. The attacker publishes or serves a malicious package version under the expected package name. 3. A user follows the documented command using `--upgrade` and no version or hash verification. 4. `pip` installs the attacker-controlled version. 5. Malicious code executes during package installation or when `quickstart.py` imports `pymilvus`. ### Impact Assessment Successful exploitation can execute arbitrary Python code with the privileges of the user running `pip` or the quickstart script. Depending on those privileges, the attacker may access local files, environment variables—including `MILVUS_TOKEN`—and network resources available to that user. The scope is the installation environment and ...[truncated 51 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Pin PyMilvus to a specifically reviewed version, for example: ```bash python -m pip install "pymilvus==<reviewed-version>" ``` - Maintain a lock or requirements file containing cryptographic hashes, and install with hash enforcement: ```bash python -m pip install --require-hashes -r requirements.txt ``` - Remove `--upgrade` from routine setup instructions so that reviewed installations are not silently replaced. - Use a trusted, explicitly configured package index and disable unintended fallback indexes where practical. - Run dependency vulnerability and provenance checks before updating the pinned version. - Install and execute the package in an isolated virtual environment with minimal filesystem and network privileges. ]]>
