T08 · Insecure Dependencies
Warning
- Location
- scripts/install_deps.py:7
- Finding
- Unpinned Third-Party Dependencies Permit Mutable Installation-Time Code## Vulnerability Details **File Location**: `scripts/install_deps.py:7-16`; additional dependency declarations appear in `stock-analysis/pyproject.toml:7-50` and the optional global npm installation instruction appears in `stock-analysis/SKILL.md:151` **Vulnerability Type**: Unpinned executable dependencies and insufficient supply-chain integrity controls **Risk Level**: Medium ### Complete Code Snippet ```python def main(): skill_dir = Path(__file__).parent venv_dir = skill_dir / '.venv' # uv venv subprocess.run([sys.executable, '-m', 'uv', 'venv', str(venv_dir)], check=True) # Activate & pip pip = venv_dir / 'bin' / 'pip' subprocess.run([pip, 'install', 'yfinance', 'pandas', 'numpy', 'requests', 'jsonschema'], check=True) ``` The project also declares numerous dependencies without version constraints: ```toml dependencies = [ "yfinance", "pandas", "numpy", "ta", "rich", "tabulate", "pytz", "requests", "lxml", "beautifulsoup4", "feedparser", "tenacity", "humanize", "tqdm", "edgartools", "fear-and-greed", "httpx", "python-dateutil", "jinja2", "markdown-it-py", "rank-bm25", "rapidfuzz", "textdistance", "unidecode", "curl-cffi", "frozendict", "filelock", "platformdirs", "pycparser", "soupsieve", "sgmllib3k", "nest-asyncio", "multitasking", "pyarrow", "orjson", "peewee", "pydantic", "typing-extensions", "idna", "charset-normalizer", "urllib3", "certifi", "cffi", "h11", "httpcore", "pydantic-core", "attrs", "cattrs", "stamina", "markupsafe", "mdurl", "pygments", "pyrate-limiter", ] ``` ### Technical Analysis The installer resolves package names to whatever versi ...[truncated 1881 chars]
- Remediation
- ## Remediation Suggestions 1. Pin every direct dependency to a reviewed version and constrain transitive resolution through a committed lockfile. 2. Generate and verify package hashes, such as with a hash-locked requirements file and `--require-hashes`. 3. Use a trusted, explicitly configured package index and disable unintended extra indexes to reduce dependency-confusion exposure. 4. Audit and remove dependencies that are not directly required. 5. Run installation inside a dedicated, non-privileged virtual environment. 6. Pin the documented `bird` npm package to a reviewed exact version and avoid global installation. 7. Add automated dependency vulnerability, provenance, and lockfile-drift checks to the release process.
