T08 · Insecure Dependencies
- Location
SKILL.md:39- Finding
Unpinned npm and npx Dependencies Enable Supply-Chain Code Execution
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:39andSKILL.md:142
Vulnerability Type: Unpinned third-party dependency execution
Risk Level: MediumVulnerable Code
At
SKILL.md:39:bash npm install -g @okx_ai/okx-trade-cliAt
SKILL.md:142:text 4. Runs `npx skills add` to install to all locally detected agentsTechnical Analysis
The documented prerequisite installs
@okx_ai/okx-trade-cliwithout an explicit version, despite the project metadata referencing version1.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 addwithout 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
- An attacker compromises a relevant npm publisher account, registry, package release, transitive dependency, or package-resolution source.
- The attacker publishes or serves a malicious version that satisfies the unpinned package request.
- A user follows
SKILL.mdand runs the global npm installation command, or invokes the documented skill installation flow that uses npx. - npm or npx downloads the attacker-controlled package content because no exact version and verified integrity value constrain resolution.
- I ...[truncated 1235 chars]
- Remediation
View remediation
Remediation Suggestions
- Pin the documented CLI installation to the exact reviewed version:
bash npm install -g @okx_ai/okx-trade-cli@1.3.7- 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-
Verify package integrity using a trusted checksum, npm lockfile integrity metadata, provenance attestations, or registry signatures before execution.
-
Avoid global installation where practical. Use a project-local dependency with a committed lockfile and invoke it from the local dependency tree.
-
Disable or carefully review dependency lifecycle scripts where they are unnecessary. Perform installation in a restricted environment with minimal filesystem, credential, and network access.
-
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.
-
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.
-
Add automated dependency monitoring and periodically review pinned versions before updating them.
