T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:18
- Finding
- Unpinned Third-Party Dependencies Create a Supply-Chain Execution Risk## Vulnerability Details **File Location**: `SKILL.md:18-21`; `scripts/kalshi_portfolio.py:23-26` **Vulnerability Type**: Unpinned and unverifiable third-party dependencies **Risk Level**: Medium **Affected code in `SKILL.md:18-21`:** ```bash Install dependencies: ```bash pip install requests cryptography ``` ``` **Affected code in `scripts/kalshi_portfolio.py:23-26`:** ```python if not HAS_SDK: print("Error: kalshi-python not installed. Run: pip install kalshi-python") sys.exit(1) ``` ### Technical Analysis The project directs users to install `requests`, `cryptography`, and `kalshi-python` from the default Python package index without pinning reviewed versions, verifying cryptographic hashes, or supplying a lockfile. The documented setup also omits `kalshi-python`, while the portfolio script recommends installing it dynamically when an import fails. Python package installation may execute package build hooks and installs code that will later run with the privileges of the invoking user. Because package names alone resolve to mutable versions and transitive dependency graphs, the reviewed project does not guarantee that users will install the same dependency code that was evaluated during this audit. No evidence shows that the currently named packages are malicious. The vulnerability is the absence of dependency integrity and reproducibility controls, which exposes installation to a compromised package release, maintainer account, package index, or transitive dependency. ### Attack Path 1. An attacker compromises a named dependency, one of its transitive dependencies, its publisher account, or the package-index delivery path. 2. The attacker publishes a malicious version under a package name recommended by the project. 3. A user follows `pip install requests cryptography` or the runtime recommendation to execute `pip install kalshi-python`. 4. Pip resolves the unpinned dependency to the attacker- ...[truncated 890 chars]
- Remediation
- ## Remediation Suggestions 1. Add all direct dependencies, including `kalshi-python`, to a version-controlled dependency manifest. 2. Pin each dependency to an explicitly reviewed version rather than allowing installation of the latest available release. 3. Generate and verify cryptographic hashes for direct and transitive packages, such as through a locked requirements file used with `pip install --require-hashes`. 4. Regenerate the lockfile through a controlled review process and test dependency updates before release. 5. Recommend installation inside a dedicated virtual environment with no elevated privileges. 6. Replace the runtime message with installation instructions referencing the locked project dependency file, for example: ```python print("Error: dependencies are missing. Install the reviewed lockfile in an isolated virtual environment.") ``` 7. Use dependency scanning and provenance checks in CI to detect known vulnerabilities, unexpected ownership changes, and tampered release artifacts.
