T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:30
- Finding
- Global Installation of an Unverified Third-Party npm Package## Vulnerability Details **File Location**: `SKILL.md`, lines 30–34 **Vulnerability Type**: Supply-chain exposure through global package installation **Risk Level**: Medium **Vulnerable Code**: ```markdown 1. Install `okx` CLI: ```bash npm install -g @okx_ai/okx-trade-cli ``` ``` ### Technical Analysis The Skill instructs users or agents to install `@okx_ai/okx-trade-cli` globally from the npm registry. This installation command does not specify the declared Skill version, verify a package integrity hash, validate package provenance, or provide a lockfile. Consequently, npm resolves the version available under the package name at installation time. npm packages can execute lifecycle scripts during installation. A compromised maintainer account, malicious package release, registry compromise, or package ownership change could therefore result in arbitrary code executing with the privileges of the user running the installation. Global installation also makes the resulting executable available outside the project and increases its exposure to unrelated sessions. This is especially sensitive because the installed CLI is subsequently trusted to process OKX authentication information and perform authenticated financial operations. ### Attack Path 1. An attacker compromises the npm package, a maintainer account, or the associated publishing process. 2. The attacker publishes a malicious release under `@okx_ai/okx-trade-cli`. 3. A user follows the unversioned global installation instruction. 4. npm resolves and installs the malicious release. 5. Malicious lifecycle or runtime code executes with the installing user's privileges. 6. The package accesses local OKX configuration, session information, environment variables, or other files available to that user. 7. Stolen credentials may then be used to inspect the account or perform operations allowed by the affected credentials. ### Impact Assessment Succes ...[truncated 605 chars]
- Remediation
- ## Remediation Suggestions 1. Pin the package to the exact reviewed version: ```bash npm install -g @okx_ai/okx-trade-cli@1.4.7 ``` 2. Verify npm provenance, publisher identity, and the package integrity digest before installation. 3. Publish and document an expected cryptographic checksum or signed release artifact. 4. Prefer a project-local or isolated installation instead of a global installation: ```bash npm install --save-exact @okx_ai/okx-trade-cli@1.4.7 ``` 5. Use a lockfile and a trusted internal registry or allowlist where possible. 6. Review lifecycle scripts and consider installing with `--ignore-scripts` when lifecycle scripts are not required. 7. Execute the CLI in a sandbox or under a dedicated low-privilege account with access only to the necessary configuration. 8. Ensure OKX credentials use least privilege and do not include withdrawal permissions unless strictly necessary.
