T08 · Insecure Dependencies
- Location
SKILL.md:8- Finding
Unpinned Third-Party npm Package Installation and Execution
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:8-12andSKILL.md:52-58
Vulnerability Type: Unpinned third-party dependency and implicit package execution
Risk Level: MediumVulnerable Code
yaml dependencies: npm: - "@aiagenta2z/onekey-gateway" installation: npm: npm -g install @aiagenta2z/onekey-gatewayshell ## install onekey agent gateway npm install @aiagenta2z/onekey-gateway ## CLI to Call API and Symbol List npx onekey agent aiagenta2z/financeagent get_uk_stock_market_lse '{"symbol_list": ["SHEL", "ULVR"]}'Technical Analysis
The npm dependency is specified without an exact version or integrity constraint. Consequently, installation resolves whatever package release the registry currently associates with the package name rather than a release reviewed during the skill audit.
The documented
npxinvocation can also execute package-provided code. Depending on the local npm andnpxenvironment, a missing executable may trigger package resolution or installation. npm packages can execute code through lifecycle scripts and their command-line entry points. The global installation recommendation further increases exposure by making the package available beyond an isolated project environment.This is a supply-chain weakness rather than evidence that the named package is currently malicious. Exploitation would require compromise or malicious publication of the package or one of its transitive dependencies.
Attack Path
- An attacker compromises the npm publisher account, package release process, registry resolution path, or a transitive dependency.
- The attacker publishes a malicious release under the package name or causes an unsafe dependency version to be resolved.
- A user or Agent follows the skill instructions and runs the unpinned
npm install, global installation, ornpxcommand. - npm retrieves the attacker-controlled release.
- Malicious lifecycle or runtime code executes with the p ...[truncated 651 chars]
- Remediation
View remediation
Remediation Suggestions
- Pin the dependency to a reviewed exact version rather than using an unconstrained package name.
- Maintain a lockfile containing registry-resolved integrity hashes and install with
npm ci. - Verify the package publisher, repository, release provenance, and transitive dependency tree.
- Avoid global installation; use a project-local, isolated dependency environment.
- Avoid
npxbehavior that can implicitly download packages. Invoke an already installed, version-pinned local binary instead. - Disable unnecessary lifecycle scripts during installation where compatible with the package, for example by using
--ignore-scripts. - Run the package under a least-privileged account or sandbox with restricted filesystem, environment-variable, and network access.
- Document the expected package version and trusted registry explicitly so dependency changes receive a new security review.
