T08 · Insecure Dependencies
Warning
- Location
- README.md:17
- Finding
- Unpinned Installation from a Mutable Git Repository<![CDATA[ ## Vulnerability Details **File Location**: `README.md:17` **Vulnerability Type**: Untrusted and unpinned source dependency **Risk Level**: Medium ### Vulnerable Code ```bash uv tool install git+https://github.com/Lars147/apo-cli ``` ### Technical Analysis The documented installation command downloads and builds code from the current default branch of a personal GitHub repository. It does not pin the source to a reviewed commit SHA, signed release, immutable package version, or verified artifact hash. Consequently, the code installed by a user can differ from the code examined during this audit. If the repository, maintainer account, or publishing workflow is compromised, the mutable branch can be changed to contain malicious package source or build configuration. The installation process invokes the package build backend, and the installed CLI will subsequently run with the privileges of the user who invokes it. The audited local `pyproject.toml` uses Hatchling and does not itself contain a malicious build hook. The risk arises because the documented command may retrieve a future, unaudited version of the repository. ### Attack Path 1. An attacker compromises the referenced GitHub repository, its maintainer account, or an authorized publishing credential. 2. The attacker modifies the repository's default branch to include malicious package code or build behavior. 3. A user follows the Quick Start command in `README.md`. 4. `uv` retrieves the current mutable branch rather than the revision audited here. 5. The retrieved package is built and installed. 6. Attacker-controlled code executes during an affected installation phase or when the user invokes the installed `apo` command. ### Impact Assessment Successful exploitation could execute arbitrary code with the privileges of the user installing or invoking the package. Depending on those privileges, this could expose that user's files, credentials, environment variables, network access, and ...[truncated 204 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin VCS installations to a fully reviewed commit SHA: ```bash uv tool install "git+https://github.com/Lars147/apo-cli@REVIEWED_FULL_COMMIT_SHA" ``` 2. Prefer publishing immutable, versioned releases through a trusted package registry. 3. Publish and verify cryptographic hashes for release artifacts. 4. Protect the source repository with multi-factor authentication, branch protection, mandatory review, and signed commits or tags. 5. Use automated dependency and release-pipeline scanning. 6. Update the documentation to explain that installation from an unpinned branch is not reproducible and should not be used in security-sensitive environments. ]]>
