T08 · Insecure Dependencies
Warning
- Location
- install.sh:13
- Finding
- Unpinned dependencies are installed into the active Python environment<![CDATA[ ## Vulnerability Details **File Location**: `install.sh:13-15`; related declaration at `skill.json:9` **Vulnerability Type**: Supply-chain exposure through unconstrained dependency installation **Risk Level**: Medium ### Vulnerable Code ```bash # 安装依赖 echo "📦 安装 Python 依赖..." pip3 install openai python-dotenv --quiet ``` Related manifest declaration: ```json "requirements": ["openai>=1.0.0", "python-dotenv>=1.0.0"], ``` ### Technical Analysis The installer retrieves `openai` and `python-dotenv` without exact version pins, integrity hashes, a lockfile, or an isolated virtual environment. The manifest's `>=` constraints similarly permit any later release. Consequently, the code installed and imported by the Skill can change after the Skill itself has been audited. The direct package names are legitimate and no malicious dependency is currently demonstrated, but this installation method leaves the Skill exposed to compromised upstream releases, dependency-account takeover, and incompatible future versions. Using the active `pip3` also modifies the user's current Python environment rather than a Skill-specific environment. This can create dependency conflicts and expands the scope of package installation beyond what is necessary for the Skill. ### Attack Path 1. An attacker compromises a permitted package release or its publishing account. 2. A new malicious version is published under the legitimate package name. 3. A user runs `install.sh`. 4. `pip3` resolves and downloads the newest permitted release without hash verification. 5. Package-controlled code executes during installation or when `repurpose.py` imports the package. 6. The malicious package obtains the privileges of the user running the installer or Skill. ### Impact Assessment A compromised dependency could read files accessible to the current user, including the Skill's OpenAI API key and article contents; make network requests; alter the user's Python environment; or execute arbi ...[truncated 276 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin every dependency to an exact reviewed version. 2. Generate and commit a lockfile containing cryptographic hashes. 3. Install with hash verification, such as: ```bash python3 -m pip install --require-hashes -r requirements.txt ``` 4. Create a dedicated virtual environment inside the Skill directory rather than modifying the user's active Python environment. 5. Use `python3 -m pip` to ensure dependencies are installed for the same interpreter used to run the Skill. 6. Regularly review pinned versions and update them through an explicit, tested dependency-update process. ]]>
