T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:52
- Finding
- Unpinned External Repository and npm Dependencies Are Executed Locally## Vulnerability Details **File Location**: `SKILL.md`, lines 52-73 **Vulnerability Type**: `T08: Insecure Dependencies` **Risk Level**: Medium ### Vulnerable Code ```bash # Prerequisites npm install -g remotion npm install # Clone and setup git clone https://github.com/Vincentwei1021/anything2explainer.git cd anything2explainer npm install ``` ```bash # Generate video from topic npx remotion render src/index.ts AnyTopic --props '{"topic":"Quantum Computing"}' # With Chinese content npx remotion render src/index.ts AnyTopic --props '{"topic":"量子计算简介"}' # Batch generation node scripts/batch-generate.js topics.json ``` ### Technical Analysis The installation instructions clone the mutable default branch of an external repository and install npm dependencies without pinning the repository to a reviewed commit. The artifact does not include the referenced repository, package manifest, lockfile, or executable scripts, so the effective code executed by these commands cannot be verified from the audited package. `npm install` can execute package lifecycle hooks such as `preinstall`, `install`, and `postinstall`. The global installation of `remotion` is also unpinned, while `npx remotion` may retrieve and execute a package if a suitable local executable is unavailable. Consequently, a compromised upstream repository, npm account, transitive dependency, or newly published package version could introduce arbitrary code after this Skill has been reviewed. The first unqualified `npm install` is issued before the user enters the cloned repository. If run in an unrelated directory containing a `package.json`, it could unexpectedly install that project's dependencies and execute its lifecycle scripts. ### Attack Path 1. An attacker compromises the referenced GitHub repository, an npm package, a maintainer account, or a transitive dependency. 2. The attacker adds malicious code to repository scripts or an npm l ...[truncated 1095 chars]
- Remediation
- ## Remediation Suggestions 1. Pin the external repository to a reviewed full commit hash rather than cloning and executing its mutable default branch. 2. Supply a committed lockfile and use `npm ci` instead of `npm install` to enforce reproducible dependency resolution. 3. Pin direct dependencies to reviewed versions and verify package integrity through the lockfile and trusted registry configuration. 4. Remove the initial `npm install` that appears before `cd anything2explainer`, as it may operate on an unrelated working directory. 5. Avoid global package installation. Install Remotion as a pinned project dependency and invoke the local binary using `npx --no-install remotion`. 6. Review all npm lifecycle scripts and repository scripts before execution. Where compatible, initially install with `npm ci --ignore-scripts`, audit the required scripts, and enable only those needed. 7. Run rendering and batch-generation commands in an isolated container or restricted user account with no production secrets and minimal filesystem permissions. 8. Document the exact reviewed repository commit, Node.js version, dependency versions, and integrity-verification procedure in `SKILL.md`.
