T08 · Insecure Dependencies
- Location
SKILL.md:52- Finding
Unpinned External Repository and npm Dependencies Are Executed Locally
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 52-73
Vulnerability Type:T08: Insecure Dependencies
Risk Level: MediumVulnerable Code
bash # Prerequisites npm install -g remotion npm install # Clone and setup git clone https://github.com/Vincentwei1021/anything2explainer.git cd anything2explainer npm installbash # 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.jsonTechnical 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 installcan execute package lifecycle hooks such aspreinstall,install, andpostinstall. The global installation ofremotionis also unpinned, whilenpx remotionmay 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 installis issued before the user enters the cloned repository. If run in an unrelated directory containing apackage.json, it could unexpectedly install that project's dependencies and execute its lifecycle scripts.Attack Path
- An attacker compromises the referenced GitHub repository, an npm package, a maintainer account, or a transitive dependency.
- The attacker adds malicious code to repository scripts or an npm l ...[truncated 1095 chars]
- Remediation
View remediation
Remediation Suggestions
- Pin the external repository to a reviewed full commit hash rather than cloning and executing its mutable default branch.
- Supply a committed lockfile and use
npm ciinstead ofnpm installto enforce reproducible dependency resolution. - Pin direct dependencies to reviewed versions and verify package integrity through the lockfile and trusted registry configuration.
- Remove the initial
npm installthat appears beforecd anything2explainer, as it may operate on an unrelated working directory. - Avoid global package installation. Install Remotion as a pinned project dependency and invoke the local binary using
npx --no-install remotion. - 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. - Run rendering and batch-generation commands in an isolated container or restricted user account with no production secrets and minimal filesystem permissions.
- Document the exact reviewed repository commit, Node.js version, dependency versions, and integrity-verification procedure in
SKILL.md.
