T08 · Insecure Dependencies
Error
- Location
- scripts/transcribe.cjs:181
- Finding
- WhisperX Is Dynamically Retrieved and Executed Through uvx<![CDATA[ ## Vulnerability Details **File Location**: `scripts/transcribe.cjs:181-205` **Vulnerability Type**: Runtime execution of externally retrieved dependency code **Risk Level**: High ### Vulnerable Code ```js const whisperxSpec = `whisperx==${process.env.WHISPERX_VERSION || "3.8.6"}`; const wxArgs = [ "--python", "3.12", "--from", whisperxSpec, "whisperx", wav, "--model", wxModel, "--device", "cpu", "--compute_type", "int8", "--output_dir", outDir, "--output_format", "json", "--no_align_deletes", "--print_progress", "False", ]; if (language) wxArgs.push("--language", language); // strip our flag if this whisperx build doesn't know it let r = cp.spawnSync("uvx", wxArgs, { encoding: "utf8", timeout: 600000 }); ``` ### Technical Analysis The default transcription path invokes `uvx` with a package specification for `whisperx`. If the package is not already cached, `uvx` can retrieve the package and its transitive Python dependencies and then execute them with the privileges of the user running the Skill. The top-level WhisperX version defaults to `3.8.6`, which provides some reproducibility, but no package hashes or locked transitive dependency set are enforced. The effective executed code may consequently change if a dependency release is replaced, compromised, or resolved differently by the package manager. The package specification is also influenced by the inherited `WHISPERX_VERSION` environment variable. This is not direct shell-command injection because `spawnSync` receives an argument array rather than a shell command, but an attacker capable of controlling the environment could select a different package version for execution. ### Attack Path 1. The user or Agent runs `bash scripts/prepare.sh <project>`. 2. `prepare.sh` launches `scripts/transcribe.cjs`. 3. Unless `TRANSCRIBE_ENGINE` disables WhisperX, the script constructs a package specification from `WHISPERX_VERSION` or the default version. 4. The scr ...[truncated 904 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Preinstall WhisperX from a reviewed, immutable dependency set rather than resolving it during each Skill run. 2. Maintain a lockfile that fixes every transitive dependency and verifies package hashes. 3. Use an explicitly trusted package index and prevent fallback to unapproved indexes. 4. Replace unrestricted `WHISPERX_VERSION` handling with an allowlist of reviewed versions. 5. Require explicit user confirmation before any first-time package retrieval. 6. Run transcription in a sandbox with: - Network access disabled after dependency provisioning. - Read access limited to the input media. - Write access limited to the project directory. - No access to SSH keys, cloud credentials, or unrelated home-directory files. 7. Record the exact package versions and hashes used in the generated project metadata. ]]>
