T08 · Insecure Dependencies
- Location
scripts/run_query.sh:13- Finding
Unpinned Automatic Runtime Dependency Installation
- Content
View full analysis
Vulnerability Details
File Location:
scripts/run_query.sh, line 13
Vulnerability Type: Supply-chain exposure through automatic installation of an unpinned dependency
Risk Level: MediumVulnerable Code
bash "$PYTHON_BIN" - <<'PY' >/dev/null 2>&1 || "$PYTHON_BIN" -m pip install -q -U tvscreener from tvscreener import Market, StockField, StockScreener PYThe same unsafe installation pattern also appears at
scripts/test_markets.sh:13. The unpinned installation command is documented atSKILL.md:13andSKILL.md:56:bash python3 -m pip install -U tvscreenerTechnical Analysis
The runtime wrapper automatically executes
pip install -U tvscreenerwhenever the dependency import check fails. No exact version, package hash, lockfile, trusted package index, or integrity verification is specified. The-Uoption requests the newest eligible release, so the installed code can change independently of this audited project.Package installation and subsequent import execute third-party code under the privileges of the user running the skill. Consequently, a compromised package release, package-index account, dependency, or configured package source could turn an otherwise routine market query into arbitrary local code execution. Suppressing installation output with
-qand redirecting the import check output also reduces visibility into this environment-changing behavior.This is a supply-chain weakness rather than evidence that the current
tvscreenerpackage is malicious.Attack Path
- An attacker compromises the
tvscreenerdistribution channel, a transitive dependency, or a package source configured in the victim's pip environment. - The attacker publishes a malicious release that satisfies the unconstrained package request.
- A user runs
scripts/run_query.shorscripts/test_markets.shin an environment where the import check fails. - The shell script automatically invokes
pip install -q -U tvscreener...[truncated 793 chars]
- An attacker compromises the
- Remediation
View remediation
Remediation Suggestions
- Remove automatic package installation from runtime and test scripts. Fail with a clear message when the dependency is unavailable.
- Pin
tvscreenerand all transitive dependencies to reviewed versions in a lockfile or fully pinned requirements file. - Require package hashes, for example by using
pip install --require-hashes -r requirements.txt. - Configure an explicit trusted package index or an internally controlled artifact repository rather than inheriting arbitrary pip source configuration.
- Install dependencies during a separate, explicit setup phase inside an isolated virtual environment.
- Avoid
-Uin operational scripts so dependency changes occur only through a reviewed update process. - Preserve installation and dependency-resolution output in setup logs so users can review environment changes.
- Apply the same changes to
scripts/test_markets.shand update the installation instructions inSKILL.md.
