T08 · Insecure Dependencies
- Location
guides/01-installation.md:64- Finding
Unpinned Installation from a Mutable Git Repository
- Content
View full analysis
Vulnerability Details
File Location:
guides/01-installation.md:64-69
Vulnerability Type: Unpinned third-party source dependency
Risk Level: Mediumbash ### 方法3: 从源码安装(最新开发版) ```bash pip install git+https://github.com/Textualize/rich.gittext ### Technical Analysis The documented command installs Rich directly from the current default branch of an external Git repository. It does not pin a reviewed commit, release tag, or immutable artifact hash. A pip VCS installation retrieves repository content at execution time and may execute package build or installation logic with the privileges of the invoking user. Consequently, the effective code installed by this command can differ from the code available when the Skill was audited. Although the URL points to the declared official Rich repository, upstream account compromise, repository compromise, or an unsafe future commit could turn this instruction into a supply-chain execution channel. ### Attack Path 1. An attacker compromises the upstream repository, a maintainer account, or the repository's default branch. 2. The attacker adds malicious package source, build-backend behavior, or installation logic. 3. The user or AI agent follows the Skill and runs `pip install git+https://github.com/Textualize/rich.git`. 4. Pip downloads the mutable repository state and invokes the applicable build and installation process. 5. The malicious code executes or is installed into the selected Python environment. ### Impact Assessment Malicious installation logic could execute with the privileges of the account running pip. Depending on that account and environment, it could read or modify user-accessible files, steal environment credentials, alter the Python environment, or install persistent malicious Python components. If the command is run with elevated privileges, the effect could extend to system-wide Python packages and files.- Remediation
View remediation
Remediation Suggestions
- Remove the mutable default-branch installation from the recommended workflow.
- Prefer a reviewed and pinned release from PyPI:
bash python -m pip install "rich==13.9.4" - Use a lock file and require package hashes in production or automated environments.
- If a VCS installation is necessary, pin an audited full commit SHA:
bash python -m pip install "rich @ git+https://github.com/Textualize/rich.git@<full-commit-sha>" - Perform source installations only inside an isolated virtual environment.
- Avoid running pip with administrator or root privileges.
- Review the pinned revision and its build configuration before installation.
