T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:8
- Finding
- Unpinned Third-Party npm Package Installation and Execution## Vulnerability Details **File Location**: `SKILL.md`, lines 8-12 and 52-57 **Vulnerability Type**: Unpinned and externally maintained executable dependency **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_india_stock_market_nse_india '{"symbol_list": ["TM03", "IT"]}' ``` ### Technical Analysis The Skill directs users to install and execute `@aiagenta2z/onekey-gateway` without specifying an exact version or package integrity value. Consequently, the installed code is determined by the package registry state at installation time rather than by the reviewed Skill artifact. npm packages can execute code through lifecycle scripts during installation and through their command-line entry points at runtime. The globally installed variant increases the potential system-wide effect and may expose the executable to unrelated sessions. The dependency's implementation is not included in this project, so its behavior could not be verified as part of this audit. ### Attack Path 1. An attacker compromises the npm publisher account, registry distribution path, or a future package release. 2. The attacker publishes a malicious release under the same package name. 3. A user follows the Skill instructions without an explicit version pin. 4. npm resolves and installs the attacker-controlled release. 5. Malicious lifecycle scripts or CLI code execute with the privileges of the user running npm or `npx`. 6. The payload can access files, credentials, environment variables, and network resources available to that user. ### Impact Assessment Exploitation could result in arbitrary code execution under the installing user's privileges. Acce ...[truncated 453 chars]
- Remediation
- ## Remediation Suggestions - Pin the dependency to a reviewed exact version rather than relying on the latest registry release. - Verify the package tarball with a trusted integrity hash or signature. - Use a committed lockfile and `npm ci` for reproducible installation where the project structure permits it. - Disable lifecycle scripts with `--ignore-scripts` if they are not required. - Avoid global installation and execute the dependency in a restricted, least-privileged environment. - Review the package source, maintainers, publication history, transitive dependencies, and lifecycle scripts before approving it. - Consider vendoring or otherwise locking a reviewed artifact so the effective code cannot change after the Skill review.
