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, lines 8-10 and 47-51
Vulnerability Type: Supply-chain exposure through an unpinned npm dependency
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_us_stock_market_nyse_nasdaq_dow '{"symbol_list": ["TSLA", "MSFT", "GOOG"]}'Technical Analysis
The dependency is specified without an exact version or integrity constraint. Consequently, the package version installed depends on the npm registry state at installation time rather than the version that was reviewed during this audit.
Both npm installation and the subsequent
npxcommand can execute publisher-controlled code. npm packages may run lifecycle scripts during installation, while the installed CLI executes with the privileges of the invoking user. The global installation instruction further increases scope by placing package-controlled files in a shared executable location. The project contains no lockfile, vendored implementation, checksum, or package source code with which to verify the dependency's behavior.This is a supply-chain weakness; the available evidence does not establish that the current package is malicious.
Attack Path
- An attacker compromises the package publisher, npm account, release process, or a transitive dependency.
- The attacker publishes a malicious package version under the same package name.
- A user follows the documented unpinned installation command.
- npm resolves and downloads the attacker-controlled release.
- Malicious lifecycle scripts execute during installation, or malicious logic executes when
npx onekeyis invoked. - The payload acts with the priv ...[truncated 582 chars]
- Remediation
View remediation
Remediation Suggestions
- Pin the dependency to a specifically reviewed version rather than accepting the latest registry release.
- Commit and enforce a lockfile containing integrity hashes.
- Prefer a project-local installation over
npm -g install. - Execute the already installed binary directly, or use
npx --no-install, to prevent implicit downloads at invocation time. - Use
npm ci --ignore-scriptswhen lifecycle scripts are unnecessary. If scripts are required, audit them explicitly before allowing execution. - Verify package ownership, provenance, signatures, and registry source before installation.
- Run the tool as an unprivileged user in an isolated environment with only the required credential and filesystem access.
- Periodically audit both the direct package and its transitive dependency tree.
