T08 · Insecure Dependencies
- Location
scripts/requirements.txt:1- Finding
Unpinned and Unverified Third-Party Dependencies Are Installed and Executed
- Content
View full analysis
=1.12.0 pandas>=1.5.0 numpy>=1.24.0 mplfinance>=0.12.10 matplotlib>=3.7.0 ``` `SKILL.md:160`: ```bash pip install akshare pandas numpy mplfinance matplotlib ``` `mcp_server/PLATFORM_CONFIGS.md:52`: ```bash pip install akshare pandas numpy mplfinance matplotlib mcp ``` `mcp_server/PLATFORM_CONFIGS.md:233`: ```bash npx @anthropic-ai/mcp dev E:/独孤九剑/.claude/skills/股票九剑/mcp_server/server.py ``` `mcp_server/PLATFORM_CONFIGS.md:241-242`: ```text | Startup error `ModuleNotFoundError: mcp` | `pip install mcp` | | Startup error `ModuleNotFoundError: akshare` | `pip install akshare pandas numpy mplfinance matplotlib` | ``` ### Technical Analysis The project directs users to retrieve dependencies from public Python and npm registries and immediately install or execute them. The Python requirements specify only minimum versions using `>=`, with no upper bounds, exact version pins, integrity hashes, lockfile, or documented package provenance. Consequently, a future installation may resolve to dependency versions that were never reviewed with this project. The documented `npx @anthropic-ai/mcp dev` command is particularly sensitive because `npx` may download and immediately execute a registry-hosted package when a suitable local version is unavailable. The command does not pin an exact package version or validate package integrity before execution. No evidence was found that any currently named dependency is malicious. The vulnerability is the absence of controls that ensure users execute the same reviewed dependency artifacts over time. This creates exposure to compromised maintainer a ...[truncated 1849 chars]- Remediation
View remediation
pandas== numpy== mplfinance== matplotlib== mcp== ``` 2. Generate a hash-locked dependency file and require integrity verification: ```bash python -m pip install --require-hashes -r requirements.lock ``` 3. Use a dependency-locking workflow such as `pip-tools`, Poetry, or an equivalent tool that records all transitive dependency versions and hashes. 4. Pin the npm package to an explicitly reviewed version rather than allowing dynamic resolution: ```bash npx --yes @anthropic-ai/mcp@ dev ``` 5. Verify the correct npm package identity and publisher before documenting the command. Where possible, install it from an organization-controlled lockfile rather than downloading it during testing. 6. Instruct users to create a dedicated virtual environment: ```bash python -m venv .venv .venv/bin/python -m pip install --require-hashes -r requirements.lock ``` On Windows, use `.venv\Scripts\python.exe`. 7. Recommend non-administrative installation and execution. Explicitly warn users not to run `pip` or `npx` from an elevated shell. 8. Add automated dependency scanning, provenance verification, and periodic review of both direct and transitive dependencies before updating the lockfile. ]]>
