T08 · Insecure Dependencies
- Location
SKILL.md:417- Finding
Unpinned npm Package Execution Through npx
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 417–422
Vulnerability Type: Unpinned third-party package execution
Risk Level: MediumVulnerable Code
bash ## 2. CLIs Usage export DEEPNLP_ONEKEY_ROUTER_ACCESS=your_access_key npx onekey agent craftsman-agent/craftsman-agent social_media_posts '{"prompt":"Movie Odyssey Main Characters Introduction,"images":[],"card_count":1,"template_id":"social-media-carousel", ... }'The command invokes the
onekeynpm package without specifying an exact package version, lockfile, or integrity hash. Depending on the local npm configuration and cache,npxmay retrieve and execute the currently resolved package release from the configured npm registry.Technical Analysis
This creates a mutable software supply-chain boundary: the package code executed by users can differ from the code that existed when the skill was audited. The document also exports
DEEPNLP_ONEKEY_ROUTER_ACCESSimmediately before package execution, making that credential available in the child process environment.No evidence establishes that the current
onekeypackage is malicious. The risk arises because the documentation does not pin or verify the executable dependency. If the package, a transitive dependency, its publisher account, or the configured registry were compromised, arbitrary package lifecycle or CLI code could run with the invoking user's privileges.Attack Path
- An attacker compromises the resolved
onekeynpm package, one of its dependencies, its publisher account, or a registry used by the victim. - The attacker publishes a malicious package release that includes hostile lifecycle or CLI behavior.
- A user follows
SKILL.mdand exports a validDEEPNLP_ONEKEY_ROUTER_ACCESScredential. - The user runs the unversioned
npx onekey ...command. npxresolves, downloads where necessary, and executes the attacker-controlled release.- The mal ...[truncated 853 chars]
- An attacker compromises the resolved
- Remediation
View remediation
Remediation Suggestions
- Pin
onekeyto an exact reviewed version, for examplenpx --no-install onekeyafter a controlled local installation. - Declare the package in a version-controlled
package.jsonusing an exact version rather than a range. - Commit the corresponding lockfile and verify registry integrity metadata during installation.
- Install dependencies in a separate review step and run the CLI with
npm exec --offline --noor an equivalent mode that prevents implicit package downloads. - Document the official package scope, publisher, registry, and expected integrity digest to reduce dependency-confusion and spoofing risks.
- Run the CLI in a restricted environment with minimal filesystem and network permissions.
- Supply the API credential only to the intended process, avoid retaining it in a long-lived shell environment, and rotate it if package compromise is suspected.
- Review package lifecycle scripts and transitive dependencies before approving upgrades.
- Pin
