T08 · Insecure Dependencies
Warning
- Location
- install.sh:14
- Finding
- Unpinned Third-Party Packages Are Installed into the Active Python Environment<![CDATA[ ## Vulnerability Details **File Location**: `install.sh:14-16` **Vulnerability Type**: Supply-chain exposure through unpinned dependencies **Risk Level**: Medium ### Vulnerable Code ```bash # 安装依赖 echo "📦 安装 Python 依赖..." pip3 install openai python-dotenv --quiet ``` The package metadata also permits any version equal to or newer than the specified minimum: ```json "requirements": ["openai>=1.0.0", "python-dotenv>=1.0.0"], ``` Location: `skill.json:8` ### Technical Analysis The installation script asks `pip3` to resolve and install the latest available versions of `openai` and `python-dotenv`. It does not use exact versions, integrity hashes, a lock file, or an isolated virtual environment. Consequently, the code installed by the skill can differ from the code that was reviewed. A compromised package release, compromised transitive dependency, or future malicious release could execute code during installation or when imported by `source/podcast_generator.py`. The direct package names are legitimate and there is no evidence that this project intentionally references a malicious package; the vulnerability is the absence of supply-chain controls. The bare `pip3` command also installs into whichever Python environment is active. This can alter a shared user or system environment and affect unrelated applications. ### Attack Path 1. An attacker compromises a permitted package release or one of its transitive dependencies. 2. The malicious release remains compatible with the unconstrained installation command. 3. A user runs `install.sh`. 4. `pip3` downloads and installs the currently resolved release without checking a project-supplied hash. 5. Malicious installation hooks or imported package code execute with the privileges of the user running the installer. 6. If the user runs the installer under an elevated account, the dependency code receives those elevated privileges. ### Impact Assessment Successful exploitation can execute arbitrary ...[truncated 578 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Create a dedicated virtual environment for this skill rather than modifying the active Python environment. 2. Pin every direct and transitive dependency to an exact, reviewed version. 3. Generate a hash-locked requirements file and install it with integrity enforcement: ```bash python3 -m venv "$SCRIPT_DIR/.venv" "$SCRIPT_DIR/.venv/bin/python" -m pip install --require-hashes -r requirements.lock ``` 4. Generate `requirements.lock` with a trusted locking tool and include SHA-256 hashes for every permitted artifact. 5. Use `python3 -m pip` from the intended interpreter instead of an unqualified `pip3`. 6. Review dependency updates before regenerating the lock file and use automated dependency vulnerability scanning. 7. Avoid instructing users to run the installer with elevated privileges. ]]>
