T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:39
- Finding
- Unpinned npm and npx Dependencies Enable Supply-Chain Code Execution## Vulnerability Details **File Location**: `SKILL.md:39` and `SKILL.md:142` **Vulnerability Type**: Unpinned third-party dependency execution **Risk Level**: Medium ### Vulnerable Code At `SKILL.md:39`: ```bash npm install -g @okx_ai/okx-trade-cli ``` At `SKILL.md:142`: ```text 4. Runs `npx skills add` to install to all locally detected agents ``` ### Technical Analysis The documented prerequisite installs `@okx_ai/okx-trade-cli` without an explicit version, despite the project metadata referencing version `1.3.7`. Consequently, npm resolves the package version available under the applicable distribution tag at installation time rather than a version reviewed as part of this audit. The installation workflow also delegates agent installation to `npx skills add` without specifying an exact package version or integrity hash. Depending on the local npm environment, npx may retrieve package content from the configured registry and execute it immediately. The effective executable payload can therefore differ from the content reviewed in this project. No lockfile, checksum, package signature, or other local integrity control is present in the audited project to constrain either operation. The global CLI installation and subsequent installation into all detected agents increase the affected scope if a registry account, package release, transitive dependency, configured registry, or package-resolution process is compromised. ### Attack Path 1. An attacker compromises a relevant npm publisher account, registry, package release, transitive dependency, or package-resolution source. 2. The attacker publishes or serves a malicious version that satisfies the unpinned package request. 3. A user follows `SKILL.md` and runs the global npm installation command, or invokes the documented skill installation flow that uses npx. 4. npm or npx downloads the attacker-controlled package content because no exact version and verified integrity value constrain resolution. 5. I ...[truncated 1235 chars]
- Remediation
- ## Remediation Suggestions 1. Pin the documented CLI installation to the exact reviewed version: ```bash npm install -g @okx_ai/okx-trade-cli@1.3.7 ``` 2. Replace the implicit npx package resolution with an explicit package name and exact version. For example: ```bash npm exec --package=skills@EXACT_REVIEWED_VERSION -- skills add ``` 3. Verify package integrity using a trusted checksum, npm lockfile integrity metadata, provenance attestations, or registry signatures before execution. 4. Avoid global installation where practical. Use a project-local dependency with a committed lockfile and invoke it from the local dependency tree. 5. Disable or carefully review dependency lifecycle scripts where they are unnecessary. Perform installation in a restricted environment with minimal filesystem, credential, and network access. 6. Require explicit user confirmation before installing content into multiple agent environments. Display the resolved package name, version, registry, publisher, destination directories, and verification status before proceeding. 7. Ensure the implementation invokes npx in a mode that refuses implicit package installation or unexpected resolution. Installation should fail closed if the exact approved package version is unavailable. 8. Add automated dependency monitoring and periodically review pinned versions before updating them.
