T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:48
- Finding
- Unpinned and Inconsistent System-Wide Dependency Installation<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:48`; related runtime instruction at `scanner.py:149-155` **Vulnerability Type**: Unpinned third-party dependencies, package mismatch, and unsafe modification of the system Python environment **Risk Level**: Medium ### Complete Code Snippet ```markdown 2. **Install dependencies**: `pip install tradingview_ta pandas numpy requests openpyxl --break-system-packages` ``` The runtime code instead requires a different package: ```python try: from tvDatafeed import TvDatafeed, Interval except ImportError: print(" ⚠️ tvDatafeed is not installed. Try: pip install tvDatafeed --break-system-packages") return None ``` ### Technical Analysis The installation command does not pin package versions or verify package integrity with hashes. It also uses `--break-system-packages`, which bypasses protections intended to prevent `pip` from modifying an externally managed system Python installation. There is a dependency mismatch: the documentation tells the user to install `tradingview_ta`, while the implementation imports `tvDatafeed`. This can cause failed execution and may lead users to install additional packages based only on an error message. Package names are security-sensitive, and installing an unexpected or similarly named package creates exposure to dependency confusion, typosquatting, and compromised upstream releases. Python packages can execute code during installation and whenever imported. Therefore, a malicious package would execute with the privileges of the account running `pip` or the scanner. ### Attack Path 1. An attacker publishes, compromises, or otherwise gains control of one of the unpinned packages or a similarly named package. 2. A user follows the Skill instructions and runs the provided `pip install` command. 3. `pip` retrieves the current package release without enforcing an audited version or hash. 4. Installation hooks or subsequently imported package code execute ...[truncated 993 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove `--break-system-packages` from all installation instructions. 2. Create and use a dedicated virtual environment: ```bash python3 -m venv .venv . .venv/bin/activate python -m pip install --require-hashes -r requirements.txt ``` 3. Supply a lock file containing exact, audited versions and cryptographic hashes. 4. Reconcile the dependency mismatch by documenting and installing the exact package imported by the implementation. 5. Remove unused dependencies such as `tradingview_ta` or `requests` if they are not required. 6. Document the verified source and expected version of `tvDatafeed`. 7. Run the scanner as a non-privileged user and explicitly warn users not to install its dependencies with `sudo`. 8. Add automated dependency scanning and periodically review pinned versions for known vulnerabilities. ]]>
