T08 · Insecure Dependencies
- Location
scripts/render_subtitles.py:73- Finding
Automatic Installation and Immediate Execution of an Unpinned Dependency
- Content
View full analysis
Vulnerability Details
File Location:
scripts/render_subtitles.py, lines 73–79
Vulnerability Type: Unpinned runtime dependency installation
Risk Level: MediumVulnerable Code
python try: import whisper except ImportError: print("Installing openai-whisper...") subprocess.run([sys.executable, "-m", "pip", "install", "openai-whisper"], check=True) import whisperTechnical Analysis
When the
whispermodule is unavailable, the subtitle transcription workflow automatically invokespipto installopenai-whisper. The dependency has no pinned version or integrity hash, and the code does not constrain the package index to an approved source. The resulting package is imported immediately in the same privileged process.This creates a supply-chain execution boundary: the effective code executed by the Skill can change after the Skill itself has been audited. Package selection may also be influenced by the active pip configuration, environment variables, proxy settings, or configured private indexes.
The argument-array invocation avoids shell injection, but it does not mitigate dependency substitution or repository compromise.
Attack Path
- An attacker compromises a selected
openai-whisperrelease, one of its transitive dependencies, or a package index configured in the execution environment. - A user runs the
transcribecommand on a system where thewhispermodule is not installed. - The
ImportErrorhandler launchespython -m pip install openai-whisper. - Pip resolves and installs attacker-controlled package code without version or hash verification.
- Package installation hooks may execute during installation.
- The script immediately imports
whisper, executing its module initialization code with the privileges of the user running the Skill.
Impact Assessment
Successful exploitation could execute arbitrary code with the invoking user’s privileges. Depending on that a ...[truncated 420 chars]
- An attacker compromises a selected
- Remediation
View remediation
Remediation Suggestions
- Remove automatic package installation from application runtime. If
whisperis unavailable, terminate with a clear dependency-installation message. - Declare
openai-whisperand all dependencies in a version-controlled dependency manifest and lockfile. - Pin exact versions and require cryptographic hashes, such as through a hash-locked requirements file and
pip install --require-hashes. - Restrict installation to an explicitly approved package index and review pip configuration in build environments.
- Install dependencies during a controlled build or setup phase rather than while processing user media.
- Scan and audit direct and transitive dependencies before deployment.
- Run transcription in a sandbox or container with least privilege, restricted filesystem access, and only necessary network access.
- Separate dependency installation from package import so newly installed code is not executed automatically without verification or explicit user approval.
A safer failure pattern is:
python try: import whisper except ImportError as exc: raise SystemExit( "Missing dependency: install the audited, pinned Whisper environment " "before running transcription." ) from exc- Remove automatic package installation from application runtime. If
