T08 · Insecure Dependencies
Warning
- Location
- scripts/verify_install.sh:8
- Finding
- Unpinned Third-Party Package Installation## Vulnerability Details **File Location**: `scripts/verify_install.sh:8-10` **Additional Locations**: `SKILL.md:35`, `SKILL.md:41`, `SKILL.md:60`; `references/upstream-README.md:20-34`; `references/upstream-README.zh-CN.md:20-34` **Vulnerability Type**: Unpinned and unaudited dependency installation **Risk Level**: Medium **Vulnerable Code**: ```bash source "$TMPDIR/venv/bin/activate" python3 -m pip install --upgrade pip >/dev/null python3 -m pip install clawpolicy >/dev/null ``` The documentation also recommends: ```bash python3 -m pip install clawpolicy python3 -m pip install "clawpolicy[phase3]" ``` ### Technical Analysis The verification script and installation documentation install `clawpolicy` without a version constraint or package hashes. Consequently, pip resolves whichever release is current at execution time rather than the release represented by the reviewed wrapper. The wrapper identifies itself as targeting version 3.0.1, but the installation command does not enforce that version. Python package installation can execute package build logic, and subsequent smoke-test commands execute the installed package directly. Its transitive dependencies are also resolved without integrity pinning. The optional `phase3` extra expands this uncontrolled dependency set further. The `pip` upgrade is likewise unpinned. Although installation occurs inside a temporary virtual environment, code executed during installation and smoke testing retains the invoking user's operating-system privileges and can access resources available to that user. The external package implementation is not included in this project, so its behavior could not be verified by this audit. ### Attack Path 1. An attacker compromises the `clawpolicy` PyPI project, one of its transitive dependencies, or a future package release. 2. The attacker publishes a malicious release that still satisfies the unconstrained package name. 3. A user or ...[truncated 1243 chars]
- Remediation
- ## Remediation Suggestions 1. Pin the reviewed package release explicitly: ```bash python3 -m pip install "clawpolicy==3.0.1" ``` 2. Generate a reviewed lock file containing exact versions and SHA-256 hashes for every transitive dependency, then enforce it: ```bash python3 -m pip install --require-hashes -r requirements.lock ``` 3. Pin and hash optional dependencies separately. Do not recommend `clawpolicy[phase3]` until its expanded dependency graph has been audited and locked. 4. Remove the unconditional unpinned pip upgrade, or pin and verify the required pip version in the same manner. 5. Ensure the version declared in the wrapper metadata, documentation, verification script, and lock file remains synchronized. 6. Run package verification in a sandbox or isolated container with no credentials, minimal filesystem access, restricted outbound networking, and an unprivileged user. A virtual environment alone is not a security boundary. 7. Add automated dependency review, vulnerability scanning, provenance verification, and lock-file integrity checks to the release workflow.
