T08 · Insecure Dependencies
- Location
SKILL.md:60- Finding
Unpinned npm CLI Executes Remote Package Code with Access to a Funded Wallet Key
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 60–68
Vulnerability Type: Unpinned third-party dependency execution with access to sensitive credentials
Risk Level: HighVulnerable snippet:
bash bunx @wdhsh/cli --help # zero-install, one-shot npm i -g @wdhsh/cli && wdh --helpbash export WDH_WALLET_PRIVATE_KEY=0x...Once the env var is set, every command pays automatically. Without it the CLI refuses to run.
Technical Analysis
The documented installation and execution commands do not pin
@wdhsh/clito a reviewed version. Consequently,bunx @wdhsh/clican retrieve and execute whatever package version the npm registry resolves at invocation time. The global installation command has the same issue and may additionally execute package installation lifecycle scripts.This creates a time-of-check/time-of-use supply-chain boundary: auditing this skill does not establish which future version of the external CLI will execute. If the npm publisher account, package, registry resolution, or a future release is compromised, attacker-controlled JavaScript can run locally.
The impact is amplified because the CLI is explicitly run with
WDH_WALLET_PRIVATE_KEYin its environment. Code executing within the package can read that environment variable directly. It may also access files and network resources allowed to the invoking user. The documentation confirms that this key controls a wallet funded with USDC on Base mainnet and that commands automatically authorize payments.No malicious implementation of
@wdhsh/cliwas present in the audited project, and the audit does not establish that the current npm package is malicious. The confirmed weakness is the unsafe, unpinned trust and execution model documented by the skill.Attack Path
- An attacker compromises the npm package, its publisher credentials, or the package release process.
- The attacker publishe ...[truncated 1326 chars]
- Remediation
View remediation
Remediation Suggestions
-
Pin the CLI to an explicitly reviewed version in every command, for example:
bash bunx @wdhsh/cli@0.3.1 --helpUpdate the version only through a controlled review process.
-
Prefer a committed dependency lockfile and reproducible installation workflow over on-demand resolution of the latest registry release. Enforce package integrity hashes where the selected package manager supports them.
-
Disable unnecessary npm lifecycle scripts during installation, then separately verify that the CLI functions without them:
bash npm install --ignore-scripts --save-exact @wdhsh/cli@0.3.1 -
Verify package provenance, publisher identity, signatures or attestations, and integrity before promoting a new version.
-
Avoid exposing a raw wallet private key to a dynamically downloaded process. Prefer a constrained signer, hardware-backed wallet, isolated signing service, or wallet policy that limits destination contracts, token amounts, and cumulative spending.
-
Run the CLI in a sandbox with minimal filesystem and network permissions. Supply only the credentials required for the specific operation.
-
Continue using a dedicated low-balance wallet, but also enforce strict balance and allowance limits. Immediately rotate the wallet if execution of a compromised dependency is suspected.
-
Add explicit user confirmation before paid calls, particularly the higher-cost
feedbackandsupportoperations, and display the exact charge before signing.
-
