T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:8
- Finding
- Unpinned Third-Party npm Package Installation and Execution## Vulnerability Details **File Location**: `SKILL.md:8-12` and `SKILL.md:52-58` **Vulnerability Type**: Unpinned third-party dependency and implicit package execution **Risk Level**: Medium ### Vulnerable Code ```yaml dependencies: npm: - "@aiagenta2z/onekey-gateway" installation: npm: npm -g install @aiagenta2z/onekey-gateway ``` ```shell ## 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 `npx` invocation can also execute package-provided code. Depending on the local npm and `npx` environment, 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 1. An attacker compromises the npm publisher account, package release process, registry resolution path, or a transitive dependency. 2. The attacker publishes a malicious release under the package name or causes an unsafe dependency version to be resolved. 3. A user or Agent follows the skill instructions and runs the unpinned `npm install`, global installation, or `npx` command. 4. npm retrieves the attacker-controlled release. 5. Malicious lifecycle or runtime code executes with the p ...[truncated 651 chars]
- Remediation
- ## Remediation Suggestions 1. Pin the dependency to a reviewed exact version rather than using an unconstrained package name. 2. Maintain a lockfile containing registry-resolved integrity hashes and install with `npm ci`. 3. Verify the package publisher, repository, release provenance, and transitive dependency tree. 4. Avoid global installation; use a project-local, isolated dependency environment. 5. Avoid `npx` behavior that can implicitly download packages. Invoke an already installed, version-pinned local binary instead. 6. Disable unnecessary lifecycle scripts during installation where compatible with the package, for example by using `--ignore-scripts`. 7. Run the package under a least-privileged account or sandbox with restricted filesystem, environment-variable, and network access. 8. Document the expected package version and trusted registry explicitly so dependency changes receive a new security review.
