T08 · Insecure Dependencies
Warning
- Location
- src/main.py:3
- Finding
- Unpinned Dependency Is Automatically Resolved and Executed## Vulnerability Details **File Location**: `src/main.py`, lines 3-7 **Vulnerability Type**: Unpinned third-party dependency and unsafe dynamic resolution **Risk Level**: Medium ### Vulnerable Code ```python # /// script # requires-python = ">=3.12" # dependencies = [ # "yfinance", # ] # /// ``` The documented execution workflow in `SKILL.md` instructs the Agent to run this script through `uv run`, which automatically resolves and installs `yfinance`. ### Technical Analysis The dependency declaration specifies only the package name and does not constrain it to an audited version. The project also contains no reviewed lockfile or package hash. Consequently, the effective code executed by the Skill can change between invocations even when the Skill's own source files remain unchanged. Importing `yfinance` executes Python code from the resolved package and its transitive dependencies with the same operating-system privileges as the Skill process. A compromised package release, compromised package-distribution account, or malicious transitive dependency could therefore introduce arbitrary behavior after this project has been reviewed. This is a supply-chain weakness rather than evidence that the currently published `yfinance` package is malicious. ### Attack Path 1. An attacker compromises a dependency release channel, maintainer account, or transitive dependency used by `yfinance`. 2. The attacker publishes a version containing malicious initialization or import-time code. 3. A user or Agent invokes the documented `uv run src/main.py <TICKER>` command. 4. Because no exact version or reviewed lockfile is enforced, `uv` may resolve and install the compromised release. 5. `src/main.py` imports `service.py`, which imports `yfinance`. 6. The malicious package code executes with the privileges and accessible environment of the Skill process. ### Impact Assessment Successful exploitation could provide ...[truncated 377 chars]
- Remediation
- ## Remediation Suggestions - Pin `yfinance` and every transitive dependency to reviewed, exact versions. - Commit and enforce a generated lockfile rather than resolving unconstrained versions during normal Skill execution. - Use package hashes or another integrity-verification mechanism where supported. - Download dependencies only from an explicitly trusted package index over authenticated TLS. - Build and scan the dependency environment in a controlled release process instead of automatically installing new versions at invocation time. - Run the Skill in a sandbox with minimal filesystem access, no unnecessary credentials in its environment, and network access restricted to the market-data endpoints required for its declared functionality. - Establish a reviewed dependency-update process with vulnerability and provenance checks.
