T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:17
- Finding
- Unpinned Third-Party npm Package Installation and Execution<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 17–23 **Vulnerability Type**: Unpinned and unverified third-party dependency execution **Risk Level**: Medium ### Complete Code Snippet ```markdown Global (recommended for agents): ```bash npm i -g shersh ``` Or one-off with npx: ```bash npx shersh link ``` ``` ### Technical Analysis The Skill directs agents to install or execute the `shersh` npm package without specifying an exact version or verifying its integrity. Consequently, both commands can resolve to whichever package release the npm registry serves at execution time. The global installation command may execute npm lifecycle scripts and places package executables in the user's global npm environment. The `npx` command may download and immediately execute a package that is not already installed locally. The effective executable can therefore change after the Skill has been reviewed. This creates a supply-chain risk if the package publication account, package itself, registry resolution, or a future release is compromised. The audit did not establish that the current package is malicious; the vulnerability is the absence of version pinning, provenance validation, and integrity controls before third-party code execution. ### Attack Path 1. An attacker compromises the npm package, its maintainer account, or another part of the package publication process. 2. The attacker publishes a malicious release under the package name used by the Skill. 3. An agent follows `SKILL.md` and runs `npm i -g shersh` or `npx shersh link`. 4. npm resolves and downloads the attacker-controlled release because no exact reviewed version is specified. 5. Malicious code executes through an installation lifecycle script or the invoked CLI. 6. The payload acts with the permissions of the user running npm and can access resources available to that process. ### Impact Assessment Successful exploitation could provide arbitrary code execution with the p ...[truncated 778 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin the dependency to an exact reviewed version rather than relying on the latest registry release: ```bash npx --yes shersh@<reviewed-exact-version> link ``` 2. Avoid recommending global installation. Use a project-local development dependency with a committed lockfile: ```bash npm install --save-dev --save-exact shersh@<reviewed-exact-version> ``` 3. Commit and review `package-lock.json`, and use `npm ci` in controlled environments to enforce locked dependency resolution. 4. Verify package provenance, expected publisher identity, registry source, and integrity metadata before execution. 5. Review package lifecycle scripts and dependency changes when upgrading. Where operationally feasible, disable lifecycle scripts during installation and explicitly invoke only reviewed functionality. 6. Run the deployment tool in an isolated, least-privilege environment with restricted filesystem, credential, and network access. 7. Document the trusted package version and an upgrade-review process so future releases are not executed automatically without reassessment. ]]>
