T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:39
- Finding
- Unpinned Remote Package Installation and Execution<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 37-40 and 138-143 **Vulnerability Type**: Unpinned third-party package retrieval and execution **Risk Level**: Medium ### Complete Code Snippet ```markdown 1. Install `okx` CLI: ```bash npm install -g @okx_ai/okx-trade-cli ``` ``` ```markdown What happens under the hood: 1. Downloads skill zip from OKX marketplace API 2. Extracts and validates the package (checks SKILL.md exists, reads metadata) 3. **Verifies Ed25519 signature and SHA-256 file integrity** — blocks installation if verification fails 4. Runs `npx skills add` to install to all locally detected agents 5. Records the installation (including verification status) in `~/.okx/skills/registry.json` ``` ### Technical Analysis The documented prerequisite installs `@okx_ai/okx-trade-cli` globally without specifying the exact version, even though the skill metadata references version `1.4.7`. The effective installed package is therefore determined by the package registry at installation time rather than by the reviewed skill. The subsequent installation process invokes `npx skills add`. Unless the required package is already installed and resolution is tightly controlled, `npx` can retrieve and execute package code dynamically. The instructions do not specify an exact package version, integrity digest, trusted registry configuration, lockfile, or lifecycle-script restriction. This creates a supply-chain boundary in which code that was not included in or reviewed with this project can execute under the invoking user's account. The issue does not prove that the named dependencies are currently malicious; the risk arises from mutable, unpinned dependency resolution. ### Attack Path 1. An attacker compromises the relevant registry account, package publication pipeline, package distribution infrastructure, or another dependency in the resolved dependency tree. 2. The attacker publishes a malicious version that is selected b ...[truncated 1025 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin the CLI to the reviewed version: ```bash npm install -g @okx_ai/okx-trade-cli@1.4.7 ``` 2. Replace runtime `npx skills add` resolution with a locally installed, version-pinned dependency. 3. If `npx` remains necessary, specify the exact package and version and prevent implicit installation where supported. 4. Validate downloaded packages against trusted registry integrity metadata or independently published cryptographic digests. 5. Use a controlled registry and a lockfile for development and release processes. 6. Review transitive dependencies and package lifecycle scripts before release. 7. Run installation with the least-privileged user and avoid administrator or root execution. 8. Document the exact package identity behind `npx skills add` so users can verify what will be executed. ]]>
