T08 · Insecure Dependencies
- Location
SKILL.md:12- Finding
Unpinned System-Wide Python Dependency Installation
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 12-16
Vulnerability Type: Unsafe third-party dependency installation
Risk Level: MediumVulnerable Code
markdown ## 安装 首次使用时,安装依赖: ```bash pip3 install --break-system-packages requests python-dotenvtext ### Technical Analysis The installation command retrieves `requests` and `python-dotenv` from the configured Python package index without pinning reviewed versions, verifying cryptographic hashes, or using a lock file. Consequently, the installed artifacts can change between executions even though the audited skill content remains unchanged. The command also uses `--break-system-packages`, which bypasses Python's externally managed environment protection. This permits pip to modify the host's system-managed Python environment and can overwrite or conflict with operating-system packages. Exploitation requires the configured package source or a selected dependency release to become malicious or otherwise untrusted. No evidence in the audited project indicates that either named package is currently malicious; the finding concerns the unsafe installation mechanism and resulting supply-chain exposure. ### Attack Path 1. A user or agent follows the first-use installation instructions. 2. The command connects to the configured Python package index and resolves the latest acceptable dependency versions. 3. An attacker who has compromised the package source, a dependency release, or the relevant package-distribution path supplies a malicious artifact. 4. Pip downloads and installs that artifact without checking a project-defined version or hash. 5. Package installation logic executes with the privileges of the invoking account. 6. Because `--break-system-packages` permits changes to the system Python environment, malicious or incompatible components can affect other Python applications that use the same environment. ### Impact Assessment A malicious dependency artifact could ex ...[truncated 594 chars]- Remediation
View remediation
Remediation Suggestions
- Remove
--break-system-packagesand install dependencies in a dedicated virtual environment:
bash python3 -m venv .venv . .venv/bin/activate python3 -m pip install --require-hashes -r requirements.txt- Pin every direct and transitive dependency to a reviewed version in
requirements.txt. - Record SHA-256 hashes for every permitted distribution and enforce them with
--require-hashes. - Generate and review a dependency lock file using a tool such as
pip-tools. - Use a trusted, explicitly configured package index and secure transport.
- Periodically scan locked dependencies for known vulnerabilities and review updates before changing pinned versions.
- Document that installation must not be performed as root or in the operating system's managed Python environment.
- Remove
