T08 · Insecure Dependencies
Warning
- Location
- generate_subtitles.py:14
- Finding
- Unpinned dependencies and unsafe privileged installation guidance<![CDATA[ ## Vulnerability Details **File Location**: `generate_subtitles.py:14-17`; related declarations in `SKILL.md:26` and `_meta.json:11-14` **Vulnerability Type**: Unpinned third-party dependencies and privileged system-wide package installation **Risk Level**: Medium ### Complete Code Snippets `generate_subtitles.py:14-17`: ```python except ImportError: print("Error: faster-whisper not installed.") print("Install with: sudo pip3 install faster-whisper --break-system-packages") sys.exit(1) ``` `SKILL.md:26`: ```bash pip install faster-whisper srt ``` `_meta.json:11-14`: ```json "requirements": { "pip": ["requests", "srt", "faster-whisper", "edge-tts"], "system": ["ffmpeg"] } ``` ### Technical Analysis The project specifies third-party Python packages without locking their versions or verifying package hashes. Consequently, the effective dependency code can change between installations without any corresponding change to the audited Skill. The error message in `generate_subtitles.py` recommends running `pip3` through `sudo` and using `--break-system-packages`. Python packages can execute arbitrary installation and build code. Following this recommendation therefore extends root privileges to all code involved in package resolution, download, build, and installation. The `--break-system-packages` option also bypasses protections intended to prevent unmanaged modifications to the operating system's Python environment. No evidence establishes that the currently named packages are malicious. The vulnerability is the unsafe and excessive installation method and the absence of reproducible dependency constraints. ### Attack Path 1. An attacker compromises a future release, build dependency, maintainer account, or package distribution path associated with one of the unpinned dependencies. 2. A user encounters the missing-dependency message and follows the displayed `sudo pip3 install ... --break-system-packages` instruction. 3. `pip` r ...[truncated 1072 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove `sudo` and `--break-system-packages` from all installation guidance. 2. Require installation inside an isolated virtual environment, for example: ```bash python3 -m venv .venv . .venv/bin/activate python -m pip install --require-hashes -r requirements.txt ``` 3. Pin every direct and transitive dependency to a reviewed version in a lock file. 4. Record cryptographic hashes and install with `--require-hashes`. 5. Use only canonical, authenticated package repositories and explicitly configure the expected index. 6. Regularly scan locked dependencies for known vulnerabilities and review updates before changing the lock file. 7. Treat system dependencies such as `ffmpeg` similarly by documenting trusted installation sources and supported versions. 8. Replace the runtime installation prompt with a non-privileged message referring users to the locked environment setup documentation. ]]>
