T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:39
- Finding
- Unpinned Global Installation of an Executable npm Dependency## Vulnerability Details **File Location**: `SKILL.md`, line 39 **Vulnerability Type**: Unpinned third-party executable dependency **Risk Level**: Medium **Complete Code Snippet**: ```bash npm install -g @okx_ai/okx-trade-cli okx market ticker BTC-USDT # verify ``` The installation instruction conflicts with the version-pinned package declaration elsewhere in the same file: ```yaml install: - id: npm kind: node package: "@okx_ai/okx-trade-cli@1.4.6" bins: ["okx"] label: "Install okx CLI (npm)" ``` ### Technical Analysis The documented installation command does not specify a package version. Consequently, npm resolves whichever release is tagged as current at installation time rather than the declared and potentially reviewed version `1.4.6`. Installing an npm package can execute package lifecycle scripts, while subsequent use executes the package-provided `okx` binary. Because the package implementation is not included in the audited project, its actual behavior—including network destinations, local-data access, credential handling, and adherence to the claimed read-only model—cannot be verified from this artifact. The global `-g` installation increases exposure by placing the executable in a system- or user-wide command path. This is broader than necessary for invoking a project-scoped market-data utility and creates a supply-chain trust boundary outside the reviewed Skill. ### Attack Path 1. An attacker compromises the npm package publisher account, release pipeline, package namespace, or a newly published package version. 2. The attacker publishes a malicious version under `@okx_ai/okx-trade-cli` or changes the package version referenced by the mutable distribution tag. 3. A user follows the instruction in `SKILL.md` and runs: ```bash npm install -g @okx_ai/okx-trade-cli ``` 4. npm retrieves the attacker-controlled current release rather than the declared version ...[truncated 1270 chars]
- Remediation
- ## Remediation Suggestions 1. Pin the installation command to the exact version declared in the Skill metadata: ```bash npm install -g @okx_ai/okx-trade-cli@1.4.6 ``` 2. Prefer a project-local installation over a global installation: ```bash npm install --save-exact @okx_ai/okx-trade-cli@1.4.6 ``` Invoke the local binary through a controlled package script or an explicitly pinned execution mechanism. 3. Commit and enforce an npm lockfile with integrity hashes where the hosting format permits it. Use reproducible installation commands such as `npm ci`. 4. Audit the dependency source, transitive dependency graph, published package contents, and npm lifecycle scripts before approving execution. 5. Disable lifecycle scripts during installation when they are not required: ```bash npm install --save-exact --ignore-scripts @okx_ai/okx-trade-cli@1.4.6 ``` This should only be used after confirming that the package does not legitimately require installation scripts. 6. Keep the metadata package version and every human-readable installation example synchronized. Add automated validation to reject unpinned installation commands. 7. Execute the CLI under a least-privileged account or sandbox with access limited to required public market-data endpoints and without unnecessary access to credentials or sensitive local files.
