T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:60
- Finding
- Mutable Git Installation and Unpinned Build Backend Permit Supply-Chain Code Execution<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:60-64`; `pyproject.toml:1-3` **Vulnerability Type**: Unpinned and mutable installation-time dependencies **Risk Level**: Medium ### Vulnerable Code `SKILL.md:60-64`: ```markdown ## Standalone Repo Install via pip: `pip install git+https://github.com/brandoncrabpi/yr-weather.git` - `yr-weather -33.9288 18.4174` - Tagged: v1.0.0 ``` `pyproject.toml:1-3`: ```toml [build-system] requires = ["hatchling"] build-backend = "hatchling.build" ``` ### Technical Analysis The documented Git installation command does not pin the package to the advertised `v1.0.0` tag or, preferably, an immutable commit hash. Pip therefore retrieves the current state of the repository's default branch. The code installed and built may consequently differ from the version that was audited. The build-system dependency also specifies `hatchling` without an exact version or reviewed constraint. During package installation, pip resolves and executes the selected build backend. This gives mutable upstream build tooling an installation-time code-execution opportunity. No malicious payload was found in the reviewed project. The vulnerability is the inability to guarantee that future executions of the documented installation process will retrieve and run the reviewed code. ### Attack Path 1. An attacker compromises the referenced GitHub repository, its maintainer account, the package source used to resolve `hatchling`, or another relevant supply-chain component. 2. The attacker publishes malicious repository content or a malicious dependency version. 3. A user or Agent follows the documented command: ```bash pip install git+https://github.com/brandoncrabpi/yr-weather.git ``` 4. Pip retrieves the mutable default branch and resolves the unconstrained build backend. 5. The compromised build or package code executes during installation or later through the installed command-line entry points. 6. The malicious code operate ...[truncated 777 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin Git installations to a reviewed immutable full commit SHA: ```bash pip install "git+https://github.com/brandoncrabpi/yr-weather.git@FULL_REVIEWED_COMMIT_SHA" ``` 2. If a release tag is documented for usability, verify that the tag is protected and signed. A commit SHA should still be preferred because ordinary Git tags can be moved. 3. Pin the build backend to a reviewed version: ```toml [build-system] requires = ["hatchling==REVIEWED_VERSION"] build-backend = "hatchling.build" ``` 4. Use a controlled dependency-locking process with cryptographic hashes where supported. Retrieve dependencies only from explicitly trusted indexes. 5. Build wheels in an isolated, restricted environment and publish reviewed artifacts with checksums or signatures. Recommend installing the verified wheel instead of building mutable repository content directly. 6. Add automated dependency review, provenance verification, and periodic checks for unexpected changes to release tags, build dependencies, and package ownership. ]]>
