T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:49
- Finding
- Unpinned Global Installation of a Third-Party npm Package<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:49` **Vulnerability Type**: Unpinned third-party dependency with global installation scope **Risk Level**: Medium ### Vulnerable Code ```bash npm install -g gmgn-cli ``` ### Technical Analysis The Skill instructs the Agent to install the latest available version of `gmgn-cli` from npm without specifying an audited version or validating package integrity. Because npm package contents can change after the Skill has been reviewed, the code ultimately executed is not fixed by this repository. npm packages can run lifecycle scripts during installation. The `-g` option also installs the package globally for the current environment, giving the installation broader filesystem scope and making the resulting executable available to later sessions and unrelated tasks. This exceeds the minimum scope needed for an isolated token-information query. The audit found no evidence that the current `gmgn-cli` package is malicious. The vulnerability is the unsafe and mutable dependency acquisition mechanism. ### Attack Path 1. An attacker compromises the npm publisher account, package repository, or release pipeline for `gmgn-cli`. 2. The attacker publishes a malicious version under the same package name. 3. An Agent loading this Skill finds that the CLI is absent and follows the prerequisite instruction. 4. `npm install -g gmgn-cli` downloads the latest compromised release without version or integrity verification. 5. Malicious lifecycle code can execute during installation with the privileges of the Agent process. 6. The globally installed executable can subsequently run whenever the Skill invokes `gmgn-cli`, potentially extending the compromise beyond the installation step. ### Impact Assessment Successful exploitation could execute arbitrary code with the permissions of the user running the Agent. Depending on that user's accessible resources, attacker code could: - Read user-accessible files and credent ...[truncated 458 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin `gmgn-cli` to an exact version that has been reviewed, rather than installing the mutable latest release: ```bash npm install --save-exact gmgn-cli@<audited-version> ``` 2. Record and verify the package-lock integrity metadata or a separately published cryptographic checksum. 3. Prefer a project-local installation and invoke the pinned executable from that isolated environment instead of using `-g`. 4. Run the package in a sandbox or container with access limited to the required GMGN credential and network endpoint. 5. Disable npm lifecycle scripts where the package supports installation without them: ```bash npm install --ignore-scripts --save-exact gmgn-cli@<audited-version> ``` 6. Verify the package name, publisher, provenance attestations, and official distribution channel before installation. 7. Document a controlled update process requiring security review before changing the pinned version. ]]>
