T08 · Insecure Dependencies
- Location
scripts/install_deps.py:7- Finding
Unpinned Third-Party Dependencies Permit Mutable Installation-Time Code
- Content
View full analysis
Vulnerability Details
File Location:
scripts/install_deps.py:7-16; additional dependency declarations appear instock-analysis/pyproject.toml:7-50and the optional global npm installation instruction appears instock-analysis/SKILL.md:151
Vulnerability Type: Unpinned executable dependencies and insufficient supply-chain integrity controls
Risk Level: MediumComplete 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
View remediation
Remediation Suggestions
- Pin every direct dependency to a reviewed version and constrain transitive resolution through a committed lockfile.
- Generate and verify package hashes, such as with a hash-locked requirements file and
--require-hashes. - Use a trusted, explicitly configured package index and disable unintended extra indexes to reduce dependency-confusion exposure.
- Audit and remove dependencies that are not directly required.
- Run installation inside a dedicated, non-privileged virtual environment.
- Pin the documented
birdnpm package to a reviewed exact version and avoid global installation. - Add automated dependency vulnerability, provenance, and lockfile-drift checks to the release process.
