T08 · Insecure Dependencies
- Location
scripts/init-project.sh:29- Finding
Unpinned npm CLI Package Allows Mutable Supply-Chain Code Execution
- Content
View full analysis
&2 npx create-eth@latest --project "$PROJECT_NAME" --skip-install ``` `SKILL.md:23-25`: ```bash npx create-eth@latest # Select: foundry (recommended), target chain, project name ``` `AGENTS.md:18-20`: ```bash npx create-eth@latest # Select: foundry (recommended), target chain, project name ``` ### Technical Analysis The initialization script directly executes `create-eth@latest` through `npx`. The `latest` distribution tag is mutable and is resolved from the npm registry at execution time. Consequently, the code executed by this reviewed skill is not fixed to the code that existed when the skill was audited. No exact package version, lockfile, package digest, or integrity verification is applied before execution. If the upstream package, maintainer account, publishing credentials, npm registry response, or a newly published transitive dependency is compromised, invoking the script can execute attacker-controlled JavaScript. The same unsafe command is presented as the default project-creation workflow in both agent instruction files. An agent following those instructions can therefore introduce the same risk even without directly invoking `scripts/init-project.sh`. This is an insecure dependency and supply-chain boundary rather than evidence that the current `create-eth` package is malicious. ### Attack Path 1. An attacker compromises the upstream npm package, a maintainer publishing account, or a dependency included by a future release. 2. The attacker publishes a malicious release and assigns or causes it to receive the mutable `latest` tag. 3. A use ...[truncated 1212 chars]- Remediation
View remediation
\ --project "$PROJECT_NAME" \ --skip-install ``` 2. Record the selected version centrally so the script and agent instructions cannot drift. Do not use version ranges, `latest`, `next`, or other mutable distribution tags. 3. Prefer installing dependencies through a committed lockfile with integrity hashes, then invoke the locally installed binary: ```bash npm ci npx --no-install create-eth --project "$PROJECT_NAME" --skip-install ``` 4. For stronger assurance, vendor the reviewed generator or obtain its package tarball from a trusted release process and verify a pinned cryptographic checksum before execution. 5. Review the exact package release and its transitive dependency tree before updating the pin. Treat updates as security-sensitive changes requiring review. 6. Run project generation in a sandbox or disposable container with: - No wallet private keys or seed phrases - No npm publishing token - No SSH agent forwarding - Minimal filesystem access - Restricted network access where practical - A non-privileged user 7. Update `SKILL.md` and `AGENTS.md` to use the same pinned and verified workflow so AI agents do not bypass the hardened script. ]]>
