T08 · Insecure Dependencies
- Location
requirements.txt:5- Finding
Unpinned Dependencies and Mutable Container Images Create Supply-Chain Risk
- Content
View full analysis
=2.0.0 numpy>=1.24.0 requests>=2.31.0 python-dateutil>=2.8.2 python-dotenv>=1.0.0 # Environment variable loading ``` `SKILL.md:42-48`: ```bash ## Installation ```bash pip install -r requirements.txt export TWELVE_DATA_API_KEY=your_key export ALPHA_VANTAGE_API_KEY=your_key python3 trading_signals.py ``` ``` `README.md:109-112`: ```text | **Docker** ⭐ | `docker run -it ghcr.io/xuxuclassmate/trading-assistant:latest` | 5 min | | **pip** | `pip install trading-assistant` | 10 min | | **npm** | `npm install -g @xuxuclassmate/trading-assistant` | 10 min | | **Source** | `git clone + pip install -e .` | 15 min | ``` `README.md:137-149`: ```bash # Download example config curl -O https://raw.githubusercontent.com/XuXuClassMate/trading-assistant/main/.env.example cp .env.example .env # Edit .env with your API keys nano .env # or use your favorite editor # Run the container docker run --rm -it \ -v $(pwd)/.env:/app/.env \ -v $(pwd)/watchlist.txt:/app/watchlist.txt \ ghcr.io/xuxuclassmate/trading-assistant:latest \ --help ``` ### Technical Analysis The Python dependencies use open-ended lower-bound constraints and do not provide an immutable lock file or package hashes. A future installation can therefore resolve to dependency versions that were not present during this audit. The documentation also recommends mutable `latest` container tags. A registry owner—or an attacker who compromises the registry account—can replace the image referenced by that tag after the project has been reviewed. The recommended container command mounts a local `.env` file into the container. Consequently, the unaudited image receives ...[truncated 1898 chars]- Remediation
View remediation
``` 6. Publish signed images, provenance attestations, and a software bill of materials. Document how users can verify signatures before execution. 7. Avoid mounting a credential-bearing `.env` file into an image addressed by a mutable tag. Prefer narrowly scoped runtime secrets and read-only mounts where supported. 8. Use least-privilege, revocable API keys with provider-side usage limits. 9. Audit and version-pin the separately distributed npm package before recommending global installation. 10. Keep versioned installation examples synchronized across `SKILL.md`, `README.md`, and release documentation. ]]>
