T08 · Insecure Dependencies
Error
- Location
- assets/test-corpus/run.sh:128
- Finding
- Mutable npm Dependencies Are Installed and Executed Without a Lockfile<![CDATA[ ## Vulnerability Details **File Locations**: - `assets/test-corpus/run.sh:128-135` - `assets/test-corpus/tier-1-title-card/remotion-src/package.json:5-12` - `assets/test-corpus/tier-2-multi-scene/remotion-src/package.json:5-12` - `assets/test-corpus/tier-3-data-driven/remotion-src/package.json:5-14` - `SKILL.md:78-82` **Vulnerability Type**: Unsafe dependency resolution and package execution **Risk Level**: High ### Vulnerable Code The corpus runner installs dependencies from mutable version ranges and subsequently executes the installed Remotion CLI: ```bash if [[ ! -d "$fixture_dir/remotion-src/node_modules" ]]; then echo " ⏳ npm install (first run)" (cd "$fixture_dir/remotion-src" && npm install --silent --no-progress >/dev/null 2>&1) fi echo " ⏳ render Remotion baseline" if ! (cd "$fixture_dir/remotion-src" && \ npx --no-install remotion render "$composition_id" out/baseline.mp4 >/dev/null 2>&1); then ``` The Tier 3 manifest, representative of the mutable dependency declarations, contains: ```json { "name": "tier-3-data-driven-remotion", "version": "0.0.0", "private": true, "scripts": { "render": "remotion render Stargazed out/baseline.mp4" }, "dependencies": { "@remotion/cli": "^4.0.0", "react": "^18.3.1", "react-dom": "^18.3.1", "remotion": "^4.0.0", "zod": "^3.22.0" } } ``` The documented quick path also invokes HyperFrames through `npx` without `--no-install` or an exact package version: ```bash # Render Remotion baseline (after npm install in the fixture) cd remotion-src && npx remotion render <CompositionId> out/baseline.mp4 # Render HF translation cd ../hf-src && npx hyperframes render --output ../hf.mp4 ``` ### Technical Analysis The project does not include lockfiles for the fixture projects, while all dependencies use caret ranges. Running `npm install` can therefore resolve different direct and transitive package versions over time. Standard npm installation also permits dep ...[truncated 1916 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Commit a reviewed `package-lock.json` for each fixture and replace `npm install` with `npm ci`. 2. Pin direct dependencies to exact versions instead of caret ranges. 3. Preserve and verify npm integrity metadata in committed lockfiles. 4. Use `npm ci --ignore-scripts` when dependency lifecycle scripts are not required. 5. If lifecycle scripts are required, explicitly review the scripts and run installation inside a restricted container or sandbox without credentials. 6. Replace `npx hyperframes ...` with a locally installed and lockfile-pinned CLI invocation. 7. Add `--no-install` to all `npx` commands so missing packages cause a failure rather than an implicit download. 8. Run rendering with a minimal environment, read-only source mounts where practical, restricted outbound network access, and no unrelated CI secrets. 9. Add dependency review and vulnerability scanning to changes affecting manifests and lockfiles. ]]>
