T08 · Insecure Dependencies
- Location
src/main.py:3- Finding
Runtime Installation of an Unpinned Third-Party Dependency
- Content
View full analysis
=3.12" # dependencies = [ # "yfinance", # ] # /// ``` The documented execution procedure in `SKILL.md:269` states that `uv run` automatically installs this dependency: ```text uv run reads the inline `# /// script` dependency block in `main.py` and auto-installs `yfinance` in an isolated environment — no pip install or venv setup needed. ``` ### Technical Analysis The `yfinance` dependency has no exact version constraint or integrity hash. When the Skill is invoked through `uv run`, dependency resolution may retrieve and execute whichever package version currently satisfies the unconstrained requirement. This behavior makes execution non-reproducible and expands the trust boundary from the audited source code to future releases of the dependency and its transitive dependencies. Network access to a financial-data service is necessary for the declared functionality, but dynamically resolving an unpinned package is not the minimum privilege or trust exposure necessary to perform that function. An isolated Python environment limits package collisions but does not sandbox package code. Imported dependency code executes with the filesystem, environment, network, and process privileges of the user running the Skill. ### Attack Path 1. An attacker compromises the upstream `yfinance` distribution account, package repository, release process, or a transitive dependency. 2. A malicious release is published under a version accepted by the unconstrained dependency declaration. 3. A user invokes the documented `uv run .../src/main.py` command. 4. `uv` resolves and installs the malicious or compromised release. 5. Python imports `yfinance` from `service.py`, executing attacker-controlled package initialization code. 6. The maliciou ...[truncated 693 chars]- Remediation
View remediation
", # ] ``` 2. Generate and commit a lock file that records exact versions of all transitive dependencies. 3. Enforce package integrity using repository-supported hashes or a hash-locked requirements file. 4. Resolve and review dependency updates as an explicit maintenance operation rather than automatically accepting new releases at execution time. 5. Where possible, install dependencies during a controlled build stage and run the Skill with network and filesystem permissions limited to those required for retrieving public financial data. 6. Add automated software-composition analysis and vulnerability scanning for direct and transitive dependencies. ]]>
