T08 · Insecure Dependencies
- Location
scripts/market_analysis.py:3- Finding
Unpinned Dependencies Are Automatically Resolved and Installed at Runtime
- Content
View full analysis
- Remediation
View remediation
", # "pandas==", # "rich==", # "feedparser==", # "numpy==" # ] ``` 2. **Generate and commit a lockfile** that records the complete transitive dependency graph. 3. **Require package integrity verification** using cryptographic hashes where the selected installation workflow supports it. 4. **Remove unused dependencies and imports**: - Remove `requests` from `scripts/market_analysis.py` unless direct HTTP requests are added. - Remove `beautifulsoup4` from the main script's dependency declaration unless HTML parsing is required. - Remove unused `requests` and `BeautifulSoup` imports from `scripts/news_fetcher.py` if RSS parsing remains its only retrieval mechanism. 5. **Use a dedicated virtual environment or sandbox** with no administrative privileges and minimal access to credentials and sensitive files. 6. **Restrict package sources** to an explicitly configured trusted package index. Do not permit fallback to arbitrary or unreviewed indexes. 7. **Add automated dependency controls**, including vulnerability scanning, update review, provenance verification, and periodic lockfile regeneration. 8. **Review dependency updates before deployment** rather than automatically consuming the latest available release during each invocation. ]]>
