T08 · Insecure Dependencies
- Location
requirements.txt:2- Finding
Interpreter declarations resolve unrelated and unpinned third-party packages
- Content
View full analysis
=3.8 ``` `package.json:41-43`: ```json "dependencies": { "python": ">=3.8" } ``` `SKILL.md:54-57`: ```bash git clone https://github.com/agent-security/scanner.git cd scanner/release/v4.1 pip install -r requirements.txt ``` ### Technical Analysis Python interpreter requirements must not be expressed as package dependencies named `python`. Running `pip install -r requirements.txt` asks the Python package index to resolve a third-party distribution with that name rather than validating the installed interpreter. The npm declaration similarly asks npm to resolve a package named `python`. The declarations use an open lower bound and provide neither a lockfile nor integrity hashes. As a result, installation behavior depends on mutable third-party registry content that is not part of the audited project. This creates a supply-chain exposure and may also make installation unreliable. The Python version requirement should instead be represented through packaging metadata such as `requires-python`. The existing `engines.python` field may communicate compatibility to users, but it does not make the `python` package dependency safe. ### Attack Path 1. A user follows the installation instructions in `SKILL.md`. 2. The user runs `pip install -r requirements.txt`, or installs the npm package with its declared dependencies. 3. The package manager interprets `python` as the name of a registry-hosted package. 4. It resolves an unrelated, mutable package version satisfying the open constraint. 5. Package installation hooks or subsequently imported package code execute with the privileges of the installing user or build environment. Successful exploitation depends on the registr ...[truncated 649 chars]- Remediation
View remediation
=3.8` from `requirements.txt`. 2. Remove the npm dependency named `python`. 3. Declare interpreter compatibility using standard Python package metadata: ```toml [project] requires-python = ">=3.8" ``` 4. Retain an engine declaration only as compatibility metadata, not as an installable package dependency. 5. Pin actual third-party dependencies to reviewed versions. 6. Use lockfiles and integrity hashes, such as pip hash-checking mode, for reproducible releases. 7. Add CI checks that reject interpreter names in dependency lists and audit resolved dependency trees before publication. ]]>
