T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:29
- Finding
- Unpinned Third-Party Package Installed Globally<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 29–33; repeated at lines 199–203 **Vulnerability Type**: Unpinned and globally installed third-party dependency **Risk Level**: Medium ### Vulnerable Code ```bash npm install -g gpt-tokenizer ``` The same installation command is repeated in the troubleshooting section: ```bash npm install -g gpt-tokenizer ``` ### Technical Analysis The installation instructions retrieve the current version of `gpt-tokenizer` and its transitive dependencies without specifying an exact version, lockfile, or integrity hash. Consequently, the code executed by this instruction may change after the Skill has been reviewed. Installing through npm can also execute package lifecycle scripts, such as `preinstall`, `install`, and `postinstall`, with the permissions of the user running npm. The global installation mode increases exposure by adding the package to the user's global Node.js environment. No evidence establishes that the referenced package is currently malicious. The vulnerability is the mutable and insufficiently verified dependency acquisition process, which exposes users to package-account compromise, malicious future releases, or compromised transitive dependencies. ### Attack Path 1. An attacker compromises the `gpt-tokenizer` publishing account, one of its transitive dependencies, or the relevant package distribution channel. 2. The attacker publishes a malicious release or injects a malicious lifecycle script. 3. A user follows the Skill instructions and runs `npm install -g gpt-tokenizer`. 4. npm resolves the unpinned package reference to the attacker-controlled release. 5. Malicious package code or lifecycle scripts execute with the installing user's privileges. 6. The payload can access data available to that user, modify user-owned files, or alter the user's global Node.js environment. ### Impact Assessment Successful exploitation could provide arbitrary code execution under the accoun ...[truncated 340 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Pin `gpt-tokenizer` to an exact, reviewed version rather than installing the latest release. - Maintain a lockfile that records exact transitive dependency versions and package integrity metadata. - Prefer a project-local dependency over `npm install -g`, for example: ```bash npm install --save-exact gpt-tokenizer@<reviewed-version> ``` - Use `npm ci` with a committed lockfile for reproducible installation. - Where package functionality permits it, disable lifecycle scripts during installation: ```bash npm ci --ignore-scripts ``` - Verify the package publisher, source repository, integrity, and dependency tree before approving upgrades. - Run dependency vulnerability and provenance checks in CI, and review every dependency update before distribution. ]]>
