T08 · Insecure Dependencies
- Location
scripts/requirements.txt:1- Finding
Unpinned Third-Party Dependency Creates a Supply-Chain Risk
- Content
View full analysis
=6.0 ``` `README.md:8`: ```markdown 1. Install dependencies from `scripts/requirements.txt` in a virtual environment. ``` ### Technical Analysis The dependency declaration uses only a lower version bound. Consequently, package installers may resolve any current or future PyYAML release satisfying `>=6.0`. The project does not include an exact version pin, lockfile, package hash, or trusted package-index configuration. This prevents users from reliably reproducing the dependency version covered by the audit. If a compatible future release or configured package index is compromised, following the documented installation procedure could install unaudited code. The installed package is subsequently imported by `scripts/normalize_terms.py:30-36`: ```python try: import yaml except ImportError: print("PyYAML is required to run this script. Please install pyyaml.", file=sys.stderr) return {} with open(path, 'r', encoding='utf-8') as f: return yaml.safe_load(f) ``` The use of `yaml.safe_load` appropriately mitigates unsafe YAML object deserialization, but it does not mitigate compromise of the dependency package itself. ### Attack Path 1. A user follows the installation instruction in `README.md`. 2. The package installer resolves `PyYAML>=6.0` through the user's configured package index. 3. A compromised or malicious compatible release is selected because no exact version or integrity hash restricts resolution. 4. Dependency-controlled code may execute during package installation or when `yaml` is imported by the normalization script. 5. The malicious dependency operates with the permissions of the user or service running the installation and Skill. This path req ...[truncated 992 chars]- Remediation
View remediation
``` 2. Generate and maintain a hash-locked dependency file. Require hash verification during installation, for example: ```bash python -m pip install --require-hashes -r scripts/requirements.txt ``` 3. Record hashes for every permitted distribution and platform rather than copying an unverified hash. 4. Use a trusted, explicitly configured package index or an internally controlled dependency mirror. 5. Add automated dependency vulnerability and provenance checks to the release process. 6. Perform dependency upgrades through a controlled review process, regenerate hashes, run the test suite, and audit relevant release changes before publishing the updated Skill. 7. Continue installing dependencies in an isolated environment and enforce the documented sandbox restrictions, including no network access at runtime and least-privilege workspace permissions. ]]>
