T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:30
- Finding
- Unpinned Global Installation of a Third-Party npm Package<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 30-39 **Vulnerability Type**: Unpinned third-party dependency installed globally **Risk Level**: Medium ### Vulnerable Code Snippet ```yaml requires: bins: - ogp state_paths: - ~/.ogp-meta/config.json - ~/.ogp/config.json - ~/.ogp/projects.json - ~/.ogp/peers.json - ~/.ogp-hermes/config.json - ~/.ogp-hermes/projects.json - ~/.ogp-hermes/peers.json install: npm install -g @dp-pcs/ogp docs: https://github.com/dp-pcs/ogp --- ## Prerequisites The OGP daemon must be installed and configured. If you see errors like 'ogp: command not found', install it first: ```bash npm install -g @dp-pcs/ogp ``` ``` ### Technical Analysis The installation instructions retrieve the currently resolved version of `@dp-pcs/ogp` from the configured npm registry and install it globally. No exact version, package integrity value, provenance requirement, or lifecycle-script restriction is specified. An npm package can execute lifecycle scripts during installation. A global installation also places the package's executable in a shared command location, making it available to later sessions under the identity and permissions of the user performing the installation. Consequently, the code that executes may differ from the version reviewed when this Skill was published. This does not prove that the named package is malicious. The vulnerability is the absence of controls that bind installation to a reviewed artifact, leaving the Skill exposed to registry-account compromise, a malicious future release, registry substitution, or other supply-chain failures. ### Attack Path 1. An attacker compromises the package publisher, npm account, release process, or package distribution path. 2. The attacker publishes a malicious version under the existing `@dp-pcs/ogp` package name. 3. A user follows the Skill instructions and runs `npm install -g @dp-pcs/ogp`. 4. npm resolves the unpinne ...[truncated 870 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin the dependency to an exact reviewed version, for example: ```bash npm install -g @dp-pcs/ogp@<audited-exact-version> ``` 2. Publish and verify the expected package integrity hash and package provenance before installation. 3. Document the npm registry that must be used and reject unexpected registry overrides. 4. Review package lifecycle scripts and, where operationally compatible, install with scripts disabled: ```bash npm install -g --ignore-scripts @dp-pcs/ogp@<audited-exact-version> ``` 5. Prefer a project-local or isolated installation over a global installation so that the executable cannot silently affect unrelated workflows. 6. Establish a controlled upgrade process in which each new version is reviewed before the pinned version is changed. 7. Recommend installation under an unprivileged account and explicitly warn users not to run the command with `sudo` or equivalent elevated privileges. ]]>
