T08 · Insecure Dependencies
- Location
extract.py:52- Finding
Automatic Runtime Installation of an Unpinned Third-Party Dependency
- Content
View full analysis
=2026.1.1 ``` ### Technical Analysis When `yt-dlp` cannot be found locally, constructing a `YouTubeTranscriptExtractor` automatically invokes pip to download and install the package. The installation command does not specify an exact version, package hash, trusted package index, isolated environment, or user confirmation. This means the effective code executed by the skill is not fully represented by the audited project. Package resolution can select a future release, and installation behavior can be influenced by the active pip configuration and configured package indexes. A compromised permitted release, package repository, mirror, or dependency could therefore introduce attacker-controlled code after this project has been reviewed. Python package installation may execute build backend or installation-related code. In addition, the installed `yt-dlp` executable is subsequently launched by the application to retrieve video information and subtitles. Consequently, compromise can occur either during package installation or when the newly installed executable is invoked. ### Attack Path 1. The attacker compromises a package source, configured mirror, permitted future `yt-dlp` release, or transitive dependency involved in resolution. 2. A user runs the skill in an environment where `yt-dlp` is not already installed. 3. `YouTubeTranscriptExtractor.__init__()` calls `_find_yt_dlp()`. 4. `_find_yt_dlp()` executes `python -m pip install yt-dlp` ...[truncated 1156 chars]- Remediation
View remediation
=`, for example: ```text yt-dlp== ``` 3. Generate and verify cryptographic hashes for all distributable artifacts and transitive dependencies. Install with a locked requirements file and: ```bash python -m pip install --require-hashes -r requirements.txt ``` 4. Use a dedicated virtual environment or container with least-privilege filesystem and network permissions. 5. Configure an explicitly trusted package index or internally controlled package mirror rather than inheriting arbitrary user or system pip configuration. 6. Separate dependency provisioning from normal skill execution so installation occurs during a controlled build or deployment stage. 7. Add automated dependency scanning and a controlled update process. Review and regenerate the lock file and hashes whenever the dependency version changes. 8. After locating `yt-dlp`, validate that the resolved executable belongs to the expected managed environment before invoking it. ]]>
