T08 · Insecure Dependencies
- Location
SKILL.md:16- Finding
Unpinned Third-Party Dependencies Create a Supply-Chain Risk
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 16–19
Vulnerability Type: Unpinned and unhashed third-party dependencies
Risk Level: MediumVulnerable Code:
markdown Install Python dependencies before first use: ```bash pip install yfinance requests pandastext ### Technical Analysis The installation instructions retrieve mutable package versions without version constraints, a lockfile, or cryptographic hash verification. Consequently, the installed code can change over time without any corresponding change to the reviewed project. If a dependency release or its distribution account is compromised, following the documented command could install attacker-controlled code. Python packages can execute code during installation or later when imported by `scripts/earnings_tracker.py`. The direct `requests` dependency also appears unnecessary because it is imported but never used, expanding the dependency attack surface without providing functionality. This finding does not establish that the named packages are currently malicious. The vulnerability is the absence of reproducible, integrity-verified dependency resolution. ### Attack Path 1. An attacker compromises a dependency maintainer account, package release process, or relevant distribution channel. 2. The attacker publishes a malicious release under one of the dependency names. 3. A user follows the documented `pip install yfinance requests pandas` command. 4. Pip resolves the mutable package name to the attacker-controlled release because no reviewed version or hash is required. 5. Malicious code executes during package installation or when the installed package is imported by the tracker. 6. The code operates with the permissions and environmental access of the user running pip or the tracker. ### Impact Assessment Successful exploitation could execute arbitrary Python or native code with the privileges of the installing or execu ...[truncated 386 chars]- Remediation
View remediation
Remediation Suggestions
- Pin every direct dependency to a reviewed, exact version rather than installing unconstrained package names.
- Maintain dependencies in a lockfile generated through a reproducible workflow.
- Require cryptographic hashes during installation, such as with a hash-locked requirements file and
pip install --require-hashes. - Explicitly use the trusted official package index in deployment instructions and prevent unexpected fallback indexes.
- Remove
requestsas a direct dependency and import if it remains unused. - Review transitive dependencies, monitor security advisories, and update pins through a controlled testing and approval process.
- Install dependencies in an isolated virtual environment under a non-privileged account.
